X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_resolve%2Fsrc%2Fdiagnostics.rs;h=ab71fa0bc1d4d2a407c3d3ea28db8a60496a63a2;hb=ccb5595df2ed412eda6444edc7eaf06f709fa79d;hp=4fd6fe4e36c69093babe14a7b3b2e8c214fa83d4;hpb=938897e2e429445dca5a549b5d4eb194a291a7c2;p=rust.git diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 4fd6fe4e36c..ab71fa0bc1d 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -1393,7 +1393,7 @@ fn lookup_import_candidates_from_module( // If only some candidates are accessible, take just them if !candidates.iter().all(|v: &ImportSuggestion| !v.accessible) { - candidates = candidates.into_iter().filter(|x| x.accessible).collect(); + candidates.retain(|x| x.accessible) } candidates