fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
3.3 KiB84 linesraw
1error[E0409]: variable `a` is bound in inconsistent ways within the same match arm
2  --> $DIR/inconsistent-modes.rs:9:25
3   |
4LL |     let Ok(a) | Err(ref a): Result<&u8, u8> = Ok(&0);
5   |            -            ^ bound in different ways
6   |            |
7   |            first binding
8
9error[E0409]: variable `a` is bound in inconsistent ways within the same match arm
10  --> $DIR/inconsistent-modes.rs:11:29
11   |
12LL |     let Ok(ref mut a) | Err(a): Result<u8, &mut u8> = Ok(0);
13   |                    -        ^ bound in different ways
14   |                    |
15   |                    first binding
16
17error[E0409]: variable `a` is bound in inconsistent ways within the same match arm
18  --> $DIR/inconsistent-modes.rs:13:33
19   |
20LL |     let Ok(ref a) | Err(ref mut a): Result<&u8, &mut u8> = Ok(&0);
21   |                - first binding  ^ bound in different ways
22
23error[E0409]: variable `a` is bound in inconsistent ways within the same match arm
24  --> $DIR/inconsistent-modes.rs:16:39
25   |
26LL |     let Ok((ref a, b)) | Err((ref mut a, ref b)) = Ok((0, &0));
27   |                 - first binding       ^ bound in different ways
28
29error[E0409]: variable `b` is bound in inconsistent ways within the same match arm
30  --> $DIR/inconsistent-modes.rs:16:46
31   |
32LL |     let Ok((ref a, b)) | Err((ref mut a, ref b)) = Ok((0, &0));
33   |                    - first binding           ^ bound in different ways
34
35error[E0409]: variable `a` is bound in inconsistent ways within the same match arm
36  --> $DIR/inconsistent-modes.rs:22:38
37   |
38LL |     let Ok(Ok(a) | Err(a)) | Err(ref a) = Err(0);
39   |                        -             ^ bound in different ways
40   |                        |
41   |                        first binding
42
43error[E0409]: variable `a` is bound in inconsistent ways within the same match arm
44  --> $DIR/inconsistent-modes.rs:26:34
45   |
46LL |     let Ok([ Ok((Ok(ref a) | Err(a),)) | Err(a) ]) | Err(a) = Err(&1);
47   |                         -        ^ bound in different ways
48   |                         |
49   |                         first binding
50
51warning: the feature `or_patterns` is incomplete and may cause the compiler to crash
52  --> $DIR/inconsistent-modes.rs:3:12
53   |
54LL | #![feature(or_patterns)]
55   |            ^^^^^^^^^^^
56   |
57   = note: `#[warn(incomplete_features)]` on by default
58
59error[E0308]: mismatched types
60  --> $DIR/inconsistent-modes.rs:13:25
61   |
62LL |     let Ok(ref a) | Err(ref mut a): Result<&u8, &mut u8> = Ok(&0);
63   |                         ^^^^^^^^^   -------------------- expected due to this
64   |                         |
65   |                         types differ in mutability
66   |
67   = note: expected type `&&u8`
68              found type `&mut &mut u8`
69
70error[E0308]: mismatched types
71  --> $DIR/inconsistent-modes.rs:16:31
72   |
73LL |     let Ok((ref a, b)) | Err((ref mut a, ref b)) = Ok((0, &0));
74   |                               ^^^^^^^^^            ----------- this expression has type `std::result::Result<({integer}, &{integer}), (_, _)>`
75   |                               |
76   |                               types differ in mutability
77   |
78   = note: expected type `&{integer}`
79              found type `&mut _`
80
81error: aborting due to 9 previous errors
82
83Some errors have detailed explanations: E0308, E0409.
84For more information about an error, try `rustc --explain E0308`.