]> git.lizzy.rs Git - rust.git/blob - tests/ui/let-else/let-else-binding-explicit-mut-annotated.stderr
Don't resolve type var roots in point_at_expr_source_of_inferred_type
[rust.git] / tests / ui / let-else / let-else-binding-explicit-mut-annotated.stderr
1 error[E0308]: mismatched types
2   --> $DIR/let-else-binding-explicit-mut-annotated.rs:9:37
3    |
4 LL |     let Some(n): &mut Option<i32> = &&Some(5i32) else { return };
5    |                  ----------------   ^^^^^^^^^^^^ types differ in mutability
6    |                  |
7    |                  expected due to this
8    |
9    = note: expected mutable reference `&mut Option<i32>`
10                       found reference `&&Option<i32>`
11
12 error[E0308]: mismatched types
13   --> $DIR/let-else-binding-explicit-mut-annotated.rs:13:37
14    |
15 LL |     let Some(n): &mut Option<i32> = &&mut Some(5i32) else { return };
16    |                  ----------------   ^^^^^^^^^^^^^^^^ types differ in mutability
17    |                  |
18    |                  expected due to this
19    |
20    = note: expected mutable reference `&mut Option<i32>`
21                       found reference `&&mut Option<i32>`
22
23 error: aborting due to 2 previous errors
24
25 For more information about this error, try `rustc --explain E0308`.