Positive coverage: check_adt / check adt
check adt| Line | Coverage | Source |
|---|---|---|
| 18 | N/A | (let adt = adt_item.to_adt()) |
| 19 | 2 | (check_adt_variant_names_unique(adt) => ()) |
| 20 | ✗ | (scope(enter_universally(Env::default(), &adt.binder) => (env, AdtBoundData { where_clauses, variants })) with() (prove_where_clauses_well_formed(program, env, where_clauses, where_clauses) => ()) (for_all(variant in variants) (let Variant { fields, .. } = variant) (for_all(field in fields) (let Field { ty, .. } = field) (prove_goal(program, env, where_clauses, AtomicPredicate::well_formed(ty)) => ())) (check_fields_sized(program, env, where_clauses, adt_item, fields) => ()))) |
| ──────── ("check adt") | ||
| 29 | 71 | (check_adt(program, adt_item) => ()) |
71 tests exercised this rule:
Source location: src/test_util.rs:516 (all coverage from this test)
#[test]
fn rustc_expectation_is_independent_of_borrowck_modes() {
let before = rustc_runs();
FormalityTest::new(NLL_ONLY_ERROR)
.rustc_err(expect_test::expect![[r#"
error[E0499]: cannot borrow `*m` as mutable more than once at a time
--> lib.rs
|
3 | pub fn foo<'a00>(mut m: &'a00 mut Map) -> &'a00 mut Map {
| ---- lifetime `'a00` defined here
4 | {
5 | let mut n: &'_ mut Map = &mut *m;
| ------- first mutable borrow occurs here
6 | if false {
7 | return n;
| - returning this value requires that `*m` is borrowed for `'a00`
8 | } else {
9 | let mut o: &'_ mut Map = &mut *m;
| ^^^^^^^ second mutable borrow occurs here
For more information about this error, try `rustc --explain E0499`.
error: could not compile `Foo` (lib) due to 1 previous error
"#]])
.borrowck_err(BorrowCheckFailure::Nll, expect_test::expect![[r#"
the rule "borrow of disjoint places" at (nll.rs) failed because
condition evaluated to false: `place_disjoint_from_place(&loan.place, &access.place)`
&loan.place = *(m : &!lt_1 mut Map) : <&!lt_1 mut Map as Derefable>::Target
&access.place = *(m : &!lt_1 mut Map) : <&!lt_1 mut Map as Derefable>::Target
the rule "loan_cannot_outlive" at (nll.rs) failed because
condition evaluated to false: `!outlived_by_loan.contains(&lifetime.upcast())`
outlived_by_loan = {!lt_1, ?lt_2, ?lt_3}
&lifetime.upcast() = !lt_1
the rule "loan_not_required_by_universal_regions" at (nll.rs) failed because
condition evaluated to false: `outlived_by_loan.iter().all(|p| match p
{
Parameter::Ty(_) => false, Parameter::Lt(lt) => match lt.as_ref()
{
Lt::Static => false, Lt::Variable(Variable::UniversalVar(_)) => false,
Lt::Variable(Variable::ExistentialVar(_)) => true,
Lt::Variable(Variable::BoundVar(_)) =>
panic!("cannot outlive a bound var"), Lt::Erased => true,
}, Parameter::Const(_) => panic!("cannot outlive a constant"),
})`
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `m`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(m : &!lt_1 mut Map) : <&!lt_1 mut Map as Derefable>::Target
place_loaned_ref = m : &!lt_1 mut Map"#]]);
assert_eq!(rustc_runs() - before, 1);
}
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 (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 (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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
for_allmod.rs:74args
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()
}
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 (adt)mod.rs:203args
check_adt (check adt)adts.rs:28args
scopeadts.rs:11prove_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: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()
}
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 (adt)mod.rs:203args
check_adt (check adt)adts.rs:28args
scopeadts.rs:11prove_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_alladts.rs:11for_alladts.rs:22args
check_fields_sized (struct)adts.rs:49args
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:457 (all coverage from this test)
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 (trait)mod.rs:190args
check_trait (check trait)traits.rs:25args
scopetraits.rs:9prove_predicate_list (none)prove_predicate_list.rs:21args
for_alltraits.rs:9for_alltraits.rs:23args
check_trait_item (fn in trait)traits.rs:43args
check_fn_in_trait (check fn in trait)traits.rs:67args
check_fn (check fn)fns.rs:55scopefns.rs:31prove_predicate_list (none)prove_predicate_list.rs:21args
for_allfns.rs:31for_allfns.rs:51args
prove_predicate_list (some)prove_predicate_list.rs:28args
prove_predicate (parameter well formed)prove_predicate.rs:159args
prove_wf (integers and booleans)prove_wf.rs:57args
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 (integers and booleans)prove_wf.rs:57args
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 (adt)mod.rs:203args
check_adt (check adt)adts.rs:28args
scopeadts.rs:11prove_predicate_list (none)prove_predicate_list.rs:21args
for_alladts.rs:11for_alladts.rs:22args
check_fields_sized (struct)adts.rs:49args
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_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/borrowck.rs:214 (all coverage from this test)
fn foo() -> Datum {
let x: Datum = Datum { value: 0_u32 };
let y: Datum = x;
x = Datum { value: 1_u32 };
let z: Datum = x;
return z;
}
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 (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 (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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
for_allmod.rs:74args
Source location: tests/borrowck.rs:495 (all coverage from this test)
fn foo() -> Datum {
let x: Pair = Pair {
first: Datum { value: 1_u32 },
second: Datum { value: 2_u32 },
};
let a: Datum = x.first;
let b: Datum = x.second;
return b;
}
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 (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 (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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
for_allmod.rs:74args
Source location: tests/borrowck.rs:2470 (all coverage from this test)
fn min_problem_case_3<'a>(m: &'a mut Map) -> &'a mut Map {
exists<'r0, 'r1> {
let n: &'r0 mut Map = &'r0 mut *m;
if true {
return n;
} else {
let o: &'r1 mut Map = &'r1 mut *m;
return o;
}
}
}
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 (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 (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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
for_allmod.rs:74args
Source location: tests/borrowck.rs:2887 (all coverage from this test)
fn min_problem_case_3<'a>(m: &'a mut Map) -> &'a mut Map {
exists<'r0, 'r1> {
let n: &'r0 mut Map = &'r0 mut *m;
if true {
} else {
}
let o: &'r1 mut Map = &'r1 mut *m;
return o;
}
}
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 (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 (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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
for_allmod.rs:74args
Source location: tests/borrowck.rs:3024 (all coverage from this test)
fn min_problem_case_4<'a>(list: &'a mut Map, list2: &'a mut Map) -> u32 {
exists<'r0> {
let num: &'r0 mut u32 = &'r0 mut (*list).value;
list = &'a mut *list2;
num;
return 0_u32;
}
}
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 (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 (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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
for_allmod.rs:74args
Source location: tests/borrowck.rs:3485 (all coverage from this test)
fn foo<'a>(m: &'a mut Map) -> &'a mut Map {
exists<'r0, 'r1> {
let n: &'r0 mut Map = &'r0 mut *m;
if false {
return n;
} else {
let o: &'r1 mut Map = &'r1 mut *m;
return o;
}
}
}
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 (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 (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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
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_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
for_allmod.rs:74args
Source location: tests/borrowck.rs:3765 (all coverage from this test)
fn foo() -> u32 {
exists<'r0, 'r1, 'r2, 'r3> {
let p: Point = Point { x: 0_u32, y: 0_u32 };
let b1: &'r0 mut u32 = &'r1 mut p.x;
let b2: &'r2 mut u32 = &'r3 mut p.y;
*b1 = 1_u32;
*b2 = 2_u32;
return 0_u32;
}
}
Proof trees omitted for the remaining 61 tests; each one is on its test’s page in Coverage by test.
Source location: tests/borrowck.rs:4364 (all coverage from this test)
fn remove_last_node_recursive<'a>(node: &'a mut List) -> u32 {
exists<'r0> {
let next: &'r0 mut List = next_of::<'r0>(&'r0 mut *node);
if true {
remove_last_node_recursive::<'r0>(next);
} else {
*node = List { value: 0_u32 };
}
return 0_u32;
}
}
Source location: tests/borrowck.rs:4411 (all coverage from this test)
fn remove_last_node_iterative<'a>(node: &'a mut List) -> u32 {
exists<'r0, 'r1> {
let cursor: &'r0 mut List = &'r0 mut *node;
'l: loop {
let next: &'r1 mut List = &'r1 mut *cursor;
if true {
cursor = next;
} else {
break 'l;
}
}
*cursor = List { value: 0_u32 };
return 0_u32;
}
}
Source location: tests/borrowck.rs:4473 (all coverage from this test)
fn no_control_flow() -> u32 {
exists<'r0, 'r1, 'r2, 'r3> {
let b: X = X { value: 0_u32 };
let p: &'r0 mut X = &'r1 mut b;
'l: loop {
let now: &'r2 mut X = &'r2 mut *p;
if true {
let next: &'r3 mut X = next_of::<'r3>(&'r3 mut *now);
p = next;
} else {
break 'l;
}
}
return 0_u32;
}
}
Source location: tests/borrowck.rs:4523 (all coverage from this test)
fn conditional() -> u32 {
exists<'r0, 'r1, 'r2, 'r3> {
let b: X = X { value: 0_u32 };
let p: &'r0 mut X = &'r1 mut b;
'l: loop {
let now: &'r2 mut X = &'r2 mut *p;
if true {
if true {
let next: &'r3 mut X = next_of::<'r3>(&'r3 mut *now);
p = next;
} else {
}
} else {
break 'l;
}
}
return 0_u32;
}
}
Source location: tests/borrowck.rs:4612 (all coverage from this test)
fn conditional_with_indirection() -> u32 {
exists<'r0, 'r1, 'r2, 'r3> {
let b: X = X { value: 0_u32 };
let p: &'r0 mut X = &'r1 mut b;
'l: loop {
let now: &'r2 mut X = &'r2 mut *p;
if true {
if true {
let next: &'r3 mut X = next_of::<'r3>(&'r3 mut *p);
p = next;
} else {
}
} else {
break 'l;
}
}
return 0_u32;
}
}
Source location: tests/borrowck.rs:4664 (all coverage from this test)
fn to_refs<'a>(list: &'a mut List) -> &'a mut u32 {
exists<'r0, 'r1> {
let result: &'a mut u32;
'l: loop {
result = &'r0 mut (*list).value;
if true {
let n: &'r1 mut List = next_from_field::<'r1>(&'r1 mut (*list).next);
list = n;
} else {
return result;
}
}
}
}
Source location: tests/borrowck.rs:4699 (all coverage from this test)
fn to_refs2<'a>(list: &'a mut List) -> &'a mut u32 {
exists<'r0, 'r1> {
let result: &'a mut u32;
'l: loop {
result = &'r0 mut (*list).value;
if true {
let n: &'r1 mut List = next_from_field::<'r1>(&'r1 mut (*list).next);
list = n;
} else {
break 'l;
}
}
return result;
}
}
Source location: tests/borrowck.rs:4746 (all coverage from this test)
fn to_refs3<'a>(list: &'a mut List) -> &'a mut u32 {
exists<'r0, 'r1> {
let result: &'a mut u32;
let cursor: &'a mut List = &'a mut *list;
'l: loop {
result = &'r0 mut (*cursor).value;
if true {
let n: &'r1 mut List = next_from_field::<'r1>(&'r1 mut (*cursor).next);
cursor = n;
} else {
return result;
}
}
}
}
Source location: tests/borrowck.rs:4789 (all coverage from this test)
fn next<'a>(d: &'a mut Decoder) -> &'a u32 {
exists<'r0, 'r1> {
'l: loop {
let buf: &'r0 u32 = fill_buf::<'r0>(&'r0 mut (*d).buf_read);
let s: &'r1 u32 = decode::<'r1>(buf);
if true {
return s;
} else {
}
}
}
}
Source location: tests/borrowck.rs:4912 (all coverage from this test)
fn next<'s>(f: &'s mut Filter) -> &'s mut u32 {
exists<'r0, 'r1, 'r2> {
'l: loop {
let item: &'r0 mut u32 = iter_next::<'r0>(&'r0 mut (*f).iter);
if true {
let keep: bool = call_predicate::<'r1, 'r2>(&'r1 mut (*f).predicate, &'r2 *item);
if keep {
return item;
} else {
}
} else {
break 'l;
}
}
return no_item::<'s>();
}
}
Source location: tests/borrowck.rs:5028 (all coverage from this test)
fn use_it<'a, 'b>() -> u32 {
exists<'r0> {
let v: Invariant<'r0> = create_invariant::<'r0>();
if true {
return sink::<'a, 'r0>(v);
} else {
return sink::<'b, 'r0>(v);
}
}
}
Source location: tests/borrowck.rs:5093 (all coverage from this test)
fn use_it_but_its_the_same_region<'a, 'b>() -> u32 where 'a: 'b, 'b: 'a {
exists<'r0> {
let v: Invariant<'r0> = create_invariant::<'r0>();
if true {
return sink::<'a, 'r0>(v);
} else {
return sink::<'b, 'r0>(v);
}
}
}
Source location: tests/borrowck.rs:5167 (all coverage from this test)
fn f() -> u32 {
exists<'r0> {
let v: u32 = 0_u32;
let w: Wrapper<'r0> = Wrapper::<'r0> { value: &'r0 v };
return *w.value;
}
}
Source location: tests/borrowck.rs:5644 (all coverage from this test)
fn f() -> u32 {
exists<'r0, 'r1> {
let s: S = S { a: 0_u32, b: 0_u32 };
let x: u32 = both::<'r0, 'r1>(&'r0 mut s.a, &'r1 mut s.b);
return x;
}
}
Source location: tests/codegen.rs:236 (all coverage from this test)
fn main() -> () {
let p: Pair = Pair { x: 10_i32, y: 20_i32 };
println!(p.x);
println!(p.y);
}
Source location: tests/codegen.rs:358 (all coverage from this test)
fn main() -> () {
let w: Wrapper<i32> = Wrapper::<i32> { val: 42_i32 };
println!(w.val);
}
Source location: tests/codegen.rs:374 (all coverage from this test)
fn main() -> () {
let p: Pair = Pair { x: 10_i32, y: 20_i32 };
exists<'a> {
let r: & 'a i32 = & 'a p.x;
println!(*r);
}
}
Source location: tests/codegen.rs:391 (all coverage from this test)
fn main() -> () {
let p: Pair = Pair { x: 10_i32, y: 20_i32 };
exists<'a> {
let r: & 'a Pair = & 'a p;
println!((*r).x);
println!((*r).y);
}
}
Source location: tests/codegen.rs:628 (all coverage from this test)
fn main() -> () {
println!(identity::<S>(7_u32));
}
Source location: tests/codegen.rs:693 (all coverage from this test)
fn main() -> () {
let s: S = S { b: second(), a: first() };
println!(s.a);
println!(s.b);
}
Source location: tests/codegen.rs:721 (all coverage from this test)
fn main() -> () {
let w: Wrap<<S as Value>::Item> = Wrap::<<S as Value>::Item> { value: 7_u32 };
println!(w.value);
}
Source location: tests/codegen.rs:798 (all coverage from this test)
fn main() -> () {
let x: <S as Outer>::Item = 7_u32;
println!(x);
}
Source location: tests/codegen.rs:927 (all coverage from this test)
fn main() -> () {
println!(identity::<Number>(7_u32));
println!(identity::<Flag>(true));
println!(identity::<Number>(9_u32));
}
Source location: tests/codegen.rs:1102 (all coverage from this test)
fn main() -> () {
let p: Pair = Pair { a: 1_u32, b: 10_u32 };
p.b += p.a;
println!(p.b);
}
Source location: tests/codegen.rs:1132 (all coverage from this test)
fn main() -> () {
let p: Pair = Pair { a: 2_u32, b: 3_u32 };
p.b *= p.a + 4_u32;
println!(p.b);
println!(p.a);
}
Source location: tests/codegen.rs:1820 (all coverage from this test)
fn main() -> () {
let p: Pair = Pair { left: 8_u32, right: 16_u32 };
exists<'a> {
let r: &'a mut Pair = &'a mut p;
p.left %= update::<'a>(r);
}
println!(p.left);
println!(p.right);
}
Source location: tests/coherence_orphan.rs:85 (all coverage from this test)
#[test]
fn mirror_FooStruct() {
FormalityTest::new(crates![crate core {
trait CoreTrait {}
trait Mirror {
type Assoc : [];
}
impl<T> Mirror for T {
type Assoc = T;
}
},
crate foo {
struct FooStruct {}
impl CoreTrait for <FooStruct as Mirror>::Assoc {}
}])
.skip_execute()
.ok()
}
Source location: tests/coherence_orphan.rs:99 (all coverage from this test)
#[test]
fn covered_VecT() {
FormalityTest::new(crates![crate core {
trait CoreTrait<T> {}
struct Vec<T> {}
},
crate foo {
struct FooStruct {}
impl<T> CoreTrait<FooStruct> for Vec<T> {}
}])
.skip_execute()
.ok()
}
Source location: tests/coherence_orphan.rs:114 (all coverage from this test)
fn main() -> () {}
}])
tc_ok()
)
}
#[test]
ed_nested_mut_ref_VecT() {
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
struct Vec<T> { value: T }
},
e foo {
struct FooStruct {}
impl<'a, T> CoreTrait<FooStruct> for &'a &'a mut Vec<T> where T: 'a {}
fn main() -> () {}
}])
tc_ok()
)
}
#[test]
ered_mut_ref_T() {
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
e foo {
struct FooStruct {}
impl<'a, T> CoreTrait<FooStruct> for &'a mut T where T: 'a {}
}])
(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: @ IsLocal(CoreTrait(&!lt_1 mut !ty_0, FooStruct)), via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 mut !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 mut ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
name = &(mut)
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 mut !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 mut ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
ered_nested_ref_T() {
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
e foo {
struct FooStruct {}
impl<'a, T> CoreTrait<FooStruct> for &'a &'a T where T: 'a {}
}])
(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: @ IsLocal(CoreTrait(&!lt_1 &!lt_1 !ty_0, FooStruct)), via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 &^lt0_0 ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
name = &(shared)
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 &^lt0_0 ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
name = &(shared)
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 &^lt0_0 ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
ointer_is_not_fundamental() {
alityTest::new(crates![crate core {
trait CoreTrait {}
},
e foo {
struct FooStruct {}
impl CoreTrait for *mut FooStruct {}
}])
p_execute()
(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> { } }, crate foo { struct FooStruct { } impl CoreTrait for *mut FooStruct { } }], 222)
name = * mut
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: *mut FooStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
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> { } }, crate foo { struct FooStruct { } impl CoreTrait for *mut FooStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
ered_T() {
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
crate foo {
struct FooStruct {}
impl<T> CoreTrait<FooStruct> for T {}
}]).err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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, ty> { } }, crate foo { struct FooStruct { } impl <ty> CoreTrait <FooStruct> for ^ty0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
ered_ref_T() {
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
crate foo {
struct FooStruct {}
impl<T> CoreTrait<FooStruct> for &'static T {}
}]).err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &' static !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <ty> CoreTrait <FooStruct> for &' static ^ty0_0 { } }], 222)
name = &(shared)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &' static !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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, ty> { } }, crate foo { struct FooStruct { } impl <ty> CoreTrait <FooStruct> for &' static ^ty0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
ooStruct_is_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
},
e foo {
struct FooStruct {}
impl CoreTrait for &'static FooStruct {}
impl CoreTrait for &'static mut FooStruct {}
fn main() -> () {}
}])
tc_ok()
)
}
#[test]
d_ref_FooStruct_is_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
},
e foo {
struct FooStruct {}
impl<'a, 'b> CoreTrait for &'a &'b mut FooStruct where 'b: 'a {}
fn main() -> () {}
}])
tc_ok()
)
}
#[test]
oreign_wrapper_of_local_is_not_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct ForeignWrapper<T> { value: T }
},
e foo {
struct FooStruct {}
impl<'a> CoreTrait for &'a ForeignWrapper<FooStruct> {}
}])
tc_err(expect_test::expect![[r#"
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> lib.rs
|
5 | impl<'a00> CoreTrait for &'a00 ForeignWrapper<FooStruct> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------
| |
| `mycore::ForeignWrapper` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
For more information about this error, try `rustc --explain E0117`.
error: could not compile `foo` (lib) due to 1 previous error
)
(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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
name = (adt ForeignWrapper)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: ForeignWrapper<FooStruct>, assumptions: {}, env: Env { variables: [!lt_0], 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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
a = ForeignWrapper
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &!lt_0 ForeignWrapper<FooStruct>, assumptions: {}, env: Env { variables: [!lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
oreStruct_is_not_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
e foo {
impl CoreTrait for &'static CoreStruct {}
}])
tc_err(expect_test::expect![[r#"
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> lib.rs
|
3 | impl CoreTrait for &'static CoreStruct {}
| ^^^^^^^^^^^^^^^^^^^-------------------
| |
| `mycore::CoreStruct` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
For more information about this error, try `rustc --explain E0117`.
error: could not compile `foo` (lib) due to 1 previous error
)
(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 { impl CoreTrait for &' static CoreStruct { } }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22: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 { impl CoreTrait for &' static CoreStruct { } }], 222)
a = CoreStruct
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &' static CoreStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
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 { impl CoreTrait for &' static CoreStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
_to_unit() {
alityTest::new(crates![crate core {
trait CoreTrait {}
trait Unit {
type Assoc : [];
}
impl<T> Unit for T {
type Assoc = ();
}
},
crate foo {
struct FooStruct {}
impl CoreTrait for <FooStruct as Unit>::Assoc {}
}]).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> { } trait Unit <ty> { type Assoc : [] ; } impl <ty> Unit for ^ty0_0 { type Assoc = () ; } }, crate foo { struct FooStruct { } impl CoreTrait for <FooStruct as Unit>::Assoc { } }], 222)
name = tuple(0)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: (), assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
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> { } trait Unit <ty> { type Assoc : [] ; } impl <ty> Unit for ^ty0_0 { type Assoc = () ; } }, crate foo { struct FooStruct { } impl CoreTrait for <FooStruct as Unit>::Assoc { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
rait_for_CoreStruct_in_Foo() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
crate foo {
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 { impl CoreTrait for CoreStruct { } }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22: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 { 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 { impl CoreTrait for CoreStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
raitLocal_for_AliasToKnown_in_Foo() {
ODO: see comment in `orphan_check` from prev commit
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
trait Unit {
type Assoc : [];
}
Source location: tests/coherence_orphan.rs:129 (all coverage from this test)
fn main() -> () {}
}])
tc_ok()
)
}
#[test]
ered_mut_ref_T() {
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
e foo {
struct FooStruct {}
impl<'a, T> CoreTrait<FooStruct> for &'a mut T where T: 'a {}
}])
(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: @ IsLocal(CoreTrait(&!lt_1 mut !ty_0, FooStruct)), via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 mut !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 mut ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
name = &(mut)
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 mut !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 mut ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
ered_nested_ref_T() {
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
e foo {
struct FooStruct {}
impl<'a, T> CoreTrait<FooStruct> for &'a &'a T where T: 'a {}
}])
(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: @ IsLocal(CoreTrait(&!lt_1 &!lt_1 !ty_0, FooStruct)), via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 &^lt0_0 ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
name = &(shared)
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 &^lt0_0 ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
name = &(shared)
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 &^lt0_0 ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
ointer_is_not_fundamental() {
alityTest::new(crates![crate core {
trait CoreTrait {}
},
e foo {
struct FooStruct {}
impl CoreTrait for *mut FooStruct {}
}])
p_execute()
(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> { } }, crate foo { struct FooStruct { } impl CoreTrait for *mut FooStruct { } }], 222)
name = * mut
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: *mut FooStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
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> { } }, crate foo { struct FooStruct { } impl CoreTrait for *mut FooStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
ered_T() {
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
crate foo {
struct FooStruct {}
impl<T> CoreTrait<FooStruct> for T {}
}]).err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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, ty> { } }, crate foo { struct FooStruct { } impl <ty> CoreTrait <FooStruct> for ^ty0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
ered_ref_T() {
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
crate foo {
struct FooStruct {}
impl<T> CoreTrait<FooStruct> for &'static T {}
}]).err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &' static !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <ty> CoreTrait <FooStruct> for &' static ^ty0_0 { } }], 222)
name = &(shared)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &' static !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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, ty> { } }, crate foo { struct FooStruct { } impl <ty> CoreTrait <FooStruct> for &' static ^ty0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
ooStruct_is_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
},
e foo {
struct FooStruct {}
impl CoreTrait for &'static FooStruct {}
impl CoreTrait for &'static mut FooStruct {}
fn main() -> () {}
}])
tc_ok()
)
}
#[test]
d_ref_FooStruct_is_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
},
e foo {
struct FooStruct {}
impl<'a, 'b> CoreTrait for &'a &'b mut FooStruct where 'b: 'a {}
fn main() -> () {}
}])
tc_ok()
)
}
#[test]
oreign_wrapper_of_local_is_not_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct ForeignWrapper<T> { value: T }
},
e foo {
struct FooStruct {}
impl<'a> CoreTrait for &'a ForeignWrapper<FooStruct> {}
}])
tc_err(expect_test::expect![[r#"
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> lib.rs
|
5 | impl<'a00> CoreTrait for &'a00 ForeignWrapper<FooStruct> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------
| |
| `mycore::ForeignWrapper` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
For more information about this error, try `rustc --explain E0117`.
error: could not compile `foo` (lib) due to 1 previous error
)
(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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
name = (adt ForeignWrapper)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: ForeignWrapper<FooStruct>, assumptions: {}, env: Env { variables: [!lt_0], 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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
a = ForeignWrapper
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &!lt_0 ForeignWrapper<FooStruct>, assumptions: {}, env: Env { variables: [!lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
oreStruct_is_not_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
e foo {
impl CoreTrait for &'static CoreStruct {}
}])
tc_err(expect_test::expect![[r#"
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> lib.rs
|
3 | impl CoreTrait for &'static CoreStruct {}
| ^^^^^^^^^^^^^^^^^^^-------------------
| |
| `mycore::CoreStruct` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
For more information about this error, try `rustc --explain E0117`.
error: could not compile `foo` (lib) due to 1 previous error
)
(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 { impl CoreTrait for &' static CoreStruct { } }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22: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 { impl CoreTrait for &' static CoreStruct { } }], 222)
a = CoreStruct
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &' static CoreStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
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 { impl CoreTrait for &' static CoreStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
_to_unit() {
alityTest::new(crates![crate core {
trait CoreTrait {}
trait Unit {
type Assoc : [];
}
impl<T> Unit for T {
type Assoc = ();
}
},
crate foo {
struct FooStruct {}
impl CoreTrait for <FooStruct as Unit>::Assoc {}
}]).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> { } trait Unit <ty> { type Assoc : [] ; } impl <ty> Unit for ^ty0_0 { type Assoc = () ; } }, crate foo { struct FooStruct { } impl CoreTrait for <FooStruct as Unit>::Assoc { } }], 222)
name = tuple(0)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: (), assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
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> { } trait Unit <ty> { type Assoc : [] ; } impl <ty> Unit for ^ty0_0 { type Assoc = () ; } }, crate foo { struct FooStruct { } impl CoreTrait for <FooStruct as Unit>::Assoc { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
rait_for_CoreStruct_in_Foo() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
crate foo {
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 { impl CoreTrait for CoreStruct { } }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22: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 { 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 { impl CoreTrait for CoreStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
raitLocal_for_AliasToKnown_in_Foo() {
ODO: see comment in `orphan_check` from prev commit
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
trait Unit {
type Assoc : [];
}
Source location: tests/coherence_orphan.rs:286 (all coverage from this test)
fn main() -> () {}
}])
tc_ok()
)
}
#[test]
d_ref_FooStruct_is_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
},
e foo {
struct FooStruct {}
impl<'a, 'b> CoreTrait for &'a &'b mut FooStruct where 'b: 'a {}
fn main() -> () {}
}])
tc_ok()
)
}
#[test]
oreign_wrapper_of_local_is_not_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct ForeignWrapper<T> { value: T }
},
e foo {
struct FooStruct {}
impl<'a> CoreTrait for &'a ForeignWrapper<FooStruct> {}
}])
tc_err(expect_test::expect![[r#"
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> lib.rs
|
5 | impl<'a00> CoreTrait for &'a00 ForeignWrapper<FooStruct> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------
| |
| `mycore::ForeignWrapper` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
For more information about this error, try `rustc --explain E0117`.
error: could not compile `foo` (lib) due to 1 previous error
)
(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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
name = (adt ForeignWrapper)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: ForeignWrapper<FooStruct>, assumptions: {}, env: Env { variables: [!lt_0], 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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
a = ForeignWrapper
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &!lt_0 ForeignWrapper<FooStruct>, assumptions: {}, env: Env { variables: [!lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
oreStruct_is_not_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
e foo {
impl CoreTrait for &'static CoreStruct {}
}])
tc_err(expect_test::expect![[r#"
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> lib.rs
|
3 | impl CoreTrait for &'static CoreStruct {}
| ^^^^^^^^^^^^^^^^^^^-------------------
| |
| `mycore::CoreStruct` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
For more information about this error, try `rustc --explain E0117`.
error: could not compile `foo` (lib) due to 1 previous error
)
(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 { impl CoreTrait for &' static CoreStruct { } }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22: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 { impl CoreTrait for &' static CoreStruct { } }], 222)
a = CoreStruct
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &' static CoreStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
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 { impl CoreTrait for &' static CoreStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
_to_unit() {
alityTest::new(crates![crate core {
trait CoreTrait {}
trait Unit {
type Assoc : [];
}
impl<T> Unit for T {
type Assoc = ();
}
},
crate foo {
struct FooStruct {}
impl CoreTrait for <FooStruct as Unit>::Assoc {}
}]).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> { } trait Unit <ty> { type Assoc : [] ; } impl <ty> Unit for ^ty0_0 { type Assoc = () ; } }, crate foo { struct FooStruct { } impl CoreTrait for <FooStruct as Unit>::Assoc { } }], 222)
name = tuple(0)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: (), assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
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> { } trait Unit <ty> { type Assoc : [] ; } impl <ty> Unit for ^ty0_0 { type Assoc = () ; } }, crate foo { struct FooStruct { } impl CoreTrait for <FooStruct as Unit>::Assoc { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
rait_for_CoreStruct_in_Foo() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
crate foo {
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 { impl CoreTrait for CoreStruct { } }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22: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 { 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 { impl CoreTrait for CoreStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
raitLocal_for_AliasToKnown_in_Foo() {
ODO: see comment in `orphan_check` from prev commit
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
trait Unit {
type Assoc : [];
}
Source location: tests/coherence_orphan.rs:300 (all coverage from this test)
fn main() -> () {}
}])
tc_ok()
)
}
#[test]
oreign_wrapper_of_local_is_not_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct ForeignWrapper<T> { value: T }
},
e foo {
struct FooStruct {}
impl<'a> CoreTrait for &'a ForeignWrapper<FooStruct> {}
}])
tc_err(expect_test::expect![[r#"
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> lib.rs
|
5 | impl<'a00> CoreTrait for &'a00 ForeignWrapper<FooStruct> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------
| |
| `mycore::ForeignWrapper` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
For more information about this error, try `rustc --explain E0117`.
error: could not compile `foo` (lib) due to 1 previous error
)
(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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
name = (adt ForeignWrapper)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: ForeignWrapper<FooStruct>, assumptions: {}, env: Env { variables: [!lt_0], 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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
a = ForeignWrapper
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &!lt_0 ForeignWrapper<FooStruct>, assumptions: {}, env: Env { variables: [!lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
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 ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
oreStruct_is_not_local() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
e foo {
impl CoreTrait for &'static CoreStruct {}
}])
tc_err(expect_test::expect![[r#"
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> lib.rs
|
3 | impl CoreTrait for &'static CoreStruct {}
| ^^^^^^^^^^^^^^^^^^^-------------------
| |
| `mycore::CoreStruct` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
For more information about this error, try `rustc --explain E0117`.
error: could not compile `foo` (lib) due to 1 previous error
)
(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 { impl CoreTrait for &' static CoreStruct { } }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22: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 { impl CoreTrait for &' static CoreStruct { } }], 222)
a = CoreStruct
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &' static CoreStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
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 { impl CoreTrait for &' static CoreStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
_to_unit() {
alityTest::new(crates![crate core {
trait CoreTrait {}
trait Unit {
type Assoc : [];
}
impl<T> Unit for T {
type Assoc = ();
}
},
crate foo {
struct FooStruct {}
impl CoreTrait for <FooStruct as Unit>::Assoc {}
}]).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> { } trait Unit <ty> { type Assoc : [] ; } impl <ty> Unit for ^ty0_0 { type Assoc = () ; } }, crate foo { struct FooStruct { } impl CoreTrait for <FooStruct as Unit>::Assoc { } }], 222)
name = tuple(0)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: (), assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
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> { } trait Unit <ty> { type Assoc : [] ; } impl <ty> Unit for ^ty0_0 { type Assoc = () ; } }, crate foo { struct FooStruct { } impl CoreTrait for <FooStruct as Unit>::Assoc { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
rait_for_CoreStruct_in_Foo() {
alityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
crate foo {
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 { impl CoreTrait for CoreStruct { } }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22: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 { 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 { impl CoreTrait for CoreStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
#[test]
raitLocal_for_AliasToKnown_in_Foo() {
ODO: see comment in `orphan_check` from prev commit
alityTest::new(crates![crate core {
trait CoreTrait<T> {}
trait Unit {
type Assoc : [];
}
Source location: tests/coherence_orphan.rs:472 (all coverage from this test)
#[test]
fn CoreTraitLocal_for_AliasToKnown_in_Foo() {
// TODO: see comment in `orphan_check` from prev commit
FormalityTest::new(crates![crate core {
trait CoreTrait<T> {}
trait Unit {
type Assoc : [];
}
impl<T> Unit for T {
type Assoc = ();
}
},
crate foo {
struct FooStruct {}
impl CoreTrait<FooStruct> for <() as Unit>::Assoc {}
}])
.skip_execute()
.ok()
}
Source location: tests/coherence_overlap.rs:237 (all coverage from this test)
#[test]
fn neg_CoreTrait_for_CoreStruct_implies_no_overlap() {
FormalityTest::new(crates![crate core {
#![feature(negative_impls)]
trait CoreTrait {}
struct CoreStruct {}
impl !CoreTrait for CoreStruct {}
},
crate foo {
trait FooTrait {}
impl<T> FooTrait for T where T: CoreTrait {}
impl FooTrait for CoreStruct {}
}])
.skip_execute()
.ok()
}
Source location: tests/coherence_overlap.rs:587 (all coverage from this test)
#[test]
fn is_local_unknowable_trait_ref() {
FormalityTest::new(crates![crate core {
trait Project {
type Assoc: [];
}
impl<T> Project for T {
type Assoc = T;
}
trait Foo<U> { }
},
crate foo {
struct LocalType {}
trait Overlap<U> {}
impl<T, U> Overlap<U> for T
where
<T as Project>::Assoc: Foo<U> {}
impl<T> Overlap<LocalType> for () {}
}])
.skip_execute()
.ok()
}
Source location: tests/drop.rs:23 (all coverage from this test)
Source location: tests/drop.rs:43 (all coverage from this test)
Source location: tests/drop.rs:61 (all coverage from this test)
Source location: tests/drop.rs:108 (all coverage from this test)
Source location: tests/drop.rs:128 (all coverage from this test)
Source location: tests/field_projections.rs:17 (all coverage from this test)
fn test(ptr: Ptr) -> () {
let x: () = *ptr;
}
Source location: tests/mir_typeck.rs:259 (all coverage from this test)
fn foo (v1: u32) -> u32 {
let v2: Dummy = Dummy { value: 1_u32, is_true: false };
v2.value = 2_u32;
return v1;
}
Source location: tests/mir_typeck.rs:276 (all coverage from this test)
fn foo() -> () {
let s1: S1<u8>;
}
Source location: tests/mir_typeck.rs:1142 (all coverage from this test)
fn foo<'a>(v1: &'a Pair) -> u32 {
exists<'r0> {
let v2: u32 = (*v1).value;
return v2;
}
}
Source location: tests/pr502_liveness_prototypes.rs:134 (all coverage from this test)
fn f() -> () {
exists<'r0, 'r1> {
let v: u32 = 0_u32;
let r: &'r0 u32 = &'r0 v;
let p: Pair<'r1> = Pair::<'r1> { a: *r, b: &'r1 mut v };
println!(p.a);
}
}
Source location: tests/pr531_review_probes.rs:39 (all coverage from this test)
fn main() -> () {
let p: Pair = Pair { left: 2_u32, right: 16_u32 };
exists<'a> {
let r: &'a mut Pair = &'a mut p;
p.left |= update::<'a>(r);
}
println!(p.left);
println!(p.right);
}
Source location: tests/pr539_review_probes.rs:39 (all coverage from this test)
fn main() -> () {
let p: Pair = Pair { left: 1_u32, right: 16_u32 };
exists<'a> {
let r: &'a mut Pair = &'a mut p;
p.left &= update::<'a>(r);
}
println!(p.left);
println!(p.right);
}
Source location: tests/references.rs:36 (all coverage from this test)
Source location: tests/sized_trait.rs:30 (all coverage from this test)
fn main() -> () {}
}])
tc_ok()
)
}
#[test]
lue_trait_param_with_sized_bound_compiles_with_rustc() {
alityTest::new(crates![crate Foo {
fn consume<T>(value: T) -> () where T: Sized {}
trait Consumer<T> where T: Sized {
fn consume_value(value: T) -> () {}
}
Source location: tests/sized_trait.rs:196 (all coverage from this test)
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
t_with_generic_tail_requires_sized_tail() {
Tail<T>` is only sized if `T` is.
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
trait Needs<T> where T: Sized {}
impl<T> Needs<Tail<T>> for u32 {}
}])
tc_ok()
(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()`"#]]);
}
#[test]
_non_final_field_is_accepted() {
alityTest::new(crates![crate Foo {
struct Good<T> where T: Sized { prefix: T, tail: u32 }
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
ed_non_final_field_is_rejected() {
nly the last field of a struct can be unsized.
alityTest::new(crates![crate Foo {
struct Bad<T> { prefix: T, tail: u32 }
}])
tc_ok()
(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()`"#]]);
}
#[test]
with_sized_fields_is_sized() {
alityTest::new(crates![crate Foo {
enum Maybe<T> where T: Sized { Just { value: T }, Nothing {} }
trait Needs<T> where T: Sized {}
impl<T> Needs<Maybe<T>> for u32 where T: Sized {}
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
ed_enum_field_is_rejected() {
num fields must all be sized, even the last one.
alityTest::new(crates![crate Foo {
enum Maybe<T> { Nothing {}, Just { value: T } }
}])
tc_ok()
(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()`"#]]);
}
#[test]
_is_sized_if_normalized_type_is() {
alityTest::new(crates![crate Foo {
trait Assoc { type Out: []; }
impl Assoc for u32 { type Out = bool; }
trait Needs<T> where T: Sized {}
impl Needs<<u32 as Assoc>::Out> for u32 {}
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
ction_non_final_field_with_sized_bound_is_accepted() {
he solver ignores bounds on associated types, so `type A: [Sized]` wouldn't help.
alityTest::new(crates![crate Foo {
trait Tr { type A: []; }
struct S<T> where T: Tr, <T as Tr>::A: Sized { a: <T as Tr>::A, b: u32 }
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
et_impl_for_sized_types_overlaps_with_impl_for_struct() {
S` is sized, so both impls apply to it.
alityTest::new(crates![crate Foo {
trait Foo {}
struct S {}
impl<T> Foo for T where T: Sized {}
impl Foo for S {}
}])
tc_err(expect_test::expect![[r#"
error[E0119]: conflicting implementations of trait `Foo` for type `S`
--> lib.rs
|
5 | impl<T00> Foo for T00 where T00: Sized {}
| -------------------------------------- first implementation here
6 |
7 | impl Foo for S {}
| ^^^^^^^^^^^^^^ conflicting implementation for `S`
For more information about this error, try `rustc --explain E0119`.
error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Sized(!ty_0), via: !ty_0 = S, assumptions: {!ty_0 = S, Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Sized(!ty_0), via: Sized(!ty_0), assumptions: {!ty_0 = S, Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {!ty_1 = S, Sized(!ty_1)} given {}, got [Constraints { env: Env { variables: [!ty_1], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl <ty> Foo for ^ty0_0 where ^ty0_0 : Sized { }
impl_b = impl Foo for S { }"#]]);
}
#[test]
t_tail_is_checked_after_substitution() {
Pair<u32, X>` ends in `X`, which may be unsized.
alityTest::new(crates![crate Foo {
struct Pair<A, B> where A: Sized { first: A, last: B }
trait Needs<T> where T: Sized {}
impl<X> Needs<Pair<u32, X>> for u32 {}
}])
tc_ok()
(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()`"#]]);
}
#[test]
t_tail_is_followed_through_nested_structs() {
Outer<T>` ends in `Tail<T>`, which ends in `T`.
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
struct Outer<T> { inner: Tail<T> }
trait Needs<T> where T: Sized {}
impl<T> Needs<Outer<T>> for u32 {}
}])
tc_ok()
(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()`
the rule "trait implied bound" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.trait_invariants()`"#]]);
}
#[test]
_is_not_sized_if_normalized_type_may_be_unsized() {
<T as Assoc>::Out` normalizes to `T`, which may be unsized.
alityTest::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> {}
}])
tc_ok()
(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()`"#]]);
}
#[test]
sive_struct_is_not_sized() {
Sized` is inductive, so the cycle through `next` doesn't prove `List: Sized`.
ustc rejects the struct itself (E0072), which formality doesn't check.
alityTest::new(crates![crate Foo {
struct List { next: List }
trait Needs<T> where T: Sized {}
impl Needs<List> for u32 {}
}])
tc_err(expect_test::expect![[r#"
error[E0072]: recursive type `List` has infinite size
--> lib.rs
|
1 | pub struct List {
| ^^^^^^^^^^^^^^^
2 | pub next: List,
| ---- recursive without indirection
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
2 | pub next: Box<List>,
| ++++ +
For more information about this error, try `rustc --explain E0072`.
error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect![[r#"
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()`"#]]);
}
#[test]
with_sized_struct_argument() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
fn consume<T>(value: T) -> () where T: Sized {}
fn forward<T>(value: Tail<T>) -> () where T: Sized { consume::<Tail<T>>(value); }
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
requires_sized_struct_argument() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
fn consume<T>(value: T) -> () where T: Sized {}
fn forward<T>(value: Tail<T>) -> () { consume::<Tail<T>>(value); }
}])
tc_ok()
(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: true } }
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()`"#]]);
}
#540: use the associated-type Sized bound; remove should_panic when fixed.
#[test]
_panic(expected = "prove_sized { ty: <!ty_0 as Tr>::A")]
iated_sized_bound_allows_nonfinal_struct_field() {
program = crates![crate Foo {
trait Tr { type A: [Sized]; }
struct S<T> where T: Tr { first: <T as Tr>::A, last: u32 }
fn main() -> () {}
}];
heck rustc before the expected formality failure.
(ok, stderr) = formality_rust::to_rust::test_util::run_rustc(&program);
rt!(ok, "{stderr}");
alityTest::new(program).rustc_ok().ok();
}
#540: use the associated-type Sized bound; remove should_panic when fixed.
#[test]
_panic(expected = "prove_sized { ty: <!ty_0 as Tr>::A")]
iated_sized_bound_allows_enum_field() {
program = crates![crate Foo {
trait Tr { type A: [Sized]; }
enum E<T> where T: Tr { Some { value: <T as Tr>::A }, None {} }
fn main() -> () {}
}];
heck rustc before the expected formality failure.
(ok, stderr) = formality_rust::to_rust::test_util::run_rustc(&program);
rt!(ok, "{stderr}");
alityTest::new(program).rustc_ok().ok();
}
#[test]
d_struct_sized_bound_executes() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
struct Outer<T> { inner: Tail<T> }
fn consume<T>(value: T) -> u32 where T: Sized { return 7_u32; }
fn main() -> () {
println!(consume::<Outer<u32>>(Outer::<u32> {
inner: Tail::<u32> { prefix: 1_u32, tail: 2_u32 }
}));
}
Source location: tests/sized_trait.rs:228 (all coverage from this test)
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
ed_non_final_field_is_rejected() {
nly the last field of a struct can be unsized.
alityTest::new(crates![crate Foo {
struct Bad<T> { prefix: T, tail: u32 }
}])
tc_ok()
(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()`"#]]);
}
#[test]
with_sized_fields_is_sized() {
alityTest::new(crates![crate Foo {
enum Maybe<T> where T: Sized { Just { value: T }, Nothing {} }
trait Needs<T> where T: Sized {}
impl<T> Needs<Maybe<T>> for u32 where T: Sized {}
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
ed_enum_field_is_rejected() {
num fields must all be sized, even the last one.
alityTest::new(crates![crate Foo {
enum Maybe<T> { Nothing {}, Just { value: T } }
}])
tc_ok()
(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()`"#]]);
}
#[test]
_is_sized_if_normalized_type_is() {
alityTest::new(crates![crate Foo {
trait Assoc { type Out: []; }
impl Assoc for u32 { type Out = bool; }
trait Needs<T> where T: Sized {}
impl Needs<<u32 as Assoc>::Out> for u32 {}
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
ction_non_final_field_with_sized_bound_is_accepted() {
he solver ignores bounds on associated types, so `type A: [Sized]` wouldn't help.
alityTest::new(crates![crate Foo {
trait Tr { type A: []; }
struct S<T> where T: Tr, <T as Tr>::A: Sized { a: <T as Tr>::A, b: u32 }
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
et_impl_for_sized_types_overlaps_with_impl_for_struct() {
S` is sized, so both impls apply to it.
alityTest::new(crates![crate Foo {
trait Foo {}
struct S {}
impl<T> Foo for T where T: Sized {}
impl Foo for S {}
}])
tc_err(expect_test::expect![[r#"
error[E0119]: conflicting implementations of trait `Foo` for type `S`
--> lib.rs
|
5 | impl<T00> Foo for T00 where T00: Sized {}
| -------------------------------------- first implementation here
6 |
7 | impl Foo for S {}
| ^^^^^^^^^^^^^^ conflicting implementation for `S`
For more information about this error, try `rustc --explain E0119`.
error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Sized(!ty_0), via: !ty_0 = S, assumptions: {!ty_0 = S, Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Sized(!ty_0), via: Sized(!ty_0), assumptions: {!ty_0 = S, Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {!ty_1 = S, Sized(!ty_1)} given {}, got [Constraints { env: Env { variables: [!ty_1], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl <ty> Foo for ^ty0_0 where ^ty0_0 : Sized { }
impl_b = impl Foo for S { }"#]]);
}
#[test]
t_tail_is_checked_after_substitution() {
Pair<u32, X>` ends in `X`, which may be unsized.
alityTest::new(crates![crate Foo {
struct Pair<A, B> where A: Sized { first: A, last: B }
trait Needs<T> where T: Sized {}
impl<X> Needs<Pair<u32, X>> for u32 {}
}])
tc_ok()
(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()`"#]]);
}
#[test]
t_tail_is_followed_through_nested_structs() {
Outer<T>` ends in `Tail<T>`, which ends in `T`.
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
struct Outer<T> { inner: Tail<T> }
trait Needs<T> where T: Sized {}
impl<T> Needs<Outer<T>> for u32 {}
}])
tc_ok()
(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()`
the rule "trait implied bound" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.trait_invariants()`"#]]);
}
#[test]
_is_not_sized_if_normalized_type_may_be_unsized() {
<T as Assoc>::Out` normalizes to `T`, which may be unsized.
alityTest::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> {}
}])
tc_ok()
(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()`"#]]);
}
#[test]
sive_struct_is_not_sized() {
Sized` is inductive, so the cycle through `next` doesn't prove `List: Sized`.
ustc rejects the struct itself (E0072), which formality doesn't check.
alityTest::new(crates![crate Foo {
struct List { next: List }
trait Needs<T> where T: Sized {}
impl Needs<List> for u32 {}
}])
tc_err(expect_test::expect![[r#"
error[E0072]: recursive type `List` has infinite size
--> lib.rs
|
1 | pub struct List {
| ^^^^^^^^^^^^^^^
2 | pub next: List,
| ---- recursive without indirection
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
2 | pub next: Box<List>,
| ++++ +
For more information about this error, try `rustc --explain E0072`.
error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect![[r#"
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()`"#]]);
}
#[test]
with_sized_struct_argument() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
fn consume<T>(value: T) -> () where T: Sized {}
fn forward<T>(value: Tail<T>) -> () where T: Sized { consume::<Tail<T>>(value); }
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
requires_sized_struct_argument() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
fn consume<T>(value: T) -> () where T: Sized {}
fn forward<T>(value: Tail<T>) -> () { consume::<Tail<T>>(value); }
}])
tc_ok()
(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: true } }
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()`"#]]);
}
#540: use the associated-type Sized bound; remove should_panic when fixed.
#[test]
_panic(expected = "prove_sized { ty: <!ty_0 as Tr>::A")]
iated_sized_bound_allows_nonfinal_struct_field() {
program = crates![crate Foo {
trait Tr { type A: [Sized]; }
struct S<T> where T: Tr { first: <T as Tr>::A, last: u32 }
fn main() -> () {}
}];
heck rustc before the expected formality failure.
(ok, stderr) = formality_rust::to_rust::test_util::run_rustc(&program);
rt!(ok, "{stderr}");
alityTest::new(program).rustc_ok().ok();
}
#540: use the associated-type Sized bound; remove should_panic when fixed.
#[test]
_panic(expected = "prove_sized { ty: <!ty_0 as Tr>::A")]
iated_sized_bound_allows_enum_field() {
program = crates![crate Foo {
trait Tr { type A: [Sized]; }
enum E<T> where T: Tr { Some { value: <T as Tr>::A }, None {} }
fn main() -> () {}
}];
heck rustc before the expected formality failure.
(ok, stderr) = formality_rust::to_rust::test_util::run_rustc(&program);
rt!(ok, "{stderr}");
alityTest::new(program).rustc_ok().ok();
}
#[test]
d_struct_sized_bound_executes() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
struct Outer<T> { inner: Tail<T> }
fn consume<T>(value: T) -> u32 where T: Sized { return 7_u32; }
fn main() -> () {
println!(consume::<Outer<u32>>(Outer::<u32> {
inner: Tail::<u32> { prefix: 1_u32, tail: 2_u32 }
}));
}
Source location: tests/sized_trait.rs:254 (all coverage from this test)
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
ed_enum_field_is_rejected() {
num fields must all be sized, even the last one.
alityTest::new(crates![crate Foo {
enum Maybe<T> { Nothing {}, Just { value: T } }
}])
tc_ok()
(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()`"#]]);
}
#[test]
_is_sized_if_normalized_type_is() {
alityTest::new(crates![crate Foo {
trait Assoc { type Out: []; }
impl Assoc for u32 { type Out = bool; }
trait Needs<T> where T: Sized {}
impl Needs<<u32 as Assoc>::Out> for u32 {}
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
ction_non_final_field_with_sized_bound_is_accepted() {
he solver ignores bounds on associated types, so `type A: [Sized]` wouldn't help.
alityTest::new(crates![crate Foo {
trait Tr { type A: []; }
struct S<T> where T: Tr, <T as Tr>::A: Sized { a: <T as Tr>::A, b: u32 }
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
et_impl_for_sized_types_overlaps_with_impl_for_struct() {
S` is sized, so both impls apply to it.
alityTest::new(crates![crate Foo {
trait Foo {}
struct S {}
impl<T> Foo for T where T: Sized {}
impl Foo for S {}
}])
tc_err(expect_test::expect![[r#"
error[E0119]: conflicting implementations of trait `Foo` for type `S`
--> lib.rs
|
5 | impl<T00> Foo for T00 where T00: Sized {}
| -------------------------------------- first implementation here
6 |
7 | impl Foo for S {}
| ^^^^^^^^^^^^^^ conflicting implementation for `S`
For more information about this error, try `rustc --explain E0119`.
error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Sized(!ty_0), via: !ty_0 = S, assumptions: {!ty_0 = S, Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Sized(!ty_0), via: Sized(!ty_0), assumptions: {!ty_0 = S, Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {!ty_1 = S, Sized(!ty_1)} given {}, got [Constraints { env: Env { variables: [!ty_1], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl <ty> Foo for ^ty0_0 where ^ty0_0 : Sized { }
impl_b = impl Foo for S { }"#]]);
}
#[test]
t_tail_is_checked_after_substitution() {
Pair<u32, X>` ends in `X`, which may be unsized.
alityTest::new(crates![crate Foo {
struct Pair<A, B> where A: Sized { first: A, last: B }
trait Needs<T> where T: Sized {}
impl<X> Needs<Pair<u32, X>> for u32 {}
}])
tc_ok()
(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()`"#]]);
}
#[test]
t_tail_is_followed_through_nested_structs() {
Outer<T>` ends in `Tail<T>`, which ends in `T`.
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
struct Outer<T> { inner: Tail<T> }
trait Needs<T> where T: Sized {}
impl<T> Needs<Outer<T>> for u32 {}
}])
tc_ok()
(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()`
the rule "trait implied bound" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.trait_invariants()`"#]]);
}
#[test]
_is_not_sized_if_normalized_type_may_be_unsized() {
<T as Assoc>::Out` normalizes to `T`, which may be unsized.
alityTest::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> {}
}])
tc_ok()
(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()`"#]]);
}
#[test]
sive_struct_is_not_sized() {
Sized` is inductive, so the cycle through `next` doesn't prove `List: Sized`.
ustc rejects the struct itself (E0072), which formality doesn't check.
alityTest::new(crates![crate Foo {
struct List { next: List }
trait Needs<T> where T: Sized {}
impl Needs<List> for u32 {}
}])
tc_err(expect_test::expect![[r#"
error[E0072]: recursive type `List` has infinite size
--> lib.rs
|
1 | pub struct List {
| ^^^^^^^^^^^^^^^
2 | pub next: List,
| ---- recursive without indirection
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
2 | pub next: Box<List>,
| ++++ +
For more information about this error, try `rustc --explain E0072`.
error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect![[r#"
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()`"#]]);
}
#[test]
with_sized_struct_argument() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
fn consume<T>(value: T) -> () where T: Sized {}
fn forward<T>(value: Tail<T>) -> () where T: Sized { consume::<Tail<T>>(value); }
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
requires_sized_struct_argument() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
fn consume<T>(value: T) -> () where T: Sized {}
fn forward<T>(value: Tail<T>) -> () { consume::<Tail<T>>(value); }
}])
tc_ok()
(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: true } }
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()`"#]]);
}
#540: use the associated-type Sized bound; remove should_panic when fixed.
#[test]
_panic(expected = "prove_sized { ty: <!ty_0 as Tr>::A")]
iated_sized_bound_allows_nonfinal_struct_field() {
program = crates![crate Foo {
trait Tr { type A: [Sized]; }
struct S<T> where T: Tr { first: <T as Tr>::A, last: u32 }
fn main() -> () {}
}];
heck rustc before the expected formality failure.
(ok, stderr) = formality_rust::to_rust::test_util::run_rustc(&program);
rt!(ok, "{stderr}");
alityTest::new(program).rustc_ok().ok();
}
#540: use the associated-type Sized bound; remove should_panic when fixed.
#[test]
_panic(expected = "prove_sized { ty: <!ty_0 as Tr>::A")]
iated_sized_bound_allows_enum_field() {
program = crates![crate Foo {
trait Tr { type A: [Sized]; }
enum E<T> where T: Tr { Some { value: <T as Tr>::A }, None {} }
fn main() -> () {}
}];
heck rustc before the expected formality failure.
(ok, stderr) = formality_rust::to_rust::test_util::run_rustc(&program);
rt!(ok, "{stderr}");
alityTest::new(program).rustc_ok().ok();
}
#[test]
d_struct_sized_bound_executes() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
struct Outer<T> { inner: Tail<T> }
fn consume<T>(value: T) -> u32 where T: Sized { return 7_u32; }
fn main() -> () {
println!(consume::<Outer<u32>>(Outer::<u32> {
inner: Tail::<u32> { prefix: 1_u32, tail: 2_u32 }
}));
}
Source location: tests/sized_trait.rs:293 (all coverage from this test)
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
et_impl_for_sized_types_overlaps_with_impl_for_struct() {
S` is sized, so both impls apply to it.
alityTest::new(crates![crate Foo {
trait Foo {}
struct S {}
impl<T> Foo for T where T: Sized {}
impl Foo for S {}
}])
tc_err(expect_test::expect![[r#"
error[E0119]: conflicting implementations of trait `Foo` for type `S`
--> lib.rs
|
5 | impl<T00> Foo for T00 where T00: Sized {}
| -------------------------------------- first implementation here
6 |
7 | impl Foo for S {}
| ^^^^^^^^^^^^^^ conflicting implementation for `S`
For more information about this error, try `rustc --explain E0119`.
error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Sized(!ty_0), via: !ty_0 = S, assumptions: {!ty_0 = S, Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Sized(!ty_0), via: Sized(!ty_0), assumptions: {!ty_0 = S, Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {!ty_1 = S, Sized(!ty_1)} given {}, got [Constraints { env: Env { variables: [!ty_1], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl <ty> Foo for ^ty0_0 where ^ty0_0 : Sized { }
impl_b = impl Foo for S { }"#]]);
}
#[test]
t_tail_is_checked_after_substitution() {
Pair<u32, X>` ends in `X`, which may be unsized.
alityTest::new(crates![crate Foo {
struct Pair<A, B> where A: Sized { first: A, last: B }
trait Needs<T> where T: Sized {}
impl<X> Needs<Pair<u32, X>> for u32 {}
}])
tc_ok()
(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()`"#]]);
}
#[test]
t_tail_is_followed_through_nested_structs() {
Outer<T>` ends in `Tail<T>`, which ends in `T`.
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
struct Outer<T> { inner: Tail<T> }
trait Needs<T> where T: Sized {}
impl<T> Needs<Outer<T>> for u32 {}
}])
tc_ok()
(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()`
the rule "trait implied bound" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.trait_invariants()`"#]]);
}
#[test]
_is_not_sized_if_normalized_type_may_be_unsized() {
<T as Assoc>::Out` normalizes to `T`, which may be unsized.
alityTest::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> {}
}])
tc_ok()
(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()`"#]]);
}
#[test]
sive_struct_is_not_sized() {
Sized` is inductive, so the cycle through `next` doesn't prove `List: Sized`.
ustc rejects the struct itself (E0072), which formality doesn't check.
alityTest::new(crates![crate Foo {
struct List { next: List }
trait Needs<T> where T: Sized {}
impl Needs<List> for u32 {}
}])
tc_err(expect_test::expect![[r#"
error[E0072]: recursive type `List` has infinite size
--> lib.rs
|
1 | pub struct List {
| ^^^^^^^^^^^^^^^
2 | pub next: List,
| ---- recursive without indirection
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
2 | pub next: Box<List>,
| ++++ +
For more information about this error, try `rustc --explain E0072`.
error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect![[r#"
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()`"#]]);
}
#[test]
with_sized_struct_argument() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
fn consume<T>(value: T) -> () where T: Sized {}
fn forward<T>(value: Tail<T>) -> () where T: Sized { consume::<Tail<T>>(value); }
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
requires_sized_struct_argument() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
fn consume<T>(value: T) -> () where T: Sized {}
fn forward<T>(value: Tail<T>) -> () { consume::<Tail<T>>(value); }
}])
tc_ok()
(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: true } }
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()`"#]]);
}
#540: use the associated-type Sized bound; remove should_panic when fixed.
#[test]
_panic(expected = "prove_sized { ty: <!ty_0 as Tr>::A")]
iated_sized_bound_allows_nonfinal_struct_field() {
program = crates![crate Foo {
trait Tr { type A: [Sized]; }
struct S<T> where T: Tr { first: <T as Tr>::A, last: u32 }
fn main() -> () {}
}];
heck rustc before the expected formality failure.
(ok, stderr) = formality_rust::to_rust::test_util::run_rustc(&program);
rt!(ok, "{stderr}");
alityTest::new(program).rustc_ok().ok();
}
#540: use the associated-type Sized bound; remove should_panic when fixed.
#[test]
_panic(expected = "prove_sized { ty: <!ty_0 as Tr>::A")]
iated_sized_bound_allows_enum_field() {
program = crates![crate Foo {
trait Tr { type A: [Sized]; }
enum E<T> where T: Tr { Some { value: <T as Tr>::A }, None {} }
fn main() -> () {}
}];
heck rustc before the expected formality failure.
(ok, stderr) = formality_rust::to_rust::test_util::run_rustc(&program);
rt!(ok, "{stderr}");
alityTest::new(program).rustc_ok().ok();
}
#[test]
d_struct_sized_bound_executes() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
struct Outer<T> { inner: Tail<T> }
fn consume<T>(value: T) -> u32 where T: Sized { return 7_u32; }
fn main() -> () {
println!(consume::<Outer<u32>>(Outer::<u32> {
inner: Tail::<u32> { prefix: 1_u32, tail: 2_u32 }
}));
}
Source location: tests/sized_trait.rs:453 (all coverage from this test)
fn main() -> () {}
}])
tc_ok()
);
}
#[test]
requires_sized_struct_argument() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
fn consume<T>(value: T) -> () where T: Sized {}
fn forward<T>(value: Tail<T>) -> () { consume::<Tail<T>>(value); }
}])
tc_ok()
(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: true } }
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()`"#]]);
}
#540: use the associated-type Sized bound; remove should_panic when fixed.
#[test]
_panic(expected = "prove_sized { ty: <!ty_0 as Tr>::A")]
iated_sized_bound_allows_nonfinal_struct_field() {
program = crates![crate Foo {
trait Tr { type A: [Sized]; }
struct S<T> where T: Tr { first: <T as Tr>::A, last: u32 }
fn main() -> () {}
}];
heck rustc before the expected formality failure.
(ok, stderr) = formality_rust::to_rust::test_util::run_rustc(&program);
rt!(ok, "{stderr}");
alityTest::new(program).rustc_ok().ok();
}
#540: use the associated-type Sized bound; remove should_panic when fixed.
#[test]
_panic(expected = "prove_sized { ty: <!ty_0 as Tr>::A")]
iated_sized_bound_allows_enum_field() {
program = crates![crate Foo {
trait Tr { type A: [Sized]; }
enum E<T> where T: Tr { Some { value: <T as Tr>::A }, None {} }
fn main() -> () {}
}];
heck rustc before the expected formality failure.
(ok, stderr) = formality_rust::to_rust::test_util::run_rustc(&program);
rt!(ok, "{stderr}");
alityTest::new(program).rustc_ok().ok();
}
#[test]
d_struct_sized_bound_executes() {
alityTest::new(crates![crate Foo {
struct Tail<T> { prefix: u32, tail: T }
struct Outer<T> { inner: Tail<T> }
fn consume<T>(value: T) -> u32 where T: Sized { return 7_u32; }
fn main() -> () {
println!(consume::<Outer<u32>>(Outer::<u32> {
inner: Tail::<u32> { prefix: 1_u32, tail: 2_u32 }
}));
}
Source location: tests/sized_trait.rs:518 (all coverage from this test)
fn main() -> () {
println!(consume::<Outer<u32>>(Outer::<u32> {
inner: Tail::<u32> { prefix: 1_u32, tail: 2_u32 }
}));
}
Source location: tests/well_formed_struct.rs:17 (all coverage from this test)
fn main() -> () {
exists<'y> {
let a: u32 = 22_u32;
let f: Foo<'y> = Foo::<'y> { y: &'y a };
}
}
Source location: tests/well_formed_trait_ref.rs:19 (all coverage from this test)
#[test]
fn dependent_where_clause() {
FormalityTest::new(crates![crate foo {
trait Trait1 {}
trait Trait2 {}
struct S1<T> where T: Trait1 {
dummy: T,
}
struct S2<T> where T: Trait1, S1<T> : Trait2 {
dummy: T,
}
}])
.skip_execute()
.ok()
}
Source location: tests/well_formed_trait_ref.rs:56 (all coverage from this test)
#[test]
fn lifetime_param() {
FormalityTest::new(crates![crate foo {
trait Trait1<'a> {}
struct S1 {}
struct S2<'a> where S1: Trait1<'a> {}
}])
.skip_execute()
.ok()
}
Source location: tests/well_formed_trait_ref.rs:71 (all coverage from this test)
#[test]
fn static_lifetime_param() {
FormalityTest::new(crates![crate foo {
trait Trait1<'a> {}
struct S1 {}
impl Trait1<'static> for S1 {}
struct S2 where S1: Trait1<'static> {}
}])
.skip_execute()
.ok()
}
Source location: tests/well_formed_trait_ref.rs:86 (all coverage from this test)
#[test]
fn const_param() {
FormalityTest::new(crates![crate foo {
trait Trait1<const C> where type_of_const C is u32 {}
struct S1 {}
impl Trait1<u32(3)> for S1 {}
struct S2 where S1: Trait1<u32(3)> {}
}])
.skip_execute()
.ok()
}