@@ -38,12 +38,14 @@ impl TryIntoU32 for *const u16 {
3838
3939trait FromByteIterator {
4040 fn from_iter<T>(iter: T) -> Self
41- where T: Iterator<Item = u8>;
41+ where
42+ T: Iterator<Item = u8>;
4243}
4344
4445impl FromByteIterator for Vec<u8> {
4546 fn from_iter<T>(iter: T) -> Self
46- where T: Iterator<Item = u8>
47+ where
48+ T: Iterator<Item = u8>,
4749 {
4850 iter.collect()
4951 }
@@ -53,44 +55,44 @@ fn main() {
5355 // test dot-call that will break in 2021 edition
5456 let _: u32 = TryIntoU32::try_into(3u8).unwrap();
5557 //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
56- //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
58+ //~^^ WARNING this is accepted in the current edition
5759
5860 // test associated function call that will break in 2021 edition
5961 let _ = <u32 as TryFromU8>::try_from(3u8).unwrap();
6062 //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
61- //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
63+ //~^^ WARNING this is accepted in the current edition
6264
6365 // test reverse turbofish too
6466 let _ = <Vec<u8> as FromByteIterator>::from_iter(vec![1u8, 2, 3, 4, 5, 6].into_iter());
6567 //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
66- //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
68+ //~^^ WARNING this is accepted in the current edition
6769
6870 // negative testing lint (this line should *not* emit a warning)
6971 let _: u32 = TryFromU8::try_from(3u8).unwrap();
7072
7173 // test type omission
7274 let _: u32 = <_ as TryFromU8>::try_from(3u8).unwrap();
7375 //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
74- //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
76+ //~^^ WARNING this is accepted in the current edition
7577
7678 // test autoderef
7779 let _: u32 = TryIntoU32::try_into(*(&3u8)).unwrap();
7880 //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
79- //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
81+ //~^^ WARNING this is accepted in the current edition
8082
8183 // test autoref
8284 let _: u32 = TryIntoU32::try_into(&3.0).unwrap();
8385 //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
84- //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
86+ //~^^ WARNING this is accepted in the current edition
8587
8688 let mut data = 3u16;
8789 let mut_ptr = std::ptr::addr_of_mut!(data);
8890 let _: u32 = TryIntoU32::try_into(mut_ptr as *const _).unwrap();
8991 //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
90- //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
92+ //~^^ WARNING this is accepted in the current edition
9193
9294 type U32Alias = u32;
9395 let _ = <U32Alias as TryFromU8>::try_from(3u8).unwrap();
9496 //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
95- //~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
97+ //~^^ WARNING this is accepted in the current edition
9698}
0 commit comments