summaryrefslogtreecommitdiffstats
path: root/tests/ui/let-else/let-else-binding-explicit-mut-annotated.stderr
blob: 065787cab08ff65200d12ac52469bb05d39d700f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
error[E0308]: mismatched types
  --> $DIR/let-else-binding-explicit-mut-annotated.rs:9:37
   |
LL |     let Some(n): &mut Option<i32> = &&Some(5i32) else { return };
   |                  ----------------   ^^^^^^^^^^^^ types differ in mutability
   |                  |
   |                  expected due to this
   |
   = note: expected mutable reference `&mut Option<i32>`
                      found reference `&&Option<i32>`

error[E0308]: mismatched types
  --> $DIR/let-else-binding-explicit-mut-annotated.rs:13:37
   |
LL |     let Some(n): &mut Option<i32> = &&mut Some(5i32) else { return };
   |                  ----------------   ^^^^^^^^^^^^^^^^ types differ in mutability
   |                  |
   |                  expected due to this
   |
   = note: expected mutable reference `&mut Option<i32>`
                      found reference `&&mut Option<i32>`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.