mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 02:43:45 +00:00
Add test for glob imported prelude collision trait.
This commit is contained in:
parent
51e4fbaed1
commit
89a98675aa
@ -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() {}
|
||||
|
@ -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() {}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user