Skip to content

Commit 94e0499

Browse files
authored
Rollup merge of #147367 - chenyukang:yukang-trivial-cleanup, r=jieyouxu
Trivial code cleanup in resolve r? `@jieyouxu`
2 parents c840719 + 95445f9 commit 94e0499

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

compiler/rustc_resolve/src/imports.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,14 +741,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
741741
errors.retain(|(_import, err)| match err.module {
742742
// Skip `use` errors for `use foo::Bar;` if `foo.rs` has unrecovered parse errors.
743743
Some(def_id) if self.mods_with_parse_errors.contains(&def_id) => false,
744-
_ => true,
745-
});
746-
errors.retain(|(_import, err)| {
747744
// If we've encountered something like `use _;`, we've already emitted an error stating
748745
// that `_` is not a valid identifier, so we ignore that resolve error.
749-
err.segment != Some(kw::Underscore)
746+
_ => err.segment != Some(kw::Underscore),
750747
});
751-
752748
if errors.is_empty() {
753749
self.tcx.dcx().delayed_bug("expected a parse or \"`_` can't be an identifier\" error");
754750
return;

0 commit comments

Comments
 (0)