2022-05-21 03:55:37 +00:00
|
|
|
error[E0425]: cannot find value `config` in this scope
|
|
|
|
--> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:7:16
|
|
|
|
|
|
2023-09-23 17:23:16 +00:00
|
|
|
LL | config: String,
|
|
|
|
| -------------- a field by that name exists in `Self`
|
|
|
|
...
|
2022-05-21 03:55:37 +00:00
|
|
|
LL | Self { config }
|
2023-09-23 17:23:16 +00:00
|
|
|
| ^^^^^^ help: a local variable with a similar name exists: `cofig`
|
2022-05-21 03:55:37 +00:00
|
|
|
|
|
|
|
error[E0425]: cannot find value `config` in this scope
|
|
|
|
--> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:11:20
|
|
|
|
|
|
2023-09-23 17:23:16 +00:00
|
|
|
LL | config: String,
|
|
|
|
| -------------- a field by that name exists in `Self`
|
|
|
|
...
|
2022-05-21 03:55:37 +00:00
|
|
|
LL | println!("{config}");
|
2023-09-23 17:23:16 +00:00
|
|
|
| ^^^^^^ help: a local variable with a similar name exists: `cofig`
|
2022-05-21 03:55:37 +00:00
|
|
|
|
|
|
|
error[E0425]: cannot find value `config` in this scope
|
|
|
|
--> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:15:20
|
|
|
|
|
|
|
|
|
LL | println!("{config}");
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: you might have meant to use the available field
|
|
|
|
|
|
|
|
|
LL | println!("{self.config}");
|
2023-09-23 04:45:17 +00:00
|
|
|
| +++++
|
2022-05-21 03:55:37 +00:00
|
|
|
help: a local variable with a similar name exists
|
|
|
|
|
|
|
|
|
LL | println!("{cofig}");
|
|
|
|
| ~~~~~
|
|
|
|
|
2022-05-23 10:58:20 +00:00
|
|
|
error[E0425]: cannot find value `bah` in this scope
|
|
|
|
--> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:33:9
|
|
|
|
|
|
|
|
|
LL | bah;
|
|
|
|
| ^^^
|
|
|
|
...
|
|
|
|
LL | fn ba() {}
|
|
|
|
| ------- similarly named function `ba` defined here
|
|
|
|
|
|
2022-10-21 13:43:58 +00:00
|
|
|
help: you might have meant to refer to the associated function
|
2022-05-23 10:58:20 +00:00
|
|
|
|
|
|
|
|
LL | Self::bah;
|
2023-09-23 04:45:17 +00:00
|
|
|
| ++++++
|
2022-05-23 10:58:20 +00:00
|
|
|
help: a function with a similar name exists
|
|
|
|
|
|
|
|
|
LL | ba;
|
|
|
|
| ~~
|
|
|
|
|
|
|
|
error[E0425]: cannot find value `BAR` in this scope
|
|
|
|
--> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:35:9
|
|
|
|
|
|
|
|
|
LL | BAR;
|
|
|
|
| ^^^
|
|
|
|
...
|
|
|
|
LL | const BARR: u32 = 3;
|
|
|
|
| -------------------- similarly named constant `BARR` defined here
|
|
|
|
|
|
|
|
|
help: you might have meant to use the associated `const`
|
|
|
|
|
|
|
|
|
LL | Self::BAR;
|
2023-09-23 04:45:17 +00:00
|
|
|
| ++++++
|
2022-05-23 10:58:20 +00:00
|
|
|
help: a constant with a similar name exists
|
|
|
|
|
|
|
|
|
LL | BARR;
|
|
|
|
| ~~~~
|
|
|
|
|
|
|
|
error[E0412]: cannot find type `Baz` in this scope
|
|
|
|
--> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:37:18
|
|
|
|
|
|
|
|
|
LL | let foo: Baz = "".to_string();
|
|
|
|
| ^^^
|
|
|
|
...
|
|
|
|
LL | type Bar = String;
|
|
|
|
| ------------------ similarly named type alias `Bar` defined here
|
|
|
|
|
|
|
|
|
help: you might have meant to use the associated type
|
|
|
|
|
|
|
|
|
LL | let foo: Self::Baz = "".to_string();
|
2023-09-23 04:45:17 +00:00
|
|
|
| ++++++
|
2022-05-23 10:58:20 +00:00
|
|
|
help: a type alias with a similar name exists
|
|
|
|
|
|
|
|
|
LL | let foo: Bar = "".to_string();
|
|
|
|
| ~~~
|
|
|
|
|
2022-10-05 05:35:34 +00:00
|
|
|
error[E0425]: cannot find function `baz` in this scope
|
|
|
|
--> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:31:9
|
|
|
|
|
|
|
|
|
LL | baz();
|
|
|
|
| ^^^
|
|
|
|
...
|
|
|
|
LL | fn ba() {}
|
|
|
|
| ------- similarly named function `ba` defined here
|
|
|
|
|
|
|
|
|
help: you might have meant to call the method
|
|
|
|
|
|
|
|
|
LL | self.baz();
|
2023-09-23 04:45:17 +00:00
|
|
|
| +++++
|
2022-10-05 05:35:34 +00:00
|
|
|
help: a function with a similar name exists
|
|
|
|
|
|
|
|
|
LL | ba();
|
|
|
|
| ~~
|
|
|
|
|
2022-05-23 10:58:20 +00:00
|
|
|
error: aborting due to 7 previous errors
|
2022-05-21 03:55:37 +00:00
|
|
|
|
2022-05-23 10:58:20 +00:00
|
|
|
Some errors have detailed explanations: E0412, E0425.
|
|
|
|
For more information about an error, try `rustc --explain E0412`.
|