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

Negative coverage: check_trait_impl_item / associated ty value / premise check_associated_ty_value(program, env, assumptions, trait_items, v) => ()

Premise at line 193. Observed failure causes: failed_judgment.

associated ty value
LineCoverageSource
1931(check_associated_ty_value(program, env, assumptions, trait_items, v) => ())
──────── ("associated ty value")
195311(check_trait_impl_item(program, env, assumptions, trait_items, ImplItem::AssociatedTyValue(v), crate_id) => ())

1 test failed proving this premise:


Source location: tests/outlives.rs:42 (all coverage from this test)

#[test]
fn assoc_type_impl_violates_static_bound() {
    FormalityTest::new(crates![crate Foo {
        trait A { type Item: ['static]; }
        impl<'a> A for &'a u32 { type Item = &'a u32; }
    }])
    .skip_execute()
    .rustc_err(expect_test::expect![[r#"
        error[E0477]: the type `&'a00 u32` does not fulfill the required lifetime
         --> lib.rs
          |
        6 |     type Item = &'a00 u32;
          |                 ^^^^^^^^^
          |
        note: type must satisfy the static lifetime as required by this binding
         --> lib.rs
          |
        2 |     type Item: 'static;
          |                ^^^^^^^

        For more information about this error, try `rustc --explain E0477`.
        error: could not compile `Foo` (lib) due to 1 previous error
    "#]])
    .err(expect_test::expect!["crates/formality-rust/src/prove/prove_outlives.rs:8:1: no applicable rules for prove_outlives { a: !lt_0, b: ' static, assumptions: {}, env: Env { variables: [!lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }"]);
}
Failed proof tree

How to read this page