Supress some lookup errors if a module contains compile_error!

The problem is that when a macro expand to `compile_error!` because
its input is malformed, the actual error message from the
`compile_error!` might be hidden in a long list of other messages about
using items that should have otherwise been generated by the macro.

So suppress error about missing items in that module.

Fixes issue 68838
This commit is contained in:
Olivier Goffart 2025-11-30 17:02:07 +01:00
parent 621d76794c
commit f3e73dced1
6 changed files with 101 additions and 1 deletions

View file

@ -1173,6 +1173,10 @@ pub trait ResolverExpand {
/// Record the name of an opaque `Ty::ImplTrait` pre-expansion so that it can be used
/// to generate an item name later that does not reference placeholder macros.
fn insert_impl_trait_name(&mut self, id: NodeId, name: Symbol);
/// Mark the scope as having a compile error so that error for lookup in this scope
/// should be suppressed
fn mark_scope_with_compile_error(&mut self, parent_node: NodeId);
}
pub trait LintStoreExpand {