1 // Make sure that trying to access `TryInto`, `TryFrom`, `FromIterator` in pre-2021 mentions
6 let _i: i16 = 0_i32.try_into().unwrap();
7 //~^ ERROR no method named `try_into` found for type `i32` in the current scope
8 //~| NOTE method not found in `i32`
9 //~| NOTE 'std::convert::TryInto' is included in the prelude starting in Edition 2021
11 let _i: i16 = TryFrom::try_from(0_i32).unwrap();
12 //~^ ERROR failed to resolve: use of undeclared type
13 //~| NOTE not found in this scope
14 //~| NOTE 'std::convert::TryFrom' is included in the prelude starting in Edition 2021
15 //~| NOTE 'core::convert::TryFrom' is included in the prelude starting in Edition 2021
17 let _i: i16 = TryInto::try_into(0_i32).unwrap();
18 //~^ ERROR failed to resolve: use of undeclared type
19 //~| NOTE not found in this scope
20 //~| NOTE 'std::convert::TryInto' is included in the prelude starting in Edition 2021
21 //~| NOTE 'core::convert::TryInto' is included in the prelude starting in Edition 2021
23 let _v: Vec<_> = FromIterator::from_iter(&[1]);
24 //~^ ERROR failed to resolve: use of undeclared type
25 //~| NOTE 'std::iter::FromIterator' is included in the prelude starting in Edition 2021
26 //~| NOTE 'core::iter::FromIterator' is included in the prelude starting in Edition 2021