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: prove_wf / static lifetime

static lifetime
LineCoverageSource
──────── ("static lifetime")
724(prove_wf(_decls, env, _assumptions, Lt::Static) => Constraints::none(env))

4 tests exercised this rule:


Source location: tests/higher_ranked_where_clauses.rs:176 (all coverage from this test)

fn foo<T>() -> () where for<'a> T: 'a {
    needs_static::<T>();
}
Proof tree
… (200 of 1340 nodes shown)

Source location: tests/higher_ranked_where_clauses.rs:215 (all coverage from this test)

fn foo<'x, 'y>(v: &'x u32) -> &'y u32 where 'x: 'static {
    return v;
}
Proof tree
… (200 of 1358 nodes shown)

Source location: tests/mir_typeck.rs:2176 (all coverage from this test)

fn caller<'x>(v: &'x u32) -> () where 'x: 'static {
    needs_all::<&'x u32>(v);
}
Proof tree
… (200 of 1551 nodes shown)

Source location: tests/well_formed_trait_ref.rs:71 (all coverage from this test)

#[test]
fn static_lifetime_param() {
    FormalityTest::new(crates![crate foo {
        trait Trait1<'a> {}

        struct S1 {}

        impl Trait1<'static> for S1 {}

        struct S2 where S1: Trait1<'static> {}
    }])
    .skip_execute()
    .ok()
}
Proof tree
… (200 of 1375 nodes shown)

How to read this page