summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/if-let-typo.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /tests/ui/suggestions/if-let-typo.stderr
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/suggestions/if-let-typo.stderr')
-rw-r--r--tests/ui/suggestions/if-let-typo.stderr73
1 files changed, 73 insertions, 0 deletions
diff --git a/tests/ui/suggestions/if-let-typo.stderr b/tests/ui/suggestions/if-let-typo.stderr
new file mode 100644
index 000000000..02148b7f7
--- /dev/null
+++ b/tests/ui/suggestions/if-let-typo.stderr
@@ -0,0 +1,73 @@
+error[E0425]: cannot find value `x` in this scope
+ --> $DIR/if-let-typo.rs:4:13
+ |
+LL | if Some(x) = foo {}
+ | ^ not found in this scope
+ |
+help: you might have meant to use pattern matching
+ |
+LL | if let Some(x) = foo {}
+ | +++
+
+error[E0425]: cannot find value `x` in this scope
+ --> $DIR/if-let-typo.rs:10:8
+ |
+LL | if x = 5 {}
+ | ^ not found in this scope
+ |
+help: you might have meant to use pattern matching
+ |
+LL | if let x = 5 {}
+ | +++
+
+error[E0308]: mismatched types
+ --> $DIR/if-let-typo.rs:4:8
+ |
+LL | if Some(x) = foo {}
+ | ^^^^^^^^^^^^^ expected `bool`, found `()`
+ |
+help: consider adding `let`
+ |
+LL | if let Some(x) = foo {}
+ | +++
+
+error[E0308]: mismatched types
+ --> $DIR/if-let-typo.rs:6:8
+ |
+LL | if Some(foo) = bar {}
+ | ^^^^^^^^^^^^^^^ expected `bool`, found `()`
+ |
+help: consider adding `let`
+ |
+LL | if let Some(foo) = bar {}
+ | +++
+
+error[E0308]: mismatched types
+ --> $DIR/if-let-typo.rs:7:8
+ |
+LL | if 3 = foo {}
+ | ^^^^^^^ expected `bool`, found `()`
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/if-let-typo.rs:8:16
+ |
+LL | if Some(3) = foo {}
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0308]: mismatched types
+ --> $DIR/if-let-typo.rs:8:8
+ |
+LL | if Some(3) = foo {}
+ | ^^^^^^^^^^^^^ expected `bool`, found `()`
+ |
+help: consider adding `let`
+ |
+LL | if let Some(3) = foo {}
+ | +++
+
+error: aborting due to 7 previous errors
+
+Some errors have detailed explanations: E0070, E0308, E0425.
+For more information about an error, try `rustc --explain E0070`.