rust/src/test/ui/suggestions/suggest-tryinto-edition-change.stderr

68 lines
2.4 KiB
Plaintext
Raw Normal View History

error[E0433]: failed to resolve: use of undeclared type `TryFrom`
2021-10-26 03:14:48 +00:00
--> $DIR/suggest-tryinto-edition-change.rs:16:30
|
LL | let _i: Result<i16, _> = TryFrom::try_from(0_i32);
| ^^^^^^^ not found in this scope
|
= note: 'core::convert::TryFrom' is included in the prelude starting in Edition 2021
help: consider importing this trait
|
LL | use core::convert::TryFrom;
|
error[E0433]: failed to resolve: use of undeclared type `TryInto`
2021-10-26 03:14:48 +00:00
--> $DIR/suggest-tryinto-edition-change.rs:21:30
|
LL | let _i: Result<i16, _> = TryInto::try_into(0_i32);
| ^^^^^^^ not found in this scope
|
= note: 'core::convert::TryInto' is included in the prelude starting in Edition 2021
help: consider importing this trait
|
LL | use core::convert::TryInto;
|
error[E0433]: failed to resolve: use of undeclared type `FromIterator`
2021-10-26 03:14:48 +00:00
--> $DIR/suggest-tryinto-edition-change.rs:26:18
|
LL | let _i: () = FromIterator::from_iter(core::iter::empty());
| ^^^^^^^^^^^^
|
::: $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | pub trait IntoIterator {
| ---------------------- similarly named trait `IntoIterator` defined here
|
= note: 'core::iter::FromIterator' is included in the prelude starting in Edition 2021
help: a trait with a similar name exists
|
LL | let _i: () = IntoIterator::from_iter(core::iter::empty());
| ~~~~~~~~~~~~
help: consider importing this trait
|
LL | use core::iter::FromIterator;
|
error[E0599]: no method named `try_into` found for type `i32` in the current scope
2021-10-26 03:14:48 +00:00
--> $DIR/suggest-tryinto-edition-change.rs:11:36
|
LL | let _i: Result<i16, _> = 0_i32.try_into();
| ^^^^^^^^ method not found in `i32`
|
::: $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
LL | fn try_into(self) -> Result<T, Self::Error>;
| -------- the method is available for `i32` here
|
= help: items from traits can only be used if the trait is in scope
= note: 'core::convert::TryInto' is included in the prelude starting in Edition 2021
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use core::convert::TryInto;
|
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0433, E0599.
For more information about an error, try `rustc --explain E0433`.