about summary refs log tree commit diff
path: root/tests/ui/or-patterns/inconsistent-modes.stderr
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /tests/ui/or-patterns/inconsistent-modes.stderr
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'tests/ui/or-patterns/inconsistent-modes.stderr')
-rw-r--r--tests/ui/or-patterns/inconsistent-modes.stderr80
1 files changed, 80 insertions, 0 deletions
diff --git a/tests/ui/or-patterns/inconsistent-modes.stderr b/tests/ui/or-patterns/inconsistent-modes.stderr
new file mode 100644
index 00000000000..f6367ef8234
--- /dev/null
+++ b/tests/ui/or-patterns/inconsistent-modes.stderr
@@ -0,0 +1,80 @@
+error[E0409]: variable `a` is bound inconsistently across alternatives separated by `|`
+  --> $DIR/inconsistent-modes.rs:6:26
+   |
+LL |     let (Ok(a) | Err(ref a)): Result<&u8, u8> = Ok(&0);
+   |             -            ^ bound in different ways
+   |             |
+   |             first binding
+
+error[E0409]: variable `a` is bound inconsistently across alternatives separated by `|`
+  --> $DIR/inconsistent-modes.rs:8:30
+   |
+LL |     let (Ok(ref mut a) | Err(a)): Result<u8, &mut u8> = Ok(0);
+   |                     -        ^ bound in different ways
+   |                     |
+   |                     first binding
+
+error[E0409]: variable `a` is bound inconsistently across alternatives separated by `|`
+  --> $DIR/inconsistent-modes.rs:10:34
+   |
+LL |     let (Ok(ref a) | Err(ref mut a)): Result<&u8, &mut u8> = Ok(&0);
+   |                 - first binding  ^ bound in different ways
+
+error[E0409]: variable `a` is bound inconsistently across alternatives separated by `|`
+  --> $DIR/inconsistent-modes.rs:13:40
+   |
+LL |     let (Ok((ref a, b)) | Err((ref mut a, ref b))) = Ok((0, &0));
+   |                  - first binding       ^ bound in different ways
+
+error[E0409]: variable `b` is bound inconsistently across alternatives separated by `|`
+  --> $DIR/inconsistent-modes.rs:13:47
+   |
+LL |     let (Ok((ref a, b)) | Err((ref mut a, ref b))) = Ok((0, &0));
+   |                     - first binding           ^ bound in different ways
+
+error[E0409]: variable `a` is bound inconsistently across alternatives separated by `|`
+  --> $DIR/inconsistent-modes.rs:19:39
+   |
+LL |     let (Ok(Ok(a) | Err(a)) | Err(ref a)) = Err(0);
+   |                         -             ^ bound in different ways
+   |                         |
+   |                         first binding
+
+error[E0409]: variable `a` is bound inconsistently across alternatives separated by `|`
+  --> $DIR/inconsistent-modes.rs:23:34
+   |
+LL |     let (Ok([Ok((Ok(ref a) | Err(a),)) | Err(a)]) | Err(a)) = Err(&1);
+   |                         -        ^ bound in different ways
+   |                         |
+   |                         first binding
+
+error[E0308]: mismatched types
+  --> $DIR/inconsistent-modes.rs:10:26
+   |
+LL |     let (Ok(ref a) | Err(ref mut a)): Result<&u8, &mut u8> = Ok(&0);
+   |             -----        ^^^^^^^^^    -------------------- expected due to this
+   |             |            |
+   |             |            types differ in mutability
+   |             first introduced with type `&&u8` here
+   |
+   = note:      expected reference `&&u8`
+           found mutable reference `&mut &mut u8`
+   = note: a binding must have the same type in all alternatives
+
+error[E0308]: mismatched types
+  --> $DIR/inconsistent-modes.rs:13:32
+   |
+LL |     let (Ok((ref a, b)) | Err((ref mut a, ref b))) = Ok((0, &0));
+   |              -----             ^^^^^^^^^             ----------- this expression has type `Result<({integer}, &{integer}), (_, _)>`
+   |              |                 |
+   |              |                 types differ in mutability
+   |              first introduced with type `&{integer}` here
+   |
+   = note:      expected reference `&{integer}`
+           found mutable reference `&mut _`
+   = note: a binding must have the same type in all alternatives
+
+error: aborting due to 9 previous errors
+
+Some errors have detailed explanations: E0308, E0409.
+For more information about an error, try `rustc --explain E0308`.