Test neg_CoreTrait_for_CoreStruct_in_Foo
Source location: tests/coherence_orphan.rs:13
#[test]
fn neg_CoreTrait_for_CoreStruct_in_Foo() {
FormalityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
crate foo {
#![feature(negative_impls)]
impl !CoreTrait for CoreStruct {}
}]).err(expect_test::expect![[r#"
the rule "fundamental rigid type" at (is_local.rs) failed because
condition evaluated to false: `is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { #![feature(negative_impls)] impl ! CoreTrait for CoreStruct {} }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:18:1: no applicable rules for prove_normalize { p: CoreStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local rigid type" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_adt_id(a)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { #![feature(negative_impls)] impl ! CoreTrait for CoreStruct {} }], 222)
a = CoreStruct
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { #![feature(negative_impls)] impl ! CoreTrait for CoreStruct {} }], 222)
&goal.trait_id = CoreTrait"#]])
}
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_coherence | check_coherence | for_all(neg_trait_impl in program.neg_trait_impl… (line 22, blamed at line 23) | not counted by the judgment view |
| orphan_check_neg | orphan_check_neg | prove_goal(program, env, &a.where_clauses, Predi… (line 58) | 1 test |
| check_all_crates | check all prefixes | for_all(i in 0..crates.len()) (let program = cra… (line 51, blamed at line 53) | not counted by the judgment view |
| check_crate | check crate | check_coherence(program, c) => () (line 74) | 12 tests |
| is_local_trait_ref | local trait | if decls.is_local_trait_id(&goal.trait_id) (line 207) | 7 tests |
| is_local_trait_ref | local parameter | is_local_parameter(decls, env, assumptions, &goa… (line 215) | 7 tests |
| is_local_parameter | local parameter | prove_normalize(decls, env, assumptions, goal) =… (line 287) | 7 tests |
| is_local_parameter | fundamental rigid type | if is_fundamental(decls, name) (line 296) | 5 tests |
| is_local_parameter | local rigid type | if decls.is_local_adt_id(a) (line 304) | 3 tests |
| prove_wc | trait ref is local | is_local_trait_ref(decls, env, assumptions, trai… (line 140) | 7 tests |
| prove_wc_list | some | prove_wc(decls, env, assumptions, wc0) => c (line 26) | 42 tests |
Proof trees
Failed proof tree
check_all_crates failedmod.rs:41args
rule "check all prefixes"mod.rs:53check_crate failedmod.rs:60args
rule "check crate"mod.rs:74check_coherence failedcoherence.rs:8args
rule "check_coherence"coherence.rs:23orphan_check_neg failedcoherence.rs:45args
rule "orphan_check_neg"coherence.rs:58prove failedfunction.rs:250args
rulefunction.rs:250prove_wc_list failedprove_wc_list.rs:8args
rule "some"prove_wc_list.rs:26prove_wc failedprove_wc.rs:21args
rule "trait ref is local"prove_wc.rs:140is_local_trait_ref failedis_local.rs:197args
rule "local parameter"is_local.rs:215is_local_parameter failedis_local.rs:275args
rule "fundamental rigid type"is_local.rs:296 (failed: if_false)rule "local parameter"is_local.rs:287prove_normalize failedprove_normalize.rs:18args
rule "local rigid type"is_local.rs:304 (failed: if_false)
rule "local trait"is_local.rs:207 (failed: if_false)