Rollup merge of #92963 - terrarier2111:tuple-diagnostic, r=davidtwco
Implement tuple array diagnostic Fixes https://github.com/rust-lang/rust/issues/92089
This commit is contained in:
commit
1f3a2dd0b1
4 changed files with 51 additions and 5 deletions
|
|
@ -59,10 +59,8 @@ LL | &(true, false) => ()
|
|||
error[E0618]: expected function, found `(char, char)`
|
||||
--> $DIR/issue-5100.rs:48:14
|
||||
|
|
||||
LL | let v = [('a', 'b')
|
||||
| ______________-^^^^^^^^^
|
||||
LL | | ('c', 'd'),
|
||||
| |_______________________- call expression requires function
|
||||
LL | let v = [('a', 'b')
|
||||
| ^^^^^^^^^^- help: consider separating array elements with a comma: `,`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-5100.rs:55:19
|
||||
|
|
|
|||
7
src/test/ui/tuple/array-diagnostics.rs
Normal file
7
src/test/ui/tuple/array-diagnostics.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fn main() {
|
||||
let _tmp = [
|
||||
("C200B40A82", 3),
|
||||
("C200B40A83", 4) //~ ERROR: expected function, found `(&'static str, {integer})` [E0618]
|
||||
("C200B40A8537", 5),
|
||||
];
|
||||
}
|
||||
9
src/test/ui/tuple/array-diagnostics.stderr
Normal file
9
src/test/ui/tuple/array-diagnostics.stderr
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
error[E0618]: expected function, found `(&'static str, {integer})`
|
||||
--> $DIR/array-diagnostics.rs:4:9
|
||||
|
|
||||
LL | ("C200B40A83", 4)
|
||||
| ^^^^^^^^^^^^^^^^^- help: consider separating array elements with a comma: `,`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0618`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue