]> git.lizzy.rs Git - rust.git/blob - tests/ui/let-else/let-else-binding-explicit-mut-borrow.rs
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-borrow.rs
1 // Slightly different from explicit-mut-annotated -- this won't show an error until borrowck.
2 // Should it show a type error instead?
3
4
5
6 fn main() {
7     let Some(n): &mut Option<i32> = &mut &Some(5i32) else {
8         //~^ ERROR cannot borrow data in a `&` reference as mutable
9         return
10     };
11     *n += 1;
12     let _ = n;
13 }