resolve: Do not build expensive suggestions if they are not actually used
Also remove a redundant parameter from `fn resolve_path(_with_ribs)`, `crate_lint: CrateLint` is a more detailed version of `record_used: bool` with `CrateLint::No` meaning `false` and anything else meaning `true`.
This commit is contained in:
@@ -296,9 +296,8 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
|
||||
&segments,
|
||||
Some(TypeNS),
|
||||
parent_scope,
|
||||
!speculative,
|
||||
path.span,
|
||||
CrateLint::SimplePath(id),
|
||||
if speculative { CrateLint::No } else { CrateLint::SimplePath(id) },
|
||||
) {
|
||||
PathResult::Module(ModuleOrUniformRoot::Module(module)) => {
|
||||
let res = module.res().expect("visibility resolved to unnamed block");
|
||||
|
||||
Reference in New Issue
Block a user