File: typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr

package info (click to toggle)
rustc-web 1.78.0%2Bdfsg1-2~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,245,420 kB
  • sloc: xml: 147,985; javascript: 18,022; sh: 11,083; python: 10,265; ansic: 6,172; cpp: 5,023; asm: 4,390; makefile: 4,269
file content (109 lines) | stat: -rw-r--r-- 3,269 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
error[E0425]: cannot find value `config` in this scope
  --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:7:16
   |
LL |     config: String,
   |     -------------- a field by that name exists in `Self`
...
LL |         Self { config }
   |                ^^^^^^ help: a local variable with a similar name exists: `cofig`

error[E0425]: cannot find value `config` in this scope
  --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:11:20
   |
LL |     config: String,
   |     -------------- a field by that name exists in `Self`
...
LL |         println!("{config}");
   |                    ^^^^^^ help: a local variable with a similar name exists: `cofig`

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}");
   |                    +++++
help: a local variable with a similar name exists
   |
LL |         println!("{cofig}");
   |                    ~~~~~

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
   |
help: you might have meant to refer to the associated function
   |
LL |         Self::bah;
   |         ++++++
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;
   |         ++++++
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();
   |                  ++++++
help: a type alias with a similar name exists
   |
LL |         let foo: Bar = "".to_string();
   |                  ~~~

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();
   |         +++++
help: a function with a similar name exists
   |
LL |         ba();
   |         ~~

error: aborting due to 7 previous errors

Some errors have detailed explanations: E0412, E0425.
For more information about an error, try `rustc --explain E0412`.