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

Test alias_is_not_sized_if_normalized_type_may_be_unsized

Source location: tests/sized_trait.rs:397

#[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()`"#]]);
}

Rules proved (0)

This test records no positive coverage.

Premises failed (10)

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.

JudgmentRulePremiseAll tests of this premise
check_trait_implcheck_trait_implscope(enter_universally(Env::default(), binder) … (line 23, blamed at line 28)not counted by the judgment view
check_all_cratescheck all prefixesfor_all(i in 0..crates.len()) (let program = cra… (line 52, blamed at line 54)not counted by the judgment view
check_cratecheck cratefor_all(item in &c.items) (check_crate_item(prog… (line 74, blamed at line 75)not counted by the judgment view
check_crate_itemtrait implcheck_trait_impl(program, v, crate_id) => () (line 195)23 tests
prove_afterprove_afterprove(decls, c1.env(), assumptions, goal) => c2 (line 19)28 tests
prove_predicatepositive implscope(enter_existentially_with_constraints(decls… (line 61, blamed at line 79)not counted by the judgment view
prove_predicatebuilt-in Sizedprove_sized(decls, env, assumptions, ty) => c (line 94)9 tests
prove_predicatetrait implied boundti in decls.trait_invariants() (line 115)28 tests
prove_predicate_listsomeprove_predicate(decls, env, assumptions, wc0) =>… (line 26)92 tests
prove_sizedaliasprove_after(decls, c, assumptions, AtomicPredica… (line 64)1 test

Proof trees

Failed proof tree

How to read this page