Test foo
Source location: tests/basic_tests.rs:121
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{},
}
Rules proved (32)
Premises failed (0)
This test records no negative coverage.
Proof trees
Proof tree
check_all_crates (check all prefixes)mod.rs:55args
for_allmod.rs:42for_allmod.rs:52args
check_crate (check crate)mod.rs:76args
for_allmod.rs:61for_allmod.rs:73args
check_crate_item (feature gate)mod.rs:225args
for_allmod.rs:73args
check_crate_item (trait)mod.rs:189args
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:131args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
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:73args
check_crate_item (trait)mod.rs:189args
check_trait (check trait)traits.rs:25args
scopetraits.rs:9prove_predicate_list (none)prove_predicate_list.rs:21args
for_allmod.rs:73args
check_crate_item (free fn)mod.rs:208args
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:36args
scopeprove_predicate.rs:22prove_predicate (trait well formed)prove_predicate.rs:131args
for_allcombinators.rs:69prove_wf (integers and booleans)prove_wf.rs:56args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (positive impl)prove_predicate.rs:79args
scopeprove_predicate.rs:22prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:116args
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:150args
prove_wf (tuples)prove_wf.rs:50args
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:73args
check_crate_item (trait impl)mod.rs:196args
check_trait_impl (check_trait_impl)impls.rs:40args
scopeimpls.rs:14prove_predicate_list (none)prove_predicate_list.rs:21args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (positive impl)prove_predicate.rs:79args
scopeprove_predicate.rs:22prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (eq)prove_predicate.rs:116args
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:83args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:342args
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:137args
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