Positive coverage: prove_predicate / forall
forall| Line | Coverage | Source |
|---|---|---|
| 35 | 4 | (scope(enter_universally_with_constraints(decls, env, assumptions, binder) => (env, p1)) with(c) (prove_predicate(decls, env, assumptions, p1) => c)) |
| ──────── ("forall") | ||
| 38 | 26 | (prove_predicate(decls, env, assumptions, Predicate::ForAll(binder)) => c) |
26 tests exercised this rule:
Source location: crates/formality-rust/src/prove/test/binder_scope.rs:17 (all coverage from this test)
#[test]
fn outlives_every_lifetime() {
test_prove_pending_outlives(Program::empty(), term("exists<'x> {} => {for<'a> 'x : 'a}"))
.assert_ok(expect!["{Constraints { env: Env { variables: [?lt_1], bias: Soundness, pending: [?lt_1 : ' static], allow_pending_outlives: true }, known_true: true, substitution: {} }}"]);
}
Proof tree
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (outlives)prove_predicate.rs:152args
prove_outlives (anything can be pending)prove_outlives.rs:96args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (outlives)prove_predicate.rs:152args
prove_outlives (anything can be pending)prove_outlives.rs:96args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
Source location: crates/formality-rust/src/prove/test/binder_scope.rs:27 (all coverage from this test)
#[test]
fn outlives_every_lifetime_given_static() {
test_prove_pending_outlives(
Program::empty(),
term("forall<'x> {'x : 'static} => {for<'a> 'x : 'a}"),
)
.assert_ok(expect!["{Constraints { env: Env { variables: [!lt_1], bias: Soundness, pending: [], allow_pending_outlives: true }, known_true: true, substitution: {} }, Constraints { env: Env { variables: [!lt_1], bias: Soundness, pending: [!lt_1 : ' static], allow_pending_outlives: true }, known_true: true, substitution: {} }}"]);
}
Proof tree
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (outlives)prove_predicate.rs:152args
prove_outlives (outlive static through assumption)prove_outlives.rs:87args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (outlives)prove_predicate.rs:152args
prove_outlives (anything can be pending)prove_outlives.rs:96args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (outlives)prove_predicate.rs:152args
prove_outlives (anything can be pending)prove_outlives.rs:96args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
Source location: crates/formality-rust/src/prove/test/eq_assumptions.rs:15 (all coverage from this test)
#[test]
fn test_a() {
test_prove(
Program::empty(),
term("{} => {for<T, U> if {T = u32, U = Vec<T>} U = Vec<u32>}"),
)
.assert_ok(expect!["{Constraints { env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: true, substitution: {} }}"]);
}
Proof tree
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (implies)prove_predicate.rs:43args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (normalize-l)prove_eq.rs:70args
prove_normalize (normalize-via-assumption)prove_normalize.rs:37args
prove_normalize_via (axiom-l)prove_normalize.rs:98args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (rigid)prove_eq.rs:48args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (assumption)prove_predicate.rs:50args
prove_via (relation-axiom)prove_via.rs:43args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
Source location: crates/formality-rust/src/prove/test/eq_assumptions.rs:24 (all coverage from this test)
#[test]
fn test_b() {
test_prove(
Program::empty(),
term("exists<A> {} => {for<T, U> if {T = u32, U = Vec<T>} A = U}"),
)
.assert_ok(expect!["{Constraints { env: Env { variables: [?ty_2, ?ty_1], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: true, substitution: {?ty_1 => Vec<u32>, ?ty_2 => u32} }}"]);
}
Proof tree
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (implies)prove_predicate.rs:43args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (symmetric)prove_eq.rs:39args
prove_eq (normalize-l)prove_eq.rs:70args
prove_normalize (normalize-via-assumption)prove_normalize.rs:37args
prove_normalize_via (axiom-l)prove_normalize.rs:98args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (symmetric)prove_eq.rs:39args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-nonvar)prove_eq.rs:96args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (normalize-l)prove_eq.rs:70args
prove_normalize (normalize-via-assumption)prove_normalize.rs:37args
prove_normalize_via (axiom-l)prove_normalize.rs:98args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (symmetric)prove_eq.rs:39args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-nonvar)prove_eq.rs:96args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
Source location: crates/formality-rust/src/prove/test/eq_assumptions.rs:33 (all coverage from this test)
#[test]
fn test_normalize_assoc_ty() {
test_prove(
Program::empty(),
term("{} => {for<T> if { <T as Iterator>::Item = u32 } <T as Iterator>::Item = u32}"),
)
.assert_ok(expect!["{Constraints { env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: true, substitution: {} }}"]);
}
Proof tree
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (implies)prove_predicate.rs:43args
prove_predicate (assumption)prove_predicate.rs:50args
prove_via (relation-axiom)prove_via.rs:43args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
Source location: crates/formality-rust/src/prove/test/eq_partial_eq.rs:25 (all coverage from this test)
#[test]
fn eq_implies_partial_eq() {
let assumptions: Predicates = Predicates::t();
let goal: Predicate = term("for<T> if {Eq(T)} PartialEq(T)");
let constraints = prove(decls(), (), assumptions, goal);
constraints.assert_ok(
expect!["{Constraints { env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: true, substitution: {} }}"]);
}
Proof tree
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (implies)prove_predicate.rs:43args
prove_predicate (trait implied bound)prove_predicate.rs:119args
scopeprove_predicate.rs:23prove_via (predicate-congruence-axiom)prove_via.rs:33args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-universal)prove_eq.rs:141args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (assumption)prove_predicate.rs:50args
prove_via (predicate-congruence-axiom)prove_via.rs:33args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
Source location: crates/formality-rust/src/prove/test/universes.rs:37 (all coverage from this test)
#[test]
fn for_t_exists_u() {
let decls = Program {
crates: Arc::new(Program::program_from_items(vec![
term("trait Test<T> where {}"),
term("impl<X> Test<X> for X {}"),
])),
..Program::empty()
};
test_prove(decls, term("{} => {for<T> Test(T, T)}")).assert_ok(expect!["{Constraints { env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: true, substitution: {} }}"]);
}
Proof tree
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (positive impl)prove_predicate.rs:80args
scopeprove_predicate.rs:23prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (symmetric)prove_eq.rs:39args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-universal)prove_eq.rs:141args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
Source location: tests/basic_tests.rs:74 (all coverage from this test)
#[test]
fn basic_where_clauses_pass() {
FormalityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
trait WellFormed where for<T> u32: A<T> { }
impl <T> B for T {}
}])
.skip_execute()
.ok()
}
Proof tree
check_all_crates (check all prefixes)mod.rs:55args
for_allmod.rs:42for_allmod.rs:52args
check_crate (check crate)mod.rs:77args
for_allmod.rs:61for_allmod.rs:74args
check_crate_item (feature gate)mod.rs:226args
for_allmod.rs:74args
check_crate_item (trait)mod.rs:190args
check_trait (check trait)traits.rs:25args
scopetraits.rs:9prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (trait well formed)prove_predicate.rs:140args
for_allcombinators.rs:76prove_wf (universal variables)prove_wf.rs:28args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
for_allmod.rs:74args
check_crate_item (trait)mod.rs:190args
check_trait (check trait)traits.rs:25args
scopetraits.rs:9prove_predicate_list (none)prove_predicate_list.rs:21args
for_allmod.rs:74args
check_crate_item (trait)mod.rs:190args
check_trait (check trait)traits.rs:25args
scopetraits.rs:9prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (trait well formed)prove_predicate.rs:140args
for_allcombinators.rs:76prove_wf (integers and booleans)prove_wf.rs:57args
for_allcombinators.rs:76prove_wf (universal variables)prove_wf.rs:28args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (positive impl)prove_predicate.rs:80args
scopeprove_predicate.rs:23prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (symmetric)prove_eq.rs:39args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-universal)prove_eq.rs:141args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
for_allmod.rs:74args
check_crate_item (trait impl)mod.rs:197args
check_trait_impl (check_trait_impl)impls.rs:41args
scopeimpls.rs:14check_trait_manually_implementable (not Sized)impls.rs:92args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (positive impl)prove_predicate.rs:80args
scopeprove_predicate.rs:23prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (symmetric)prove_eq.rs:39args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-universal)prove_eq.rs:141args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
check_safety_matches (safety matches)impls.rs:107args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:366args
check_coherence (check_coherence)coherence.rs:23args
for_allcoherence.rs:7for_allcoherence.rs:16args
for_allcoherence.rs:7for_allcoherence.rs:17args
overlap_check_impl (same impl)coherence.rs:73args
for_allcoherence.rs:7for_allcoherence.rs:19args
orphan_check (orphan_check)coherence.rs:38args
scopecoherence.rs:30prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (trait ref is local)prove_predicate.rs:146args
is_local_trait_ref (local trait)is_local.rs:217args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
Source location: tests/basic_tests.rs:121 (all coverage from this test)
fn foo() -> () where for<T> u32: A<T> { trusted }
impl <T> B for T {}
}])
p_execute()
)
}
#[test]
ifetime_binder_in_fn_where_clause_fail() {
alityTest::new(crates![crate core {
trait A<T> where T: B { }
trait B { }
fn foo() -> () where for<T> u32: A<T> { trusted }
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
non lifetime binders require #![feature(non_lifetime_binders)]"#]])
}
#[test]
ifetime_binder_in_trait_impl_where_clause_pass() {
alityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
impl<T> B for T where for<U> u32: A<U> { }
}])
p_execute()
)
}
#[test]
ifetime_binder_in_trait_impl_where_clause_fail() {
alityTest::new(crates![crate core {
trait A<T> where T: B { }
trait B { }
impl<T> B for T where for<U> u32: A<U> { }
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
non lifetime binders require #![feature(non_lifetime_binders)]"#]])
}
#[test]
ifetime_binder_in_neg_trait_impl_where_clause_pass() {
alityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
impl<T> !A<T> for u32 where for<U> u32: A<U> { }
impl <T> B for T {}
}])
p_execute()
)
}
#[test]
ifetime_binder_in_neg_trait_impl_where_clause_fail() {
alityTest::new(crates![crate core {
trait A<T> where T: B { }
trait B { }
impl<T> !A<T> for u32 where for<U> u32: A<U> { }
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
non lifetime binders require #![feature(non_lifetime_binders)]"#]])
}
#[test]
ifetime_binder_in_enum_where_clause_pass() {
alityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
enum E where for<U> u32: A<U> { }
impl <T> B for T {}
}])
p_execute()
)
}
#[test]
ifetime_binder_in_enum_where_clause_fail() {
alityTest::new(crates![crate core {
trait A<T> where T: B { }
trait B { }
enum E where for<U> u32: A<U> { }
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
non lifetime binders require #![feature(non_lifetime_binders)]"#]])
}
#[test]
ifetime_binder_in_struct_where_clause_pass() {
alityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
struct S<T> where for<U> u32: A<U> { }
impl <T> B for T {}
}])
p_execute()
)
}
#[test]
ifetime_binder_in_struct_where_clause_fail() {
alityTest::new(crates![crate core {
trait A<T> where T: B { }
trait B { }
struct S<T> where for<U> u32: A<U> { }
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
non lifetime binders require #![feature(non_lifetime_binders)]"#]])
}
#[test]
ime_binder_in_where_clause_without_feature_pass() {
alityTest::new(crates![crate core {
trait A<'b> { }
impl<'b> A<'b> for u32 { }
trait WellFormed where for<'b> u32: A<'b> { }
}])
p_execute()
)
}
#[test]
_adt_variant_dup() {
alityTest::new(crates![crate Foo {
enum Bar {
Baz{},
Baz{},
}
Proof tree
check_all_crates (check all prefixes)mod.rs:55args
for_allmod.rs:42for_allmod.rs:52args
check_crate (check crate)mod.rs:77args
for_allmod.rs:61for_allmod.rs:74args
check_crate_item (feature gate)mod.rs:226args
for_allmod.rs:74args
check_crate_item (trait)mod.rs:190args
check_trait (check trait)traits.rs:25args
scopetraits.rs:9prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (trait well formed)prove_predicate.rs:140args
for_allcombinators.rs:76prove_wf (universal variables)prove_wf.rs:28args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
for_allmod.rs:74args
check_crate_item (trait)mod.rs:190args
check_trait (check trait)traits.rs:25args
scopetraits.rs:9prove_predicate_list (none)prove_predicate_list.rs:21args
for_allmod.rs:74args
check_crate_item (free fn)mod.rs:209args
check_free_fn (check free fn)fns.rs:25args
check_fn (check fn)fns.rs:55args
scopefns.rs:31prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (trait well formed)prove_predicate.rs:140args
for_allcombinators.rs:76prove_wf (integers and booleans)prove_wf.rs:57args
for_allcombinators.rs:76prove_wf (universal variables)prove_wf.rs:28args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (positive impl)prove_predicate.rs:80args
scopeprove_predicate.rs:23prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (symmetric)prove_eq.rs:39args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-universal)prove_eq.rs:141args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (parameter well formed)prove_predicate.rs:159args
prove_wf (tuples)prove_wf.rs:51args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
check_fn_body (trusted fn body)fns.rs:81args
for_allmod.rs:74args
check_crate_item (trait impl)mod.rs:197args
check_trait_impl (check_trait_impl)impls.rs:41args
scopeimpls.rs:14check_trait_manually_implementable (not Sized)impls.rs:92args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (positive impl)prove_predicate.rs:80args
scopeprove_predicate.rs:23prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (symmetric)prove_eq.rs:39args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-universal)prove_eq.rs:141args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
check_safety_matches (safety matches)impls.rs:107args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:366args
check_coherence (check_coherence)coherence.rs:23args
for_allcoherence.rs:7for_allcoherence.rs:16args
for_allcoherence.rs:7for_allcoherence.rs:17args
overlap_check_impl (same impl)coherence.rs:73args
for_allcoherence.rs:7for_allcoherence.rs:19args
orphan_check (orphan_check)coherence.rs:38args
scopecoherence.rs:30prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (trait ref is local)prove_predicate.rs:146args
is_local_trait_ref (local trait)is_local.rs:217args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
Source location: tests/basic_tests.rs:149 (all coverage from this test)
#[test]
fn non_lifetime_binder_in_trait_impl_where_clause_pass() {
FormalityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
impl<T> B for T where for<U> u32: A<U> { }
}])
.skip_execute()
.ok()
}
Proof tree
check_all_crates (check all prefixes)mod.rs:55args
for_allmod.rs:42for_allmod.rs:52args
check_crate (check crate)mod.rs:77args
for_allmod.rs:61for_allmod.rs:74args
check_crate_item (feature gate)mod.rs:226args
for_allmod.rs:74args
check_crate_item (trait)mod.rs:190args
check_trait (check trait)traits.rs:25args
scopetraits.rs:9prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (trait well formed)prove_predicate.rs:140args
for_allcombinators.rs:76prove_wf (universal variables)prove_wf.rs:28args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
for_allmod.rs:74args
check_crate_item (trait)mod.rs:190args
check_trait (check trait)traits.rs:25args
scopetraits.rs:9prove_predicate_list (none)prove_predicate_list.rs:21args
for_allmod.rs:74args
check_crate_item (trait impl)mod.rs:197args
check_trait_impl (check_trait_impl)impls.rs:41args
scopeimpls.rs:14check_trait_manually_implementable (not Sized)impls.rs:92args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (trait well formed)prove_predicate.rs:140args
for_allcombinators.rs:76prove_wf (integers and booleans)prove_wf.rs:57args
for_allcombinators.rs:76prove_wf (universal variables)prove_wf.rs:28args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (positive impl)prove_predicate.rs:80args
scopeprove_predicate.rs:23prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (symmetric)prove_eq.rs:39args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-universal)prove_eq.rs:141args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (assumption)prove_predicate.rs:50args
prove_via (forall)prove_via.rs:52args
scopeprove_via.rs:9prove_via (predicate-congruence-axiom)prove_via.rs:33args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-universal)prove_eq.rs:141args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (positive impl)prove_predicate.rs:80args
scopeprove_predicate.rs:23prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (symmetric)prove_eq.rs:39args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-universal)prove_eq.rs:141args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (forall)prove_predicate.rs:37args
scopeprove_predicate.rs:23prove_predicate (assumption)prove_predicate.rs:50args
prove_via (forall)prove_via.rs:52args
scopeprove_via.rs:9prove_via (predicate-congruence-axiom)prove_via.rs:33args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:125args
prove_eq (existential)prove_eq.rs:63args
prove_existential_var_eq (existential-universal)prove_eq.rs:141args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
check_safety_matches (safety matches)impls.rs:107args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:366args
check_coherence (check_coherence)coherence.rs:23args
for_allcoherence.rs:7for_allcoherence.rs:16args
for_allcoherence.rs:7for_allcoherence.rs:17args
overlap_check_impl (same impl)coherence.rs:73args
for_allcoherence.rs:7for_allcoherence.rs:19args
orphan_check (orphan_check)coherence.rs:38args
scopecoherence.rs:30prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (trait ref is local)prove_predicate.rs:146args
is_local_trait_ref (local trait)is_local.rs:217args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (none)prove_predicate_list.rs:21args
Source location: tests/basic_tests.rs:179 (all coverage from this test)
#[test]
fn non_lifetime_binder_in_neg_trait_impl_where_clause_pass() {
FormalityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
impl<T> !A<T> for u32 where for<U> u32: A<U> { }
impl <T> B for T {}
}])
.skip_execute()
.ok()
}
Proof trees omitted for the remaining 16 tests; each one is on its test’s page in Coverage by test.
Source location: tests/basic_tests.rs:209 (all coverage from this test)
#[test]
fn non_lifetime_binder_in_enum_where_clause_pass() {
FormalityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
enum E where for<U> u32: A<U> { }
impl <T> B for T {}
}])
.skip_execute()
.ok()
}
Source location: tests/basic_tests.rs:239 (all coverage from this test)
#[test]
fn non_lifetime_binder_in_struct_where_clause_pass() {
FormalityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
struct S<T> where for<U> u32: A<U> { }
impl <T> B for T {}
}])
.skip_execute()
.ok()
}
Source location: tests/basic_tests.rs:266 (all coverage from this test)
#[test]
fn lifetime_binder_in_where_clause_without_feature_pass() {
FormalityTest::new(crates![crate core {
trait A<'b> { }
impl<'b> A<'b> for u32 { }
trait WellFormed where for<'b> u32: A<'b> { }
}])
.skip_execute()
.ok()
}
Source location: tests/consts.rs:131 (all coverage from this test)
#[test]
fn nested_const_bound_accepts_outer_parameter() {
FormalityTest::new(crates![crate Foo {
trait Foo<const C> where for<'a> type_of_const C is bool {}
}])
.skip_execute()
.ok()
}
Source location: tests/consts.rs:141 (all coverage from this test)
#[test]
fn nested_const_bound_accepts_inner_parameter() {
FormalityTest::new(crates![crate Foo {
#![feature(non_lifetime_binders)]
trait Foo where for<const C> type_of_const C is bool {}
}])
.skip_execute()
.ok()
}
Source location: tests/higher_ranked_where_clauses.rs:12 (all coverage from this test)
fn foo<T>() -> () where for<'a> T: Trait<'a> {}
}])
p_execute()
tc_ok()
);
}
#[test]
ait_bound_at_body_lifetime() {
alityTest::new(crates![crate Foo {
trait Trait<'a> {}
fn needs_one<'x, T>() -> () where T: Trait<'x> {}
fn foo<T>() -> () where for<'a> T: Trait<'a> {
exists<'r> {
needs_one::<'r, T>();
}
}
Source location: tests/higher_ranked_where_clauses.rs:28 (all coverage from this test)
fn foo<T>() -> () where for<'a> T: Trait<'a> {
exists<'r> {
needs_one::<'r, T>();
}
}
Source location: tests/higher_ranked_where_clauses.rs:42 (all coverage from this test)
fn foo<'b, T>() -> () where for<'a> T: Trait<'a> {
needs_one::<'b, T>();
}
Source location: tests/higher_ranked_where_clauses.rs:56 (all coverage from this test)
fn foo<T>() -> () where for<'a> T: Trait<'a> {
needs_all::<T>();
}
Source location: tests/higher_ranked_where_clauses.rs:118 (all coverage from this test)
fn foo<T>() -> u32 where for<'a> T: Trait<'a> {
let v: u32 = 1_u32;
exists<'r> {
let r: &'r u32 = first::<'r, T>(&'r v);
let n: u32 = *r;
v = 2_u32;
return n;
}
}
Source location: tests/higher_ranked_where_clauses.rs:176 (all coverage from this test)
fn foo<T>() -> () where for<'a> T: 'a {
needs_static::<T>();
}
Source location: tests/higher_ranked_where_clauses.rs:189 (all coverage from this test)
fn foo<'x, T>() -> () where for<'a> T: 'a {
needs_one::<'x, T>();
}
Source location: tests/higher_ranked_where_clauses.rs:202 (all coverage from this test)
fn foo<T>() -> () where for<'a> T: 'a {
needs_all::<T>();
}
Source location: tests/mir_typeck.rs:2160 (all coverage from this test)
fn main() -> () {
let v0: u32 = 0_u32;
exists<'r> {
let v1: &'r u32 = &'r v0;
needs_all::<&'r u32>(v1);
v0 = 1_u32;
}
}
Source location: tests/mir_typeck.rs:2176 (all coverage from this test)
fn caller<'x>(v: &'x u32) -> () where 'x: 'static {
needs_all::<&'x u32>(v);
}