2018-09-26 23:17:54 +00:00
|
|
|
error[E0599]: no method named `foobar` found for type `u32` in the current scope
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/trait-import-suggestions.rs:22:11
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
2021-04-24 01:24:02 +00:00
|
|
|
LL | fn foobar(&self) { }
|
|
|
|
| ------ the method is available for `u32` here
|
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x.foobar();
|
2024-02-10 03:33:20 +00:00
|
|
|
| ^^^^^^
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is in scope
|
2024-02-13 23:05:23 +00:00
|
|
|
help: trait `Foobar` which provides `foobar` is implemented but not in scope; perhaps you want to import it
|
2021-08-26 18:17:19 +00:00
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + use crate::foo::foobar::Foobar;
|
2021-08-26 18:17:19 +00:00
|
|
|
|
|
2024-02-14 18:23:01 +00:00
|
|
|
help: there is a method `bar` with a similar name
|
2024-02-10 03:33:20 +00:00
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - x.foobar();
|
|
|
|
LL + x.bar();
|
|
|
|
|
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
|
|
error[E0599]: no method named `bar` found for type `u32` in the current scope
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/trait-import-suggestions.rs:28:7
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
2021-04-24 01:24:02 +00:00
|
|
|
LL | fn bar(&self) { }
|
|
|
|
| --- the method is available for `u32` here
|
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x.bar();
|
2024-02-10 03:33:20 +00:00
|
|
|
| ^^^
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is in scope
|
2024-02-13 23:05:23 +00:00
|
|
|
help: trait `Bar` which provides `bar` is implemented but not in scope; perhaps you want to import it
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + use crate::foo::Bar;
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
2024-02-14 18:23:01 +00:00
|
|
|
help: there is a method `foobar` with a similar name
|
2024-02-10 03:33:20 +00:00
|
|
|
|
|
2025-02-13 03:07:18 +00:00
|
|
|
LL | x.foobar();
|
2025-02-13 03:21:25 +00:00
|
|
|
| +++
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
|
|
error[E0599]: no method named `baz` found for type `u32` in the current scope
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/trait-import-suggestions.rs:29:7
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x.baz();
|
2024-02-10 03:37:08 +00:00
|
|
|
| ^^^
|
|
|
|
|
|
2024-02-14 18:23:01 +00:00
|
|
|
help: there is a method `bar` with a similar name
|
2024-02-10 03:37:08 +00:00
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - x.baz();
|
|
|
|
LL + x.bar();
|
|
|
|
|
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
|
|
error[E0599]: no function or associated item named `from_str` found for type `u32` in the current scope
|
2018-12-07 18:15:36 +00:00
|
|
|
--> $DIR/trait-import-suggestions.rs:30:18
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | let y = u32::from_str("33");
|
2019-03-10 23:20:15 +00:00
|
|
|
| ^^^^^^^^ function or associated item not found in `u32`
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is in scope
|
2024-02-13 23:05:23 +00:00
|
|
|
help: trait `FromStr` which provides `from_str` is implemented but not in scope; perhaps you want to import it
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + use std::str::FromStr;
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
2024-02-14 18:23:01 +00:00
|
|
|
help: there is an associated function `from` with a similar name
|
2022-03-14 21:07:19 +00:00
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - let y = u32::from_str("33");
|
|
|
|
LL + let y = u32::from("33");
|
|
|
|
|
|
2018-09-26 23:17:54 +00:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0599`.
|