Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Positive coverage: borrow_check_expr / turbofish

turbofish
LineCoverageSource
486(let fn_decl = env.crates().fn_named(id)?)
4871(if fn_decl.binder.len() == args.len())
488N/A(let ty = Ty::rigid(RigidName::fn_def(id), args))
──────── ("turbofish")
4918(borrow_check_expr(env, _assumptions, state, Expr::Turbofish { id, args }, _places_live_on_exit) => (ty, state))

8 tests exercised this rule:


Source location: tests/borrowck.rs:2806

fn foo<'a>(a: &'a u32) -> &'a u32 {
    exists<'r0> {
        let r: &'r0 u32 = identity::<&'r0 u32>(a);
        return r;
    }
}
Proof tree
… (200 of 1138 nodes shown)

Source location: tests/borrowck.rs:2828

fn bar() -> u32 {
    exists<'r1> {
        let v: u32 = 7 _ u32;
        let r: u32 = foo::<'r1>(&'r1 v);
        return r;
    }
}
Proof tree
… (200 of 1223 nodes shown)

Source location: tests/borrowck.rs:2856

fn foo<'a, 'b>(a: &'a u32) -> &'b u32
where 'a: 'b {
    let r: &'b u32 = identity::<&'b u32>(a);
    return r;
}
Proof tree
… (200 of 1131 nodes shown)

Source location: tests/borrowck.rs:2901

fn foo<'b>(a: &'b u32) -> &'b u32 {
    let r: &'b u32 = bar::<'b, &'b u32>(a);
    return r;
}
Proof tree
… (200 of 1134 nodes shown)

Source location: tests/codegen.rs:79

fn main() -> () {
    let y: i32 = identity::<i32>(42 _ i32);
    println!(y);
}
Proof tree
… (200 of 1060 nodes shown)

Source location: tests/codegen.rs:238

fn main() -> () {
    a();
}
Proof tree
… (200 of 1152 nodes shown)

Source location: tests/codegen.rs:251

fn main() -> () {
    let r: i32 = first::<i32, bool>(10 _ i32, true);
    println!(r);
}
Proof tree
… (200 of 1074 nodes shown)

Source location: tests/mir_typeck.rs:345

fn bar(v1: u32) -> u32 {
    let v0: u32 = identity::<u32>(v1);
    return v0;
}
Proof tree
… (200 of 1077 nodes shown)