Skip to content

Commit

Permalink
[move-ide] Macro expansion crash workaround (#18466)
Browse files Browse the repository at this point in the history
## Description 

This is a workaround for an issue with IDE caching pre-compiled binaries
which do not include source code needed for macro expansion. It's only a
workaround to avoid `move-analyzer` crashing rather than a proper fix.
  • Loading branch information
awelc authored Jun 29, 2024
1 parent 090e222 commit 5428392
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ fn value(
error_exp(eloc)
}
E::UnresolvedError => {
assert!(context.env.has_errors());
assert!(context.env.has_errors() || context.env.ide_mode());
make_exp(HE::UnresolvedError)
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4441,7 +4441,7 @@ fn expand_macro(
let res = match macro_expand::call(context, call_loc, m, f, type_args.clone(), args, return_ty)
{
None => {
assert!(context.env.has_errors());
assert!(context.env.has_errors() || context.env.ide_mode());
(context.error_type(call_loc), TE::UnresolvedError)
}
Some(macro_expand::ExpandedMacro {
Expand Down

0 comments on commit 5428392

Please sign in to comment.