@@ -120,7 +120,7 @@ LL |     while || (Foo { x: 3 }).hi() {
120120   |              +            +
121121
122122error: struct literals are not allowed here
123-   --> $DIR/struct-literals-in-invalid-places.rs:49 :8
123+   --> $DIR/struct-literals-in-invalid-places.rs:53 :8
124124   |
125125LL |     if Foo { x: one(), }.hi() {
126126   |        ^^^^^^^^^^^^^^^^^
@@ -130,6 +130,49 @@ help: surround the struct literal with parentheses
130130LL |     if (Foo { x: one(), }).hi() {
131131   |        +                 +
132132
133+ error: struct literals are not allowed here
134+   --> $DIR/struct-literals-in-invalid-places.rs:61:15
135+    |
136+ LL |     if FOO == self::Foo { x: one() } {}
137+    |               ^^^^^^^^^^^^^^^^^^^^^^
138+    |
139+ help: surround the struct literal with parentheses
140+    |
141+ LL |     if FOO == (self::Foo { x: one() }) {}
142+    |               +                      +
143+ 
144+ error: struct literals are not allowed here
145+   --> $DIR/struct-literals-in-invalid-places.rs:63:15
146+    |
147+ LL |     if FOO == Foo::<> { x: one() } {}
148+    |               ^^^^^^^^^^^^^^^^^^^^
149+    |
150+ help: surround the struct literal with parentheses
151+    |
152+ LL |     if FOO == (Foo::<> { x: one() }) {}
153+    |               +                    +
154+ 
155+ error: struct literals are not allowed here
156+   --> $DIR/struct-literals-in-invalid-places.rs:66:19
157+    |
158+ LL |         if FOO == <T as Trait>::Out { x: one() } {}
159+    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160+    |
161+ help: surround the struct literal with parentheses
162+    |
163+ LL |         if FOO == (<T as Trait>::Out { x: one() }) {}
164+    |                   +                              +
165+ 
166+ error[E0658]: usage of qualified paths in this context is experimental
167+   --> $DIR/struct-literals-in-invalid-places.rs:66:19
168+    |
169+ LL |         if FOO == <T as Trait>::Out { x: one() } {}
170+    |                   ^^^^^^^^^^^^^^^^^
171+    |
172+    = note: see issue #86935 <https://github.com/rust-lang/rust/issues/86935> for more information
173+    = help: add `#![feature(more_qualified_paths)]` to the crate attributes to enable
174+    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
175+ 
133176error[E0277]: `bool` is not an iterator
134177  --> $DIR/struct-literals-in-invalid-places.rs:9:14
135178   |
@@ -185,7 +228,7 @@ help: use parentheses to call this closure
185228LL |     while (|| Foo { x: 3 }.hi())() {
186229   |           +                    +++
187230
188- error: aborting due to 17  previous errors
231+ error: aborting due to 21  previous errors
189232
190- Some errors have detailed explanations: E0277, E0308, E0533.
233+ Some errors have detailed explanations: E0277, E0308, E0533, E0658 .
191234For more information about an error, try `rustc --explain E0277`.
0 commit comments