rust/src/test/ui/or-patterns/inconsistent-modes.stderr

81 lines
3.3 KiB
Plaintext

error[E0409]: variable `a` is bound inconsistently across alternatives separated by `|`
--> $DIR/inconsistent-modes.rs:7: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:9: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:11: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:14: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:14: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:20: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:24: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:11: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 type `&&u8`
found type `&mut &mut u8`
= note: a binding must have the same type in all alternatives
error[E0308]: mismatched types
--> $DIR/inconsistent-modes.rs:14: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 type `&{integer}`
found type `&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`.