summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/remove-question-symbol-with-paren.stderr
blob: 40b9cf2dcd4d4cc24996913e4764a1a49091617b (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
error[E0308]: `?` operator has incompatible types
  --> $DIR/remove-question-symbol-with-paren.rs:5:6
   |
LL | fn foo() -> Option<()> {
   |             ---------- expected `Option<()>` because of return type
LL |     let x = Some(());
LL |     (x?)
   |      ^^ expected `Option<()>`, found `()`
   |
   = note: `?` operator cannot convert from `()` to `Option<()>`
   = note:   expected enum `Option<()>`
           found unit type `()`
help: try removing this `?`
   |
LL -     (x?)
LL +     (x)
   |
help: try wrapping the expression in `Some`
   |
LL |     (Some(x?))
   |      +++++  +

error: aborting due to previous error

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