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_neg_trait_impl / check_neg_trait_impl / premise let trait_decl = program.program().trait_named(&trait_ref.trait_id)?

Premise at line 67. Observed failure causes: inapplicable.

check_neg_trait_impl
LineCoverageSource
61N/A(let (env, bound_data) = Env::default().instantiate_universally(binder))
62N/A(let NegTraitImplBoundData { trait_id, self_ty, trait_parameters, where_clauses } = bound_data)
63N/A(let trait_ref = trait_id.with(self_ty, trait_parameters))
64(super::where_clauses::prove_where_clauses_well_formed(program, &env, &where_clauses, &where_clauses) => ())
65(super::prove_goal(program, &env, &where_clauses, Predicate::not_implemented(&trait_ref)) => ())
671(let trait_decl = program.program().trait_named(&trait_ref.trait_id)?)
68(let TraitBoundData { where_clauses: _, trait_items: _ } = trait_decl.binder.instantiate_with(&trait_ref.parameters)?)
──────── ("check_neg_trait_impl")
713(check_neg_trait_impl(program, NegTraitImpl { binder, safety: Safety::Safe }) => ())

1 test failed proving this premise:


Source location: tests/basic_tests.rs:466 (all coverage from this test)

#[test]
fn nonexistant_trait() {
    FormalityTest::new(crates![crate core {
        struct S {}
        impl !Nonexistent for S {}
    }])
    .err(expect_test::expect![[r#"
        the rule "check_neg_trait_impl" at (impls.rs) failed because
          no trait named `Nonexistent`"#]]);
}
Failed proof tree