]> git.lizzy.rs Git - rust.git/blob - src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
Rollup merge of #100928 - CleanCut:rustc_metadata_diagnostics, r=davidtwco
[rust.git] / src / test / ui / resolve / typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
1 error[E0425]: cannot find value `config` in this scope
2   --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:7:16
3    |
4 LL |         Self { config }
5    |                ^^^^^^
6    |                |
7    |                a field by this name exists in `Self`
8    |                help: a local variable with a similar name exists: `cofig`
9
10 error[E0425]: cannot find value `config` in this scope
11   --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:11:20
12    |
13 LL |         println!("{config}");
14    |                    ^^^^^^
15    |                    |
16    |                    a field by this name exists in `Self`
17    |                    help: a local variable with a similar name exists: `cofig`
18
19 error[E0425]: cannot find value `config` in this scope
20   --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:15:20
21    |
22 LL |         println!("{config}");
23    |                    ^^^^^^
24    |
25 help: you might have meant to use the available field
26    |
27 LL |         println!("{self.config}");
28    |                    ~~~~~~~~~~~
29 help: a local variable with a similar name exists
30    |
31 LL |         println!("{cofig}");
32    |                    ~~~~~
33
34 error[E0425]: cannot find function `baz` in this scope
35   --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:31:9
36    |
37 LL |         baz();
38    |         ^^^
39 ...
40 LL | fn ba() {}
41    | ------- similarly named function `ba` defined here
42    |
43 help: you might have meant to call the method
44    |
45 LL |         self.baz();
46    |         ~~~~~~~~
47 help: a function with a similar name exists
48    |
49 LL |         ba();
50    |         ~~
51
52 error[E0425]: cannot find value `bah` in this scope
53   --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:33:9
54    |
55 LL |         bah;
56    |         ^^^
57 ...
58 LL | fn ba() {}
59    | ------- similarly named function `ba` defined here
60    |
61 help: you might have meant to call the associated function
62    |
63 LL |         Self::bah;
64    |         ~~~~~~~~~
65 help: a function with a similar name exists
66    |
67 LL |         ba;
68    |         ~~
69
70 error[E0425]: cannot find value `BAR` in this scope
71   --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:35:9
72    |
73 LL |         BAR;
74    |         ^^^
75 ...
76 LL | const BARR: u32 = 3;
77    | -------------------- similarly named constant `BARR` defined here
78    |
79 help: you might have meant to use the associated `const`
80    |
81 LL |         Self::BAR;
82    |         ~~~~~~~~~
83 help: a constant with a similar name exists
84    |
85 LL |         BARR;
86    |         ~~~~
87
88 error[E0412]: cannot find type `Baz` in this scope
89   --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:37:18
90    |
91 LL |         let foo: Baz = "".to_string();
92    |                  ^^^
93 ...
94 LL | type Bar = String;
95    | ------------------ similarly named type alias `Bar` defined here
96    |
97 help: you might have meant to use the associated type
98    |
99 LL |         let foo: Self::Baz = "".to_string();
100    |                  ~~~~~~~~~
101 help: a type alias with a similar name exists
102    |
103 LL |         let foo: Bar = "".to_string();
104    |                  ~~~
105
106 error: aborting due to 7 previous errors
107
108 Some errors have detailed explanations: E0412, E0425.
109 For more information about an error, try `rustc --explain E0412`.