2021-10-25 20:04:35 -04:00
|
|
|
error[E0433]: failed to resolve: use of undeclared type `TryFrom`
|
2024-02-10 03:33:20 +00:00
|
|
|
--> $DIR/suggest-tryinto-edition-change.rs:10:19
|
2021-10-25 20:04:35 -04:00
|
|
|
|
|
2021-10-26 21:18:04 -04:00
|
|
|
LL | let _i: i16 = TryFrom::try_from(0_i32).unwrap();
|
2022-10-27 01:36:07 -05:00
|
|
|
| ^^^^^^^ use of undeclared type `TryFrom`
|
2021-10-25 20:04:35 -04:00
|
|
|
|
|
2023-11-07 19:32:48 +00:00
|
|
|
= note: 'std::convert::TryFrom' is included in the prelude starting in Edition 2021
|
2024-06-12 23:51:31 +00:00
|
|
|
help: consider importing this trait
|
2021-10-25 20:04:35 -04:00
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + use std::convert::TryFrom;
|
2021-10-26 21:18:04 -04:00
|
|
|
|
|
2021-10-25 20:04:35 -04:00
|
|
|
|
|
|
|
|
error[E0433]: failed to resolve: use of undeclared type `TryInto`
|
2024-06-12 23:51:31 +00:00
|
|
|
--> $DIR/suggest-tryinto-edition-change.rs:15:19
|
2021-10-25 20:04:35 -04:00
|
|
|
|
|
2021-10-26 21:18:04 -04:00
|
|
|
LL | let _i: i16 = TryInto::try_into(0_i32).unwrap();
|
2022-10-27 01:36:07 -05:00
|
|
|
| ^^^^^^^ use of undeclared type `TryInto`
|
2021-10-25 20:04:35 -04:00
|
|
|
|
|
2023-11-07 19:32:48 +00:00
|
|
|
= note: 'std::convert::TryInto' is included in the prelude starting in Edition 2021
|
2024-06-12 23:51:31 +00:00
|
|
|
help: consider importing this trait
|
2021-10-25 20:04:35 -04:00
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + use std::convert::TryInto;
|
2021-10-26 21:18:04 -04:00
|
|
|
|
|
2021-10-25 20:04:35 -04:00
|
|
|
|
|
|
|
|
error[E0433]: failed to resolve: use of undeclared type `FromIterator`
|
2024-06-12 23:51:31 +00:00
|
|
|
--> $DIR/suggest-tryinto-edition-change.rs:20:22
|
2021-10-25 20:04:35 -04:00
|
|
|
|
|
2021-10-26 21:18:04 -04:00
|
|
|
LL | let _v: Vec<_> = FromIterator::from_iter(&[1]);
|
2022-10-27 01:36:07 -05:00
|
|
|
| ^^^^^^^^^^^^ use of undeclared type `FromIterator`
|
2021-10-25 20:04:35 -04:00
|
|
|
|
|
2023-11-07 19:32:48 +00:00
|
|
|
= note: 'std::iter::FromIterator' is included in the prelude starting in Edition 2021
|
2021-10-25 20:04:35 -04:00
|
|
|
help: a trait with a similar name exists
|
|
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - let _v: Vec<_> = FromIterator::from_iter(&[1]);
|
|
|
|
|
LL + let _v: Vec<_> = IntoIterator::from_iter(&[1]);
|
|
|
|
|
|
|
2024-06-12 23:51:31 +00:00
|
|
|
help: consider importing this trait
|
2021-10-25 20:04:35 -04:00
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + use std::iter::FromIterator;
|
2021-10-26 21:18:04 -04:00
|
|
|
|
|
2021-10-25 20:04:35 -04:00
|
|
|
|
2021-10-24 21:09:52 -04:00
|
|
|
error[E0599]: no method named `try_into` found for type `i32` in the current scope
|
2021-10-26 21:18:04 -04:00
|
|
|
--> $DIR/suggest-tryinto-edition-change.rs:6:25
|
2021-10-24 21:09:52 -04:00
|
|
|
|
|
2021-10-26 21:18:04 -04:00
|
|
|
LL | let _i: i16 = 0_i32.try_into().unwrap();
|
2024-02-10 03:33:20 +00:00
|
|
|
| ^^^^^^^^
|
2022-12-09 15:56:23 +00:00
|
|
|
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
2021-10-24 21:09:52 -04:00
|
|
|
|
|
2022-12-09 15:56:23 +00:00
|
|
|
= note: the method is available for `i32` here
|
2021-10-24 21:09:52 -04:00
|
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is in scope
|
2021-10-26 21:18:04 -04:00
|
|
|
= note: 'std::convert::TryInto' is included in the prelude starting in Edition 2021
|
2024-02-13 23:05:23 +00:00
|
|
|
help: trait `TryInto` which provides `try_into` is implemented but not in scope; perhaps you want to import it
|
2021-10-24 21:09:52 -04:00
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + use std::convert::TryInto;
|
2021-10-24 21:09:52 -04:00
|
|
|
|
|
2024-02-14 18:23:01 +00:00
|
|
|
help: there is a method `into` with a similar name
|
2024-02-10 03:33:20 +00:00
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - let _i: i16 = 0_i32.try_into().unwrap();
|
|
|
|
|
LL + let _i: i16 = 0_i32.into().unwrap();
|
|
|
|
|
|
|
2021-10-24 21:09:52 -04:00
|
|
|
|
2021-10-25 20:04:35 -04:00
|
|
|
error: aborting due to 4 previous errors
|
2021-10-24 21:09:52 -04:00
|
|
|
|
2021-10-25 20:04:35 -04:00
|
|
|
Some errors have detailed explanations: E0433, E0599.
|
|
|
|
|
For more information about an error, try `rustc --explain E0433`.
|