summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/remove-question-symbol-with-paren.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/remove-question-symbol-with-paren.stderr')
-rw-r--r--tests/ui/suggestions/remove-question-symbol-with-paren.stderr25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/suggestions/remove-question-symbol-with-paren.stderr b/tests/ui/suggestions/remove-question-symbol-with-paren.stderr
new file mode 100644
index 000000000..40b9cf2dc
--- /dev/null
+++ b/tests/ui/suggestions/remove-question-symbol-with-paren.stderr
@@ -0,0 +1,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`.