diff options
Diffstat (limited to 'gcc/rust/rust-session-manager.cc')
-rw-r--r-- | gcc/rust/rust-session-manager.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index 1c5d729..8911e7d 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -874,6 +874,7 @@ Session::expansion (AST::Crate &crate) /* expand by calling cxtctxt object's monotonic_expander's expand_crate * method. */ MacroExpander expander (crate, cfg, *this); + std::vector<Resolver2_0::ResolveError> macro_errors; while (!fixed_point_reached && iterations < cfg.recursion_limit) { @@ -882,7 +883,11 @@ Session::expansion (AST::Crate &crate) auto ctx = Resolver2_0::NameResolutionContext (); if (flag_name_resolution_2_0) - Resolver2_0::Early (ctx).go (crate); + { + Resolver2_0::Early early (ctx); + early.go (crate); + macro_errors = early.get_macro_resolve_errors (); + } else Resolver::EarlyNameResolver ().go (crate); @@ -896,6 +901,10 @@ Session::expansion (AST::Crate &crate) break; } + // Fixed point reached: Emit unresolved macros error + for (auto &error : macro_errors) + error (); + if (iterations == cfg.recursion_limit) { auto &last_invoc = expander.get_last_invocation (); |