summaryrefslogtreecommitdiffstats
path: root/tests/ui/let-else/let-else-ref-bindings.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/let-else/let-else-ref-bindings.stderr')
-rw-r--r--tests/ui/let-else/let-else-ref-bindings.stderr18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/let-else/let-else-ref-bindings.stderr b/tests/ui/let-else/let-else-ref-bindings.stderr
index ada1805e7..0886d7f17 100644
--- a/tests/ui/let-else/let-else-ref-bindings.stderr
+++ b/tests/ui/let-else/let-else-ref-bindings.stderr
@@ -6,6 +6,10 @@ LL | let Some(ref a): Option<&[u8]> = some else { return };
|
= note: expected enum `Option<&[u8]>`
found enum `Option<Vec<u8>>`
+help: try using `.as_deref()` to convert `Option<Vec<u8>>` to `Option<&[u8]>`
+ |
+LL | let Some(ref a): Option<&[u8]> = some.as_deref() else { return };
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/let-else-ref-bindings.rs:20:38
@@ -15,6 +19,11 @@ LL | let Some(ref a): Option<&[u8]> = &some else { return };
|
= note: expected enum `Option<&[u8]>`
found reference `&Option<Vec<u8>>`
+help: try using `.as_deref()` to convert `&Option<Vec<u8>>` to `Option<&[u8]>`
+ |
+LL - let Some(ref a): Option<&[u8]> = &some else { return };
+LL + let Some(ref a): Option<&[u8]> = some.as_deref() else { return };
+ |
error[E0308]: mismatched types
--> $DIR/let-else-ref-bindings.rs:24:34
@@ -26,6 +35,10 @@ LL | let Some(a): Option<&[u8]> = some else { return };
|
= note: expected enum `Option<&[u8]>`
found enum `Option<Vec<u8>>`
+help: try using `.as_deref()` to convert `Option<Vec<u8>>` to `Option<&[u8]>`
+ |
+LL | let Some(a): Option<&[u8]> = some.as_deref() else { return };
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/let-else-ref-bindings.rs:27:34
@@ -37,6 +50,11 @@ LL | let Some(a): Option<&[u8]> = &some else { return };
|
= note: expected enum `Option<&[u8]>`
found reference `&Option<Vec<u8>>`
+help: try using `.as_deref()` to convert `&Option<Vec<u8>>` to `Option<&[u8]>`
+ |
+LL - let Some(a): Option<&[u8]> = &some else { return };
+LL + let Some(a): Option<&[u8]> = some.as_deref() else { return };
+ |
error[E0308]: mismatched types
--> $DIR/let-else-ref-bindings.rs:44:46