]> git.proxmox.com Git - rustc.git/blob - tests/ui/error-codes/E0423.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / error-codes / E0423.rs
1 fn main () {
2 struct Foo { a: bool };
3
4 let f = Foo(); //~ ERROR E0423
5 }
6
7 fn bar() {
8 struct S { x: i32, y: i32 }
9 #[derive(PartialEq)]
10 struct T {}
11
12 if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
13 //~^ ERROR struct literals are not allowed here
14 if T {} == T {} { println!("Ok"); }
15 //~^ ERROR E0423
16 //~| ERROR expected expression, found `==`
17 }
18
19 fn foo() {
20 for _ in std::ops::Range { start: 0, end: 10 } {}
21 //~^ ERROR struct literals are not allowed here
22 }