Skip to content

Commit 4b94807

Browse files
committed
Update . -> :: tests for new diff suggestion format.
1 parent cf3e983 commit 4b94807

File tree

2 files changed

+84
-56
lines changed

2 files changed

+84
-56
lines changed

tests/ui/resolve/dot-notation-type-namespace-suggest-path-sep.stderr

+27-18
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ LL | let _ = Alias.new();
4242
|
4343
help: use the path separator to refer to an item
4444
|
45-
LL | let _ = Alias::new();
46-
| ~~
45+
LL - let _ = Alias.new();
46+
LL + let _ = Alias::new();
47+
|
4748

4849
error[E0423]: expected value, found type alias `Alias`
4950
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:26:13
@@ -53,8 +54,9 @@ LL | let _ = Alias.default;
5354
|
5455
help: use the path separator to refer to an item
5556
|
56-
LL | let _ = Alias::default;
57-
| ~~
57+
LL - let _ = Alias.default;
58+
LL + let _ = Alias::default;
59+
|
5860

5961
error[E0423]: expected value, found module `foo`
6062
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:30:13
@@ -64,8 +66,9 @@ LL | let _ = foo.bar;
6466
|
6567
help: use the path separator to refer to an item
6668
|
67-
LL | let _ = foo::bar;
68-
| ~~
69+
LL - let _ = foo.bar;
70+
LL + let _ = foo::bar;
71+
|
6972

7073
error[E0423]: expected value, found struct `std::cell::Cell`
7174
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:37:9
@@ -111,8 +114,9 @@ LL | Type!(alias).get();
111114
= note: this error originates in the macro `Type` (in Nightly builds, run with -Z macro-backtrace for more info)
112115
help: use the path separator to refer to an item
113116
|
114-
LL | <Type!(alias)>::get();
115-
| ~~~~~~~~~~~~~~~~
117+
LL - Type!(alias).get();
118+
LL + <Type!(alias)>::get();
119+
|
116120

117121
error[E0423]: expected value, found type alias `Alias`
118122
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:43:9
@@ -126,8 +130,9 @@ LL | Type! {alias}.get;
126130
= note: this error originates in the macro `Type` (in Nightly builds, run with -Z macro-backtrace for more info)
127131
help: use the path separator to refer to an item
128132
|
129-
LL | <Type! {alias}>::get;
130-
| ~~~~~~~~~~~~~~~~~
133+
LL - Type! {alias}.get;
134+
LL + <Type! {alias}>::get;
135+
|
131136

132137
error[E0423]: expected value, found struct `Vec`
133138
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:52:9
@@ -189,8 +194,9 @@ LL | let _ = create!(macro method alias);
189194
= note: this error originates in the macro `Type` which comes from the expansion of the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info)
190195
help: use the path separator to refer to an item
191196
|
192-
LL | <Type!(alias)>::new(0)
193-
| ~~~~~~~~~~~~~~~~
197+
LL - Type!(alias).new(0)
198+
LL + <Type!(alias)>::new(0)
199+
|
194200

195201
error[E0423]: expected value, found type alias `Alias`
196202
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:73:9
@@ -204,8 +210,9 @@ LL | let _ = check_ty!(Alias);
204210
= note: this error originates in the macro `check_ty` (in Nightly builds, run with -Z macro-backtrace for more info)
205211
help: use the path separator to refer to an item
206212
|
207-
LL | $Ty::foo
208-
| ~~
213+
LL - $Ty.foo
214+
LL + $Ty::foo
215+
|
209216

210217
error[E0423]: expected value, found type alias `Alias`
211218
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:80:9
@@ -219,8 +226,9 @@ LL | let _ = check_ident!(foo);
219226
= note: this error originates in the macro `check_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
220227
help: use the path separator to refer to an item
221228
|
222-
LL | <Alias>::$Ident
223-
| ~~~~~~~~~
229+
LL - Alias.$Ident
230+
LL + <Alias>::$Ident
231+
|
224232

225233
error[E0423]: expected value, found type alias `Alias`
226234
--> $DIR/dot-notation-type-namespace-suggest-path-sep.rs:87:9
@@ -234,8 +242,9 @@ LL | let _ = check_ty_ident!(Alias, foo);
234242
= note: this error originates in the macro `check_ty_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
235243
help: use the path separator to refer to an item
236244
|
237-
LL | <$Ty>::$Ident
238-
| ~~~~~~~
245+
LL - $Ty.$Ident
246+
LL + <$Ty>::$Ident
247+
|
239248

240249
error: aborting due to 17 previous errors
241250

tests/ui/resolve/enum-expected-value-suggest-variants.stderr

+57-38
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ LL | | }
1515
| |_^
1616
help: use the path separator to refer to a variant
1717
|
18-
LL | let _: Foo = Foo::A(0);
19-
| ~~
18+
LL - let _: Foo = Foo.A(0);
19+
LL + let _: Foo = Foo::A(0);
20+
|
2021

2122
error[E0423]: expected value, found enum `Foo`
2223
--> $DIR/enum-expected-value-suggest-variants.rs:23:18
@@ -35,10 +36,12 @@ LL | | }
3536
| |_^
3637
help: the following enum variants are available
3738
|
38-
LL | let _: Foo = (Foo::A(/* fields */)).Bad(0);
39-
| ~~~~~~~~~~~~~~~~~~~~~~
40-
LL | let _: Foo = (Foo::B(/* fields */)).Bad(0);
41-
| ~~~~~~~~~~~~~~~~~~~~~~
39+
LL - let _: Foo = Foo.Bad(0);
40+
LL + let _: Foo = (Foo::A(/* fields */)).Bad(0);
41+
|
42+
LL - let _: Foo = Foo.Bad(0);
43+
LL + let _: Foo = (Foo::B(/* fields */)).Bad(0);
44+
|
4245

4346
error[E0423]: expected value, found enum `Bar`
4447
--> $DIR/enum-expected-value-suggest-variants.rs:32:18
@@ -58,8 +61,9 @@ LL | | }
5861
| |_^
5962
help: use the path separator to refer to a variant
6063
|
61-
LL | let _: Bar = Bar::C(0);
62-
| ~~
64+
LL - let _: Bar = Bar.C(0);
65+
LL + let _: Bar = Bar::C(0);
66+
|
6367

6468
error[E0423]: expected value, found enum `Bar`
6569
--> $DIR/enum-expected-value-suggest-variants.rs:36:18
@@ -79,8 +83,9 @@ LL | | }
7983
| |_^
8084
help: use the path separator to refer to a variant
8185
|
82-
LL | let _: Bar = Bar::E;
83-
| ~~
86+
LL - let _: Bar = Bar.E;
87+
LL + let _: Bar = Bar::E;
88+
|
8489

8590
error[E0423]: expected value, found enum `Bar`
8691
--> $DIR/enum-expected-value-suggest-variants.rs:40:18
@@ -100,16 +105,20 @@ LL | | }
100105
| |_^
101106
help: you might have meant to use one of the following enum variants
102107
|
103-
LL | let _: Bar = Bar::E.Bad(0);
104-
| ~~~~~~
105-
LL | let _: Bar = Bar::F.Bad(0);
106-
| ~~~~~~
108+
LL - let _: Bar = Bar.Bad(0);
109+
LL + let _: Bar = Bar::E.Bad(0);
110+
|
111+
LL - let _: Bar = Bar.Bad(0);
112+
LL + let _: Bar = Bar::F.Bad(0);
113+
|
107114
help: alternatively, the following enum variants are also available
108115
|
109-
LL | let _: Bar = (Bar::C(/* fields */)).Bad(0);
110-
| ~~~~~~~~~~~~~~~~~~~~~~
111-
LL | let _: Bar = (Bar::D(/* fields */)).Bad(0);
112-
| ~~~~~~~~~~~~~~~~~~~~~~
116+
LL - let _: Bar = Bar.Bad(0);
117+
LL + let _: Bar = (Bar::C(/* fields */)).Bad(0);
118+
|
119+
LL - let _: Bar = Bar.Bad(0);
120+
LL + let _: Bar = (Bar::D(/* fields */)).Bad(0);
121+
|
113122

114123
error[E0423]: expected value, found enum `Bar`
115124
--> $DIR/enum-expected-value-suggest-variants.rs:45:18
@@ -129,16 +138,20 @@ LL | | }
129138
| |_^
130139
help: you might have meant to use one of the following enum variants
131140
|
132-
LL | let _: Bar = Bar::E.Bad;
133-
| ~~~~~~
134-
LL | let _: Bar = Bar::F.Bad;
135-
| ~~~~~~
141+
LL - let _: Bar = Bar.Bad;
142+
LL + let _: Bar = Bar::E.Bad;
143+
|
144+
LL - let _: Bar = Bar.Bad;
145+
LL + let _: Bar = Bar::F.Bad;
146+
|
136147
help: alternatively, the following enum variants are also available
137148
|
138-
LL | let _: Bar = (Bar::C(/* fields */)).Bad;
139-
| ~~~~~~~~~~~~~~~~~~~~~~
140-
LL | let _: Bar = (Bar::D(/* fields */)).Bad;
141-
| ~~~~~~~~~~~~~~~~~~~~~~
149+
LL - let _: Bar = Bar.Bad;
150+
LL + let _: Bar = (Bar::C(/* fields */)).Bad;
151+
|
152+
LL - let _: Bar = Bar.Bad;
153+
LL + let _: Bar = (Bar::D(/* fields */)).Bad;
154+
|
142155

143156
error[E0531]: cannot find tuple struct or tuple variant `A` in this scope
144157
--> $DIR/enum-expected-value-suggest-variants.rs:51:9
@@ -168,10 +181,12 @@ LL | | }
168181
| |_^
169182
help: try to match against one of the enum's variants
170183
|
171-
LL | Foo::A(..) => {}
172-
| ~~~~~~
173-
LL | Foo::B(..) => {}
174-
| ~~~~~~
184+
LL - Foo(..) => {}
185+
LL + Foo::A(..) => {}
186+
|
187+
LL - Foo(..) => {}
188+
LL + Foo::B(..) => {}
189+
|
175190

176191
error[E0423]: expected function, tuple struct or tuple variant, found enum `Foo`
177192
--> $DIR/enum-expected-value-suggest-variants.rs:15:18
@@ -190,10 +205,12 @@ LL | | }
190205
| |_^
191206
help: try to construct one of the enum's variants
192207
|
193-
LL | let _: Foo = Foo::A(0);
194-
| ~~~~~~
195-
LL | let _: Foo = Foo::B(0);
196-
| ~~~~~~
208+
LL - let _: Foo = Foo(0);
209+
LL + let _: Foo = Foo::A(0);
210+
|
211+
LL - let _: Foo = Foo(0);
212+
LL + let _: Foo = Foo::B(0);
213+
|
197214

198215
error[E0423]: expected function, tuple struct or tuple variant, found enum `Bar`
199216
--> $DIR/enum-expected-value-suggest-variants.rs:27:18
@@ -214,10 +231,12 @@ LL | | }
214231
| |_^
215232
help: try to construct one of the enum's variants
216233
|
217-
LL | let _: Bar = Bar::C(0);
218-
| ~~~~~~
219-
LL | let _: Bar = Bar::D(0);
220-
| ~~~~~~
234+
LL - let _: Bar = Bar(0);
235+
LL + let _: Bar = Bar::C(0);
236+
|
237+
LL - let _: Bar = Bar(0);
238+
LL + let _: Bar = Bar::D(0);
239+
|
221240

222241
error: aborting due to 10 previous errors
223242

0 commit comments

Comments
 (0)