fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.9 KiB62 linesraw
1error[E0308]: mismatched types
2  --> $DIR/issue-86100-tuple-paren-comma.rs:9:22
3   |
4LL |     let _x: (i32,) = (5);
5   |             ------   ^^^ expected `(i32,)`, found integer
6   |             |
7   |             expected due to this
8   |
9   = note: expected tuple `(i32,)`
10               found type `{integer}`
11help: use a trailing comma to create a tuple with one element
12   |
13LL |     let _x: (i32,) = (5,);
14   |                        +
15
16error[E0308]: mismatched types
17  --> $DIR/issue-86100-tuple-paren-comma.rs:13:9
18   |
19LL |     foo((Some(3)));
20   |     --- ^^^^^^^^^ expected `(_,)`, found `Option<{integer}>`
21   |     |
22   |     arguments to this function are incorrect
23   |
24   = note: expected tuple `(_,)`
25               found enum `Option<{integer}>`
26note: function defined here
27  --> $DIR/issue-86100-tuple-paren-comma.rs:5:4
28   |
29LL | fn foo<T>(_t: (T,)) {}
30   |    ^^^    --------
31help: use a trailing comma to create a tuple with one element
32   |
33LL |     foo((Some(3),));
34   |                 +
35
36error[E0308]: mismatched types
37  --> $DIR/issue-86100-tuple-paren-comma.rs:17:22
38   |
39LL |     let _s = S { _s: ("abc".to_string()) };
40   |                      ^^^^^^^^^^^^^^^^^^^ expected `(String,)`, found `String`
41   |
42   = note: expected tuple `(String,)`
43             found struct `String`
44help: use a trailing comma to create a tuple with one element
45   |
46LL |     let _s = S { _s: ("abc".to_string(),) };
47   |                                        +
48
49error[E0308]: mismatched types
50  --> $DIR/issue-86100-tuple-paren-comma.rs:23:22
51   |
52LL |     let _x: (i32,) = (t);
53   |             ------   ^^^ expected a tuple with 1 element, found one with 2 elements
54   |             |
55   |             expected due to this
56   |
57   = note: expected tuple `(i32,)`
58              found tuple `({integer}, {integer})`
59
60error: aborting due to 4 previous errors
61
62For more information about this error, try `rustc --explain E0308`.