tests: Reproduce the issue with missing MIR for ambiguous reexports

This commit is contained in:
Vadim Petrochenkov
2025-12-28 23:11:15 +03:00
parent 78df2f92de
commit a8e91473c5
3 changed files with 55 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
//@ build-fail
//@ aux-crate: ambiguous_reachable_extern=ambiguous-reachable-extern.rs
#![allow(ambiguous_glob_imports)]
fn main() {
ambiguous_reachable_extern::generic::<u8>();
}
//~? ERROR missing optimized MIR
@@ -0,0 +1,31 @@
error: missing optimized MIR for `ambiguous_reachable_extern::m1::generic::<u8>` in the crate `ambiguous_reachable_extern`
|
note: missing optimized MIR for this item (was the crate `ambiguous_reachable_extern` compiled with `--emit=metadata`?)
--> $DIR/auxiliary/ambiguous-reachable-extern.rs:2:5
|
LL | pub fn generic<T>() {
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error
Future incompatibility report: Future breakage diagnostic:
warning: `generic` is ambiguous
--> $DIR/ambiguous-reachable.rs:7:33
|
LL | ambiguous_reachable_extern::generic::<u8>();
| ^^^^^^^ ambiguous name
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
= note: ambiguous because of multiple glob imports of a name in the same module
note: `generic` could refer to the function defined here
--> $DIR/auxiliary/ambiguous-reachable-extern.rs:13:9
|
LL | pub use m1::*;
| ^^
note: `generic` could also refer to the function defined here
--> $DIR/auxiliary/ambiguous-reachable-extern.rs:14:9
|
LL | pub use m2::*;
| ^^
@@ -0,0 +1,14 @@
mod m1 {
pub fn generic<T>() {
let x = 10;
let y = 11;
println!("hello {x} world {:?}", y);
}
}
mod m2 {
pub fn generic() {}
}
pub use m1::*;
pub use m2::*;