|
1 | 1 | error[E0433]: failed to resolve: use of undeclared type `TryFrom`
|
2 |
| - --> $DIR/suggest-tryinto-edition-change.rs:11:19 |
| 2 | + --> $DIR/suggest-tryinto-edition-change.rs:14:30 |
3 | 3 | |
|
4 |
| -LL | let _i: i16 = TryFrom::try_from(0_i32).unwrap(); |
5 |
| - | ^^^^^^^ not found in this scope |
| 4 | +LL | let _i: Result<i16, _> = TryFrom::try_from(0_i32); |
| 5 | + | ^^^^^^^ not found in this scope |
6 | 6 | |
|
7 |
| - = note: 'std::convert::TryFrom' is included in the prelude starting in Edition 2021 |
8 | 7 | = note: 'core::convert::TryFrom' is included in the prelude starting in Edition 2021
|
9 |
| -help: consider importing one of these items |
10 |
| - | |
11 |
| -LL | use std::convert::TryFrom; |
| 8 | +help: consider importing this trait |
12 | 9 | |
|
13 | 10 | LL | use core::convert::TryFrom;
|
14 | 11 | |
|
15 | 12 |
|
16 | 13 | error[E0433]: failed to resolve: use of undeclared type `TryInto`
|
17 |
| - --> $DIR/suggest-tryinto-edition-change.rs:17:19 |
| 14 | + --> $DIR/suggest-tryinto-edition-change.rs:19:30 |
18 | 15 | |
|
19 |
| -LL | let _i: i16 = TryInto::try_into(0_i32).unwrap(); |
20 |
| - | ^^^^^^^ not found in this scope |
| 16 | +LL | let _i: Result<i16, _> = TryInto::try_into(0_i32); |
| 17 | + | ^^^^^^^ not found in this scope |
21 | 18 | |
|
22 |
| - = note: 'std::convert::TryInto' is included in the prelude starting in Edition 2021 |
23 | 19 | = note: 'core::convert::TryInto' is included in the prelude starting in Edition 2021
|
24 |
| -help: consider importing one of these items |
25 |
| - | |
26 |
| -LL | use std::convert::TryInto; |
| 20 | +help: consider importing this trait |
27 | 21 | |
|
28 | 22 | LL | use core::convert::TryInto;
|
29 | 23 | |
|
30 | 24 |
|
31 | 25 | error[E0433]: failed to resolve: use of undeclared type `FromIterator`
|
32 |
| - --> $DIR/suggest-tryinto-edition-change.rs:23:22 |
| 26 | + --> $DIR/suggest-tryinto-edition-change.rs:24:18 |
33 | 27 | |
|
34 |
| -LL | let _v: Vec<_> = FromIterator::from_iter(&[1]); |
35 |
| - | ^^^^^^^^^^^^ |
| 28 | +LL | let _i: () = FromIterator::from_iter(core::iter::empty()); |
| 29 | + | ^^^^^^^^^^^^ |
36 | 30 | |
|
37 | 31 | ::: $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
38 | 32 | |
|
39 | 33 | LL | pub trait IntoIterator {
|
40 | 34 | | ---------------------- similarly named trait `IntoIterator` defined here
|
41 | 35 | |
|
42 |
| - = note: 'std::iter::FromIterator' is included in the prelude starting in Edition 2021 |
43 | 36 | = note: 'core::iter::FromIterator' is included in the prelude starting in Edition 2021
|
44 | 37 | help: a trait with a similar name exists
|
45 | 38 | |
|
46 |
| -LL | let _v: Vec<_> = IntoIterator::from_iter(&[1]); |
47 |
| - | ~~~~~~~~~~~~ |
48 |
| -help: consider importing one of these items |
49 |
| - | |
50 |
| -LL | use std::iter::FromIterator; |
| 39 | +LL | let _i: () = IntoIterator::from_iter(core::iter::empty()); |
| 40 | + | ~~~~~~~~~~~~ |
| 41 | +help: consider importing this trait |
51 | 42 | |
|
52 | 43 | LL | use core::iter::FromIterator;
|
53 | 44 | |
|
54 | 45 |
|
55 | 46 | error[E0599]: no method named `try_into` found for type `i32` in the current scope
|
56 |
| - --> $DIR/suggest-tryinto-edition-change.rs:6:25 |
| 47 | + --> $DIR/suggest-tryinto-edition-change.rs:9:36 |
57 | 48 | |
|
58 |
| -LL | let _i: i16 = 0_i32.try_into().unwrap(); |
59 |
| - | ^^^^^^^^ method not found in `i32` |
| 49 | +LL | let _i: Result<i16, _> = 0_i32.try_into(); |
| 50 | + | ^^^^^^^^ method not found in `i32` |
60 | 51 | |
|
61 | 52 | ::: $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
62 | 53 | |
|
63 | 54 | LL | fn try_into(self) -> Result<T, Self::Error>;
|
64 | 55 | | -------- the method is available for `i32` here
|
65 | 56 | |
|
66 | 57 | = help: items from traits can only be used if the trait is in scope
|
67 |
| - = note: 'std::convert::TryInto' is included in the prelude starting in Edition 2021 |
| 58 | + = note: 'core::convert::TryInto' is included in the prelude starting in Edition 2021 |
68 | 59 | help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
69 | 60 | |
|
70 |
| -LL | use std::convert::TryInto; |
| 61 | +LL | use core::convert::TryInto; |
71 | 62 | |
|
72 | 63 |
|
73 | 64 | error: aborting due to 4 previous errors
|
|
0 commit comments