Auto merge of #56117 - petrochenkov:iempty, r=eddyb
resolve: Make "empty import canaries" invisible from other crates
Empty imports `use prefix::{};` are desugared into `use prefix::{self as _};` to make sure the prefix is checked for privacy/stability/etc.
This caused issues in cross-crate scenarios because gensyms are lost in crate metadata (the `_` is a gensym).
Fixes https://github.com/rust-lang/rust/issues/55811
This commit is contained in:
commit
ee7bb94044
3 changed files with 15 additions and 1 deletions
5
src/test/ui/imports/auxiliary/issue-55811.rs
Normal file
5
src/test/ui/imports/auxiliary/issue-55811.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
mod m {}
|
||||
|
||||
// These two imports should not conflict when this crate is loaded from some other crate.
|
||||
use m::{};
|
||||
use m::{};
|
||||
6
src/test/ui/imports/issue-55811.rs
Normal file
6
src/test/ui/imports/issue-55811.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// compile-pass
|
||||
// aux-build:issue-55811.rs
|
||||
|
||||
extern crate issue_55811;
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue