Test assoc_type_impl_violates_static_bound
Source location: tests/outlives.rs:42
#[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 } }"]);
}
Rules proved (0)
This test records no positive coverage.
Premises failed (11)
The last column links to the premise’s page when the judgment view counts this failure against that premise. It does not when the premise is read as infallible, or when the failure was blamed inside a multi-line premise that carries no record on its own first line.
| Judgment | Rule | Premise | All tests of this premise |
|---|---|---|---|
| check_trait_impl | check_trait_impl | scope(enter_universally(Env::default(), binder) … (line 23, blamed at line 37) | not counted by the judgment view |
| check_trait_impl_item | associated ty value | check_associated_ty_value(program, env, assumpti… (line 193) | 1 test |
| check_associated_ty_value | check_associated_ty_value | scope(enter_universally(impl_env, &merge_binders… (line 266, blamed at line 283) | not counted by the judgment view |
| check_all_crates | check all prefixes | for_all(i in 0..crates.len()) (let program = cra… (line 52, blamed at line 54) | not counted by the judgment view |
| check_crate | check crate | for_all(item in &c.items) (check_crate_item(prog… (line 74, blamed at line 75) | not counted by the judgment view |
| check_crate_item | trait impl | check_trait_impl(program, v, crate_id) => () (line 195) | 23 tests |
| prove_after | prove_after | prove(decls, c1.env(), assumptions, goal) => c2 (line 19) | 28 tests |
| prove_outlives | rigid types | prove(decls, env, assumptions, Predicates::all_o… (line 69) | 1 test |
| prove_predicate | outlives | prove_outlives(decls, env, assumptions, a, b) =>… (line 151) | 10 tests |
| prove_predicate_list | some | prove_predicate(decls, env, assumptions, wc0) =>… (line 26) | 92 tests |
| prove_predicate_list | some | prove_after(decls, c, assumptions, wcs1) => c (line 27) | 5 tests |
Proof trees
Failed proof tree
check_all_crates failedmod.rs:42args
rule "check all prefixes"mod.rs:54check_crate failedmod.rs:61args
rule "check crate"mod.rs:75check_crate_item failedmod.rs:180rule "trait impl"mod.rs:195check_trait_impl failedimpls.rs:14rule "check_trait_impl"impls.rs:37check_trait_impl_item failedimpls.rs:175rule "associated ty value"impls.rs:193check_associated_ty_value failedimpls.rs:247rule "check_associated_ty_value"impls.rs:283prove failedfunction.rs:250args
rulefunction.rs:250prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:23args
rule "outlives"prove_predicate.rs:151prove_outlives failedprove_outlives.rs:8args
rule "rigid types"prove_outlives.rs:69prove failedprove_outlives.rs:69args
ruleprove_outlives.rs:69prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:27prove_after failedprove_after.rs:8args
rule "prove_after"prove_after.rs:19prove failedprove_after.rs:19args
ruleprove_after.rs:19prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:23args
rule "outlives"prove_predicate.rs:151prove_outlives failedprove_outlives.rs:8args