Skip to content

Commit 63f95a4

Browse files
dtolnaypetrochenkov
authored andcommitted
Add test for errors triggered on parts of decomposed index
1 parent 3814eec commit 63f95a4

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/test/ui/tuple/index-invalid.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fn main() {
2+
let _ = (((),),).1.0; //~ ERROR no field `1` on type `(((),),)`
3+
4+
let _ = (((),),).0.1; //~ ERROR no field `1` on type `((),)`
5+
6+
let _ = (((),),).000.000; //~ ERROR no field `000` on type `(((),),)`
7+
}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error[E0609]: no field `1` on type `(((),),)`
2+
--> $DIR/index-invalid.rs:2:22
3+
|
4+
LL | let _ = (((),),).1.0;
5+
| ^
6+
7+
error[E0609]: no field `1` on type `((),)`
8+
--> $DIR/index-invalid.rs:4:24
9+
|
10+
LL | let _ = (((),),).0.1;
11+
| ^
12+
13+
error[E0609]: no field `000` on type `(((),),)`
14+
--> $DIR/index-invalid.rs:6:22
15+
|
16+
LL | let _ = (((),),).000.000;
17+
| ^^^
18+
19+
error: aborting due to 3 previous errors
20+
21+
For more information about this error, try `rustc --explain E0609`.

0 commit comments

Comments
 (0)