Add test for glob imported prelude collision trait.

This commit is contained in:
Mara Bos 2021-08-30 19:21:40 +02:00
parent 51e4fbaed1
commit 89a98675aa
3 changed files with 32 additions and 1 deletions

View file

@ -56,4 +56,15 @@ mod c {
}
}
mod d {
use super::m::*;
fn main() {
// See https://github.com/rust-lang/rust/issues/88471
let _: u32 = TryIntoU32::try_into(3u8).unwrap();
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
//~^^ WARNING this is accepted in the current edition
}
}
fn main() {}

View file

@ -56,4 +56,15 @@ mod c {
}
}
mod d {
use super::m::*;
fn main() {
// See https://github.com/rust-lang/rust/issues/88471
let _: u32 = 3u8.try_into().unwrap();
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
//~^^ WARNING this is accepted in the current edition
}
}
fn main() {}

View file

@ -30,5 +30,14 @@ LL | let _: u32 = 3u8.try_into().unwrap();
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 3 warnings emitted
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision-imported.rs:64:22
|
LL | let _: u32 = 3u8.try_into().unwrap();
| ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 4 warnings emitted