Skip to content

Commit c4c191a

Browse files
committed
Auto merge of #30324 - jseyfried:unfix_30159, r=nrc
r? @nrc Since PR #30294 unintentionally fixed issue #30159, it can cause breakage for a different reason than I originally stated in the PR (see #30159, I characterized the issue precisely there). This commit limits the scope of the breakage to what I originally stated in the PR by "unfixing" the backwards incompatible part of #30159. I think fixing #30159 has enough potential for breakage to warrant a crater run. If you disagree, I can cancel this PR, leaving it fixed.
2 parents 35b6461 + de0de61 commit c4c191a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/librustc_resolve/resolve_imports.rs

+3
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,9 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
871871
is_public: is_public
872872
};
873873
}
874+
} else {
875+
// FIXME #30159: This is required for backwards compatability.
876+
dest_import_resolution[namespace].is_public |= is_public;
874877
}
875878
};
876879
merge_child_item(ValueNS);

src/test/compile-fail/shadowed-use-visibility.rs

-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ mod foo {
1717

1818
mod bar {
1919
use foo::bar::f as g; //~ ERROR unresolved import
20-
21-
use foo as f;
22-
pub use foo::*;
2320
}
2421

25-
use bar::f::f; //~ ERROR unresolved import
2622
fn main() {}

0 commit comments

Comments
 (0)