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: prove_sized / alias / premise prove_after(decls, c, assumptions, AtomicPredicate::sized(normalized)) => c

Premise at line 64. Observed failure causes: failed_judgment.

alias
LineCoverageSource
63✗(prove_normalize(decls, env, assumptions, ty) => Constrained(normalized, c))
641(prove_after(decls, c, assumptions, AtomicPredicate::sized(normalized)) => c)
──────── ("alias")
661(prove_sized(decls, env, assumptions, Ty::AliasTy(_)) => c)

1 test failed proving this premise:


Source location: tests/sized_trait.rs:397 (all coverage from this test)

#[test]
fn alias_is_not_sized_if_normalized_type_may_be_unsized() {
    // `<T as Assoc>::Out` normalizes to `T`, which may be unsized.
    FormalityTest::new(crates![crate Foo {
        struct W<T> { t: T }
        trait Assoc { type Out: []; }
        impl<T> Assoc for T { type Out = T; }
        trait Needs<T> where T: Sized {}
        impl<T> Needs<<T as Assoc>::Out> for W<T> {}
    }])
    .rustc_ok()
    .err(expect_test::expect![[r#"
        crates/formality-rust/src/prove/prove_sized.rs:12:1: no applicable rules for prove_sized { ty: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }

        the rule "trait implied bound" at (prove_predicate.rs) failed because
          expression evaluated to an empty collection: `decls.trait_invariants()`

        the rule "trait implied bound" at (prove_predicate.rs) failed because
          expression evaluated to an empty collection: `decls.trait_invariants()`

        the rule "trait implied bound" at (prove_predicate.rs) failed because
          expression evaluated to an empty collection: `decls.trait_invariants()`"#]]);
}
Failed proof tree

How to read this page