summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/issue-86100-tuple-paren-comma.stderr
blob: 8c9a41a202767813306bf508a328f785ad74e45c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
error[E0308]: mismatched types
  --> $DIR/issue-86100-tuple-paren-comma.rs:9:22
   |
LL |     let _x: (i32,) = (5);
   |             ------   ^^^ expected tuple, found integer
   |             |
   |             expected due to this
   |
   = note: expected tuple `(i32,)`
               found type `{integer}`
help: use a trailing comma to create a tuple with one element
   |
LL |     let _x: (i32,) = (5,);
   |                        +

error[E0308]: mismatched types
  --> $DIR/issue-86100-tuple-paren-comma.rs:13:9
   |
LL |     foo((Some(3)));
   |     --- ^^^^^^^^^ expected tuple, found enum `Option`
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected tuple `(_,)`
               found enum `Option<{integer}>`
note: function defined here
  --> $DIR/issue-86100-tuple-paren-comma.rs:5:4
   |
LL | fn foo<T>(_t: (T,)) {}
   |    ^^^    --------
help: use a trailing comma to create a tuple with one element
   |
LL |     foo((Some(3),));
   |                 +

error[E0308]: mismatched types
  --> $DIR/issue-86100-tuple-paren-comma.rs:17:22
   |
LL |     let _s = S { _s: ("abc".to_string()) };
   |                      ^^^^^^^^^^^^^^^^^^^ expected tuple, found struct `String`
   |
   = note: expected tuple `(String,)`
             found struct `String`
help: use a trailing comma to create a tuple with one element
   |
LL |     let _s = S { _s: ("abc".to_string(),) };
   |                                        +

error[E0308]: mismatched types
  --> $DIR/issue-86100-tuple-paren-comma.rs:23:22
   |
LL |     let _x: (i32,) = (t);
   |             ------   ^^^ expected a tuple with 1 element, found one with 2 elements
   |             |
   |             expected due to this
   |
   = note: expected tuple `(i32,)`
              found tuple `({integer}, {integer})`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0308`.