summaryrefslogtreecommitdiffstats
path: root/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
blob: 0b0a37f246c9323fe434a56ffa8c239f9b130801 (plain)
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 |         Self { config }
   |                ^^^^^^
   |                |
   |                a field by this name exists in `Self`
   |                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 |         println!("{config}");
   |                    ^^^^^^
   |                    |
   |                    a field by this name exists in `Self`
   |                    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 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[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 call 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: aborting due to 7 previous errors

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