Positive coverage: check_all_crates / check all prefixes
check all prefixes| Line | Coverage | Source |
|---|---|---|
| 48 | N/A | (let crates = with_core_crate(&crates)) |
| 51 | ✗ | (for_all(i in 0..crates.len()) (let program = crates.prefix(i).to_prove_decls()) (check_crate(program, &crates.crates[i]) => ())) |
| ──────── ("check all prefixes") | ||
| 55 | 148 | (check_all_crates(crates) => ()) |
148 tests exercised this rule:
Source location: tests/basic_tests.rs:58
#[test]
fn hello_world() {
FormalityTest::new(crates![crate Foo {
trait Foo<T> where T: Bar<Self>, Self: Baz {}
trait Bar<T> where T: Baz {}
trait Baz {}
impl Baz for u32 {}
impl Bar<u32> for u32 {}
impl<T> Bar<T> for () where T: Baz {}
}])
.skip_execute()
.ok()
}
Proof tree
check_all_crates (check all prefixes)mod.rs:54args
for_allmod.rs:41for_allmod.rs:51args
check_crate (check crate)mod.rs:75args
for_allmod.rs:60for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
Source location: tests/basic_tests.rs:74
#[test]
fn basic_where_clauses_pass() {
FormalityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
trait WellFormed where for<T> u32: A<T> { }
impl <T> B for T {}
}])
.skip_execute()
.ok()
}
Proof tree
check_all_crates (check all prefixes)mod.rs:54args
for_allmod.rs:41for_allmod.rs:51args
check_crate (check crate)mod.rs:75args
for_allmod.rs:60for_allmod.rs:72args
check_crate_item (feature gate)mod.rs:224args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (forall)prove_wc.rs:36args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (integers and booleans)prove_wf.rs:56args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
check_coherence (check_coherence)coherence.rs:24args
for_allcoherence.rs:8for_allcoherence.rs:17args
for_allcoherence.rs:8for_allcoherence.rs:18args
overlap_check (skip_same_impl)coherence.rs:75
for_allcoherence.rs:8for_allcoherence.rs:20args
orphan_check (orphan_check)coherence.rs:39args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait ref is local)prove_wc.rs:147args
is_local_trait_ref (local trait)is_local.rs:208args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
Source location: tests/basic_tests.rs:121
fn foo() -> () where for<T> u32: A<T> { trusted }
impl <T> B for T {}
}])
p_execute()
)
}
#[test]
ifetime_binder_in_fn_where_clause_fail() {
alityTest::new(crates![crate core {
trait A<T> where T: B { }
trait B { }
fn foo() -> () where for<T> u32: A<T> { trusted }
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
non lifetime binders require #![feature(non_lifetime_binders)]"#]])
}
#[test]
ifetime_binder_in_trait_impl_where_clause_pass() {
alityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
impl<T> B for T where for<U> u32: A<U> { }
}])
p_execute()
)
}
#[test]
ifetime_binder_in_trait_impl_where_clause_fail() {
alityTest::new(crates![crate core {
trait A<T> where T: B { }
trait B { }
impl<T> B for T where for<U> u32: A<U> { }
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
non lifetime binders require #![feature(non_lifetime_binders)]"#]])
}
#[test]
ifetime_binder_in_neg_trait_impl_where_clause_pass() {
alityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
impl<T> !A<T> for u32 where for<U> u32: A<U> { }
impl <T> B for T {}
}])
p_execute()
)
}
#[test]
ifetime_binder_in_neg_trait_impl_where_clause_fail() {
alityTest::new(crates![crate core {
trait A<T> where T: B { }
trait B { }
impl<T> !A<T> for u32 where for<U> u32: A<U> { }
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
non lifetime binders require #![feature(non_lifetime_binders)]"#]])
}
#[test]
ifetime_binder_in_enum_where_clause_pass() {
alityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
enum E where for<U> u32: A<U> { }
impl <T> B for T {}
}])
p_execute()
)
}
#[test]
ifetime_binder_in_enum_where_clause_fail() {
alityTest::new(crates![crate core {
trait A<T> where T: B { }
trait B { }
enum E where for<U> u32: A<U> { }
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
non lifetime binders require #![feature(non_lifetime_binders)]"#]])
}
#[test]
ifetime_binder_in_struct_where_clause_pass() {
alityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
struct S<T> where for<U> u32: A<U> { }
impl <T> B for T {}
}])
p_execute()
)
}
#[test]
ifetime_binder_in_struct_where_clause_fail() {
alityTest::new(crates![crate core {
trait A<T> where T: B { }
trait B { }
struct S<T> where for<U> u32: A<U> { }
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
non lifetime binders require #![feature(non_lifetime_binders)]"#]])
}
#[test]
ime_binder_in_where_clause_without_feature_pass() {
alityTest::new(crates![crate core {
trait A<'b> { }
impl<'b> A<'b> for u32 { }
trait WellFormed where for<'b> u32: A<'b> { }
}])
p_execute()
)
}
#[test]
_adt_variant_dup() {
alityTest::new(crates![crate Foo {
enum Bar {
Baz{},
Baz{},
}
Proof tree
check_all_crates (check all prefixes)mod.rs:54args
for_allmod.rs:41for_allmod.rs:51args
check_crate (check crate)mod.rs:75args
for_allmod.rs:60for_allmod.rs:72args
check_crate_item (feature gate)mod.rs:224args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (free fn)mod.rs:207args
check_free_fn (check free fn)fns.rs:25args
check_fn (check fn)fns.rs:56args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (forall)prove_wc.rs:36args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (integers and booleans)prove_wf.rs:56args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (parameter well formed)prove_wc.rs:160args
prove_wf (tuples)prove_wf.rs:50args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_fn_body (trusted fn body)fns.rs:82args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
check_coherence (check_coherence)coherence.rs:24args
for_allcoherence.rs:8for_allcoherence.rs:17args
for_allcoherence.rs:8for_allcoherence.rs:18args
overlap_check (skip_same_impl)coherence.rs:75
for_allcoherence.rs:8for_allcoherence.rs:20args
orphan_check (orphan_check)coherence.rs:39args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait ref is local)prove_wc.rs:147args
is_local_trait_ref (local trait)is_local.rs:208args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
Source location: tests/basic_tests.rs:149
#[test]
fn non_lifetime_binder_in_trait_impl_where_clause_pass() {
FormalityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
impl<T> B for T where for<U> u32: A<U> { }
}])
.skip_execute()
.ok()
}
Proof tree
check_all_crates (check all prefixes)mod.rs:54args
for_allmod.rs:41for_allmod.rs:51args
check_crate (check crate)mod.rs:75args
for_allmod.rs:60for_allmod.rs:72args
check_crate_item (feature gate)mod.rs:224args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (forall)prove_wc.rs:36args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (integers and booleans)prove_wf.rs:56args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (forall)prove_wc.rs:36args
prove_wc (assumption - predicate)prove_wc.rs:49args
prove_via (forall)prove_via.rs:50args
prove_via (predicate-congruence-axiom)prove_via.rs:31args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (forall)prove_wc.rs:36args
prove_wc (assumption - predicate)prove_wc.rs:49args
prove_via (forall)prove_via.rs:50args
prove_via (predicate-congruence-axiom)prove_via.rs:31args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
check_coherence (check_coherence)coherence.rs:24args
for_allcoherence.rs:8for_allcoherence.rs:17args
for_allcoherence.rs:8for_allcoherence.rs:18args
overlap_check (skip_same_impl)coherence.rs:75
for_allcoherence.rs:8for_allcoherence.rs:20args
orphan_check (orphan_check)coherence.rs:39args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait ref is local)prove_wc.rs:147args
is_local_trait_ref (local trait)is_local.rs:208args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
Source location: tests/basic_tests.rs:179
#[test]
fn non_lifetime_binder_in_neg_trait_impl_where_clause_pass() {
FormalityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
impl<T> !A<T> for u32 where for<U> u32: A<U> { }
impl <T> B for T {}
}])
.skip_execute()
.ok()
}
Proof tree
check_all_crates (check all prefixes)mod.rs:54args
for_allmod.rs:41for_allmod.rs:51args
check_crate (check crate)mod.rs:75args
for_allmod.rs:60for_allmod.rs:72args
check_crate_item (feature gate)mod.rs:224args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (neg trait impl)mod.rs:213args
check_neg_trait_impl (check_neg_trait_impl)impls.rs:64args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (forall)prove_wc.rs:36args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (integers and booleans)prove_wf.rs:56args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (negative impl)prove_wc.rs:104args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (forall)prove_wc.rs:36args
prove_wc (assumption - predicate)prove_wc.rs:49args
prove_via (forall)prove_via.rs:50args
prove_via (predicate-congruence-axiom)prove_via.rs:31args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
check_coherence (check_coherence)coherence.rs:24args
for_allcoherence.rs:8for_allcoherence.rs:17args
for_allcoherence.rs:8for_allcoherence.rs:18args
overlap_check (skip_same_impl)coherence.rs:75
for_allcoherence.rs:8for_allcoherence.rs:20args
orphan_check (orphan_check)coherence.rs:39args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait ref is local)prove_wc.rs:147args
is_local_trait_ref (local trait)is_local.rs:208args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
for_allcoherence.rs:8for_allcoherence.rs:22args
orphan_check_neg (orphan_check_neg)coherence.rs:59args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait ref is local)prove_wc.rs:147args
is_local_trait_ref (local trait)is_local.rs:208args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
Source location: tests/basic_tests.rs:209
#[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:54args
for_allmod.rs:41for_allmod.rs:51args
check_crate (check crate)mod.rs:75args
for_allmod.rs:60for_allmod.rs:72args
check_crate_item (feature gate)mod.rs:224args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (adt)mod.rs:201args
check_adt (check adt)adts.rs:27args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (forall)prove_wc.rs:36args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (integers and booleans)prove_wf.rs:56args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
check_coherence (check_coherence)coherence.rs:24args
for_allcoherence.rs:8for_allcoherence.rs:17args
for_allcoherence.rs:8for_allcoherence.rs:18args
overlap_check (skip_same_impl)coherence.rs:75
for_allcoherence.rs:8for_allcoherence.rs:20args
orphan_check (orphan_check)coherence.rs:39args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait ref is local)prove_wc.rs:147args
is_local_trait_ref (local trait)is_local.rs:208args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
Source location: tests/basic_tests.rs:239
#[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:54args
for_allmod.rs:41for_allmod.rs:51args
check_crate (check crate)mod.rs:75args
for_allmod.rs:60for_allmod.rs:72args
check_crate_item (feature gate)mod.rs:224args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (adt)mod.rs:201args
check_adt (check adt)adts.rs:27args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (forall)prove_wc.rs:36args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (integers and booleans)prove_wf.rs:56args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
check_coherence (check_coherence)coherence.rs:24args
for_allcoherence.rs:8for_allcoherence.rs:17args
for_allcoherence.rs:8for_allcoherence.rs:18args
overlap_check (skip_same_impl)coherence.rs:75
for_allcoherence.rs:8for_allcoherence.rs:20args
orphan_check (orphan_check)coherence.rs:39args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait ref is local)prove_wc.rs:147args
is_local_trait_ref (local trait)is_local.rs:208args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
Source location: tests/basic_tests.rs:266
#[test]
fn lifetime_binder_in_where_clause_without_feature_pass() {
FormalityTest::new(crates![crate core {
trait A<'b> { }
impl<'b> A<'b> for u32 { }
trait WellFormed where for<'b> u32: A<'b> { }
}])
.skip_execute()
.ok()
}
Proof tree
check_all_crates (check all prefixes)mod.rs:54args
for_allmod.rs:41for_allmod.rs:51args
check_crate (check crate)mod.rs:75args
for_allmod.rs:60for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
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_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (forall)prove_wc.rs:36args
prove_wc (trait well formed)prove_wc.rs:141args
for_allcombinators.rs:69prove_wf (integers and booleans)prove_wf.rs:56args
for_allcombinators.rs:69prove_wf (universal variables)prove_wf.rs:27args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_coherence (check_coherence)coherence.rs:24args
for_allcoherence.rs:8for_allcoherence.rs:17args
for_allcoherence.rs:8for_allcoherence.rs:18args
overlap_check (skip_same_impl)coherence.rs:75
for_allcoherence.rs:8for_allcoherence.rs:20args
orphan_check (orphan_check)coherence.rs:39args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait ref is local)prove_wc.rs:147args
is_local_trait_ref (local trait)is_local.rs:208args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
Source location: tests/basic_tests.rs:356
fn a() -> () { trusted }
}])
p_execute()
);
}
#[test]
_impl_dup() {
alityTest::new(crates![crate core {
trait MyTrait {}
struct MyStruct {}
impl MyTrait for MyStruct {}
impl MyTrait for MyStruct {}
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
`impl MyTrait for MyStruct { }` is defined multiple times"#]]);
}
#[test]
_neg_impl_dup() {
alityTest::new(crates![crate core {
trait MyTrait {}
struct MyStruct {}
impl !MyTrait for MyStruct {}
impl !MyTrait for MyStruct {}
}])
(expect_test::expect![[r#"
the rule "check crate" at (mod.rs) failed because
`impl ! MyTrait for MyStruct {}` is defined multiple times"#]]);
}
#[test]
missing_required_fn() {
alityTest::new(crates![crate core {
trait Foo {
fn bar(self_: u32) -> u32;
}
Proof tree
check_all_crates (check all prefixes)mod.rs:54args
for_allmod.rs:41for_allmod.rs:51args
check_crate (check crate)mod.rs:75args
for_allmod.rs:60for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (free fn)mod.rs:207args
check_free_fn (check free fn)fns.rs:25args
check_fn (check fn)fns.rs:56args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (parameter well formed)prove_wc.rs:160args
prove_wf (tuples)prove_wf.rs:50args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_fn_body (trusted fn body)fns.rs:82args
check_coherence (check_coherence)coherence.rs:24args
Source location: tests/basic_tests.rs:426
Proof tree
check_all_crates (check all prefixes)mod.rs:54args
for_allmod.rs:41for_allmod.rs:51args
check_crate (check crate)mod.rs:75args
for_allmod.rs:60for_allmod.rs:72args
check_crate_item (trait)mod.rs:188args
check_trait (check trait)traits.rs:26args
prove_wc_list (none)prove_wc_list.rs:21args
for_alltraits.rs:9for_alltraits.rs:24args
check_trait_item (fn in trait)traits.rs:44args
check_fn_in_trait (check fn in trait)traits.rs:68args
check_fn (check fn)fns.rs:56prove_wc_list (none)prove_wc_list.rs:21args
for_allfns.rs:31for_allfns.rs:52args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (parameter well formed)prove_wc.rs:160args
prove_wf (integers and booleans)prove_wf.rs:56args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (parameter well formed)prove_wc.rs:160args
prove_wf (integers and booleans)prove_wf.rs:56args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_fn_body (trusted fn body)fns.rs:82args
for_allmod.rs:72args
check_crate_item (adt)mod.rs:201args
check_adt (check adt)adts.rs:27args
prove_wc_list (none)prove_wc_list.rs:21args
for_allmod.rs:72args
check_crate_item (trait impl)mod.rs:195args
check_trait_impl (check_trait_impl)impls.rs:39args
prove_wc_list (none)prove_wc_list.rs:21args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (positive impl)prove_wc.rs:87args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (eq)prove_wc.rs:126args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
check_safety_matches (safety matches)impls.rs:79args
check_drop_impl_always_applicable (not a Drop impl)impls.rs:313args
check_coherence (check_coherence)coherence.rs:24args
for_allcoherence.rs:8for_allcoherence.rs:17args
for_allcoherence.rs:8for_allcoherence.rs:18args
overlap_check (skip_same_impl)coherence.rs:75
for_allcoherence.rs:8for_allcoherence.rs:20args
orphan_check (orphan_check)coherence.rs:39args
prove_wc_list (some)prove_wc_list.rs:28args
prove_wc (trait ref is local)prove_wc.rs:147args
is_local_trait_ref (local trait)is_local.rs:208args
prove_after (prove_after)prove_after.rs:20args
prove_wc_list (none)prove_wc_list.rs:21args
Source location: tests/borrowck.rs:128
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 trees omitted for the remaining 138 tests.
Source location: tests/borrowck.rs:201
fn foo() -> u32 {
let x: u32;
if true {
x = 1_u32;
} else {
x = 2_u32;
}
return x;
}
Source location: tests/borrowck.rs:270
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;
}
Source location: tests/borrowck.rs:2025
#[test]
fn min_problem_case_3() {
FormalityTest::new(feature_gate_program(NLL_GATE, MIN_PROBLEM_CASE_3))
.skip_execute()
.err(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"#]]);
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
MIN_PROBLEM_CASE_3,
))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
MIN_PROBLEM_CASE_3,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:2032
#[test]
fn min_problem_case_3() {
FormalityTest::new(feature_gate_program(NLL_GATE, MIN_PROBLEM_CASE_3))
.skip_execute()
.err(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"#]]);
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
MIN_PROBLEM_CASE_3,
))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
MIN_PROBLEM_CASE_3,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:2105
fn foo() -> i32 {
exists<'r0, 'r1> {
let result: i32;
{
let v1: i32 = 22_i32;
let v2: &'r0 i32 = &'r1 v1;
result = *v2;
}
return result;
}
}
Source location: tests/borrowck.rs:2220
fn min_problem_case_3<'a>(m: &'a mut Map) -> &'a mut Map {
exists<'r0, 'r1> {
let n: &'r0 mut Map = &mut 'r0 *m;
if true {
} else {
}
let o: &'r1 mut Map = &mut 'r1 *m;
return o;
}
}
Source location: tests/borrowck.rs:2282
fn foo<'a, 'b>(v1: &'a u32) -> &'b u32
where
'a: 'b,
{
exists<'r0> {
let v2: &'r0 u32 = v1;
return v2;
}
}
Source location: tests/borrowck.rs:2299
fn foo<'a, 'b, 'c>(v1: &'a u32) -> &'c u32
where
'a: 'b,
'b: 'c,
{
return v1;
}
Source location: tests/borrowck.rs:2341
fn min_problem_case_4<'a>(list: &'a mut Map, list2: &'a mut Map) -> u32 {
exists<'r0> {
let num: &'r0 mut u32 = &mut 'r0 (*list).value;
list = &mut 'a *list2;
num;
return 0_u32;
}
}
Source location: tests/borrowck.rs:2474
fn foo () -> u32 {
exists<'l_p, 'l_q, 'loan_0, 'loan_1, 'loan_2, 'loan_3> {
let a: u32 = 0_u32;
let b: u32 = 0_u32;
// In Rustc, the 1-tuple is needed for some reason
// Niko does not 100% understand, else rustc is able to
// see that this program is safe.
let q: &'l_q mut u32 = &mut 'loan_0 a;
let p: &'l_p mut u32 = &mut 'loan_1 a;
if true {
p = &mut 'loan_1 a;
q = &mut 'loan_2 b;
} else {
p = &mut 'loan_3 b;
}
*q = 1_u32;
return *p;
}
}
Source location: tests/borrowck.rs:2664
fn foo() -> u32 {
exists<'r0, 'r1> {
'a: loop {
let x: i32 = 0_i32;
let r: &'r0 i32 = &'r1 x;
let _y: i32 = *r;
continue 'a;
}
}
}
Source location: tests/borrowck.rs:2692
fn foo() -> () {
'a: {
{
let 'a: v: i32 = 0_i32;
}
}
}
Source location: tests/borrowck.rs:2831
#[test]
fn if_false_borrowck() {
FormalityTest::new(feature_gate_program(NLL_GATE, IF_FALSE_BORROWCK))
.skip_execute()
.err(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"#]]);
FormalityTest::new(feature_gate_program(POLONIUS_ALPHA_GATE, IF_FALSE_BORROWCK))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
IF_FALSE_BORROWCK,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:2838
#[test]
fn if_false_borrowck() {
FormalityTest::new(feature_gate_program(NLL_GATE, IF_FALSE_BORROWCK))
.skip_execute()
.err(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"#]]);
FormalityTest::new(feature_gate_program(POLONIUS_ALPHA_GATE, IF_FALSE_BORROWCK))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
IF_FALSE_BORROWCK,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:2911
fn foo<'a>(a: &'a u32) -> &'a u32 {
exists<'r0> {
let r: &'r0 u32 = identity::<&'r0 u32>(a);
return r;
}
}
Source location: tests/borrowck.rs:2933
fn bar() -> u32 {
exists<'r1> {
let v: u32 = 7_u32;
let r: u32 = foo::<'r1>(&'r1 v);
return r;
}
}
Source location: tests/borrowck.rs:2961
fn foo<'a, 'b>(a: &'a u32) -> &'b u32
where 'a: 'b {
let r: &'b u32 = identity::<&'b u32>(a);
return r;
}
Source location: tests/borrowck.rs:3006
fn foo<'b>(a: &'b u32) -> &'b u32 {
let r: &'b u32 = bar::<'b, &'b u32>(a);
return r;
}
Source location: tests/borrowck.rs:3027
fn bar() -> u32 {
exists<'r0, 'r1> {
let v: u32 = 1_u32;
let p: &'r0 u32 = &'r1 v;
foo(0_u32);
return *p;
}
}
Source location: tests/borrowck.rs:3081
fn foo() -> u32 {
exists<'r0, 'r1, 'r2, 'r3> {
let p: Point = Point { x: 0_u32, y: 0_u32 };
let b1: &'r0 mut u32 = &mut 'r1 p.x;
let b2: &'r2 mut u32 = &mut 'r3 p.y;
*b1 = 1_u32;
*b2 = 2_u32;
return 0_u32;
}
}
Source location: tests/borrowck.rs:3200
fn reborrow<'a>(a: &'a mut u8) -> &'a mut u8 {
exists<'r0, 'r1, 'r2, 'r3> {
if true {
let b: &'r1 mut u8 = &mut 'r0 *a;
return b;
} else { }
let c: &'r3 mut u8 = &mut 'r2 *a;
return c;
}
}
Source location: tests/borrowck.rs:3266
#[test]
fn outlive_before_return_does_not_affect_merged_paths() {
FormalityTest::new(feature_gate_program(
NLL_GATE,
OUTLIVE_BEFORE_RETURN_DOES_NOT_AFFECT_MERGED_PATHS,
))
.skip_execute()
.err(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 = *(a : &!lt_1 mut u8) : <&!lt_1 mut u8 as Derefable>::Target
&access.place = *(a : &!lt_1 mut u8) : <&!lt_1 mut u8 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, ?lt_4, ?lt_5}
&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 `a`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(a : &!lt_1 mut u8) : <&!lt_1 mut u8 as Derefable>::Target
place_loaned_ref = a : &!lt_1 mut u8"#]]);
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
OUTLIVE_BEFORE_RETURN_DOES_NOT_AFFECT_MERGED_PATHS,
))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
OUTLIVE_BEFORE_RETURN_DOES_NOT_AFFECT_MERGED_PATHS,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:3273
#[test]
fn outlive_before_return_does_not_affect_merged_paths() {
FormalityTest::new(feature_gate_program(
NLL_GATE,
OUTLIVE_BEFORE_RETURN_DOES_NOT_AFFECT_MERGED_PATHS,
))
.skip_execute()
.err(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 = *(a : &!lt_1 mut u8) : <&!lt_1 mut u8 as Derefable>::Target
&access.place = *(a : &!lt_1 mut u8) : <&!lt_1 mut u8 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, ?lt_4, ?lt_5}
&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 `a`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(a : &!lt_1 mut u8) : <&!lt_1 mut u8 as Derefable>::Target
place_loaned_ref = a : &!lt_1 mut u8"#]]);
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
OUTLIVE_BEFORE_RETURN_DOES_NOT_AFFECT_MERGED_PATHS,
))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
OUTLIVE_BEFORE_RETURN_DOES_NOT_AFFECT_MERGED_PATHS,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:3290
fn reborrow<'a>(a: &'a mut u8) -> &'a mut u8 {
exists<'r0, 'r1, 'r2, 'r3> {
let b: &'r1 mut u8 = &mut 'r0 *a;
return b;
let c: &'r3 mut u8 = &mut 'r2 *a;
return c;
}
}
Source location: tests/borrowck.rs:3310
fn reborrow<'a>(a: &'a mut u8) -> &'a mut u8 {
exists<'r0, 'r1, 'r2, 'r3> {
if true {
let b: &'r1 mut u8 = &mut 'r0 *a;
return b;
} else {
let c: &'r3 mut u8 = &mut 'r2 *a;
return c;
}
}
}
Source location: tests/borrowck.rs:3378
fn foo() -> u32 {
exists<'r0, 'r1, 'r2> {
let x: u32 = 22_u32;
let p: &'r1 u32 = &'r0 x;
let q: &'r2 u32 = p;
x = 1_u32;
return 0_u32;
}
}
Source location: tests/borrowck.rs:3540
fn foo<'a, 'b>(p: &'a mut u32) -> u32 where 'a: 'b {
let q: &'b mut u32 = &mut 'b *p;
q;
return 0 _ u32;
}
Source location: tests/borrowck.rs:3683
#[test]
fn issue_63908_remove_last_node_recursive() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(
NLL_GATE,
ISSUE_63908_REMOVE_LAST_NODE_RECURSIVE,
))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_63908_REMOVE_LAST_NODE_RECURSIVE,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_63908_REMOVE_LAST_NODE_RECURSIVE,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:3691
#[test]
fn issue_63908_remove_last_node_recursive() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(
NLL_GATE,
ISSUE_63908_REMOVE_LAST_NODE_RECURSIVE,
))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_63908_REMOVE_LAST_NODE_RECURSIVE,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_63908_REMOVE_LAST_NODE_RECURSIVE,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:3699
#[test]
fn issue_63908_remove_last_node_recursive() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(
NLL_GATE,
ISSUE_63908_REMOVE_LAST_NODE_RECURSIVE,
))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_63908_REMOVE_LAST_NODE_RECURSIVE,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_63908_REMOVE_LAST_NODE_RECURSIVE,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:3801
#[test]
fn issue_63908_remove_last_node_iterative() {
FormalityTest::new(feature_gate_program(
NLL_GATE,
ISSUE_63908_REMOVE_LAST_NODE_ITERATIVE,
))
.skip_execute()
.err(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 = *(cursor : &?lt_2 mut List) : <&?lt_2 mut List as Derefable>::Target
&access.place = *(cursor : &?lt_2 mut List) : <&?lt_2 mut List 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_2, ?lt_3}
&lifetime.upcast() = ?lt_2
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `cursor`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(cursor : &?lt_2 mut List) : <&?lt_2 mut List as Derefable>::Target
place_loaned_ref = cursor : &?lt_2 mut List"#]]);
// [polonius]: rustc errors here (known-bug #63908), same as [nll].
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_63908_REMOVE_LAST_NODE_ITERATIVE,
))
.skip_execute()
.err(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 = *(cursor : &?lt_2 mut List) : <&?lt_2 mut List as Derefable>::Target
&access.place = *(cursor : &?lt_2 mut List) : <&?lt_2 mut List 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_2, ?lt_3}
&lifetime.upcast() = ?lt_2
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `cursor`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(cursor : &?lt_2 mut List) : <&?lt_2 mut List as Derefable>::Target
place_loaned_ref = cursor : &?lt_2 mut List"#]]);
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_63908_REMOVE_LAST_NODE_ITERATIVE,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:3849
#[test]
fn issue_57165_no_control_flow() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_57165_NO_CONTROL_FLOW))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_57165_NO_CONTROL_FLOW,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_57165_NO_CONTROL_FLOW,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:3857
#[test]
fn issue_57165_no_control_flow() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_57165_NO_CONTROL_FLOW))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_57165_NO_CONTROL_FLOW,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_57165_NO_CONTROL_FLOW,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:3865
#[test]
fn issue_57165_no_control_flow() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_57165_NO_CONTROL_FLOW))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_57165_NO_CONTROL_FLOW,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_57165_NO_CONTROL_FLOW,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4011
#[test]
fn issue_57165_conditional() {
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_57165_CONDITIONAL))
.skip_execute()
.err(expect_test::expect![[r#"
the rule "fixed-point" at (nll.rs) failed because
condition evaluated to false: `state0 == state1`
state0 = flow_state([scope(none, None, {}, None, [], []), scope(none, None, {}, None, [], []), scope(some(U(4)), None, {}, None, [(b, X), (p, &?lt_1 mut X)], [b : X, p : &?lt_1 mut X]), scope(some(U(4)), Some('l), {}, Some({* p}), [], [])], point_flow_state({pending_outlives(?lt_2, ?lt_1)}, {loan(?lt_2, b : X, mut)}, {}), {}, {}, {pending_outlives(?lt_2, ?lt_1)})
state1 = flow_state([scope(none, None, {}, None, [], []), scope(none, None, {}, None, [], []), scope(some(U(4)), None, {}, None, [(b, X), (p, &?lt_1 mut X)], [b : X, p : &?lt_1 mut X]), scope(some(U(4)), Some('l), {}, Some({* p}), [], [])], point_flow_state({pending_outlives(?lt_1, ?lt_3), pending_outlives(?lt_2, ?lt_1), pending_outlives(?lt_3, ?lt_4), pending_outlives(?lt_4, ?lt_1)}, {loan(?lt_2, b : X, mut), loan(?lt_3, *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target, mut)}, {}), {labeled_flow_state('l, point_flow_state({pending_outlives(?lt_1, ?lt_3), pending_outlives(?lt_2, ?lt_1)}, {loan(?lt_2, b : X, mut), loan(?lt_3, *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target, mut)}, {}))}, {}, {pending_outlives(?lt_1, ?lt_3), pending_outlives(?lt_2, ?lt_1), pending_outlives(?lt_3, ?lt_4), pending_outlives(?lt_4, ?lt_1)})
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 = *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target
&access.place = *(p : &?lt_1 mut X) : <&?lt_1 mut X 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_3, ?lt_4}
&lifetime.upcast() = ?lt_1
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `p`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target
place_loaned_ref = p : &?lt_1 mut X
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 = *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target
&access.place = *(p : &?lt_1 mut X) : <&?lt_1 mut X 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_3, ?lt_4}
&lifetime.upcast() = ?lt_1
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `p`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target
place_loaned_ref = p : &?lt_1 mut X"#]]);
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_57165_CONDITIONAL,
))
.skip_execute()
.err(expect_test::expect![[r#"
the rule "fixed-point" at (nll.rs) failed because
condition evaluated to false: `state0 == state1`
state0 = flow_state([scope(none, None, {}, None, [], []), scope(none, None, {}, None, [], []), scope(some(U(4)), None, {}, None, [(b, X), (p, &?lt_1 mut X)], [b : X, p : &?lt_1 mut X]), scope(some(U(4)), Some('l), {}, Some({* p}), [], [])], point_flow_state({pending_outlives(?lt_2, ?lt_1)}, {loan(?lt_2, b : X, mut)}, {}), {}, {}, {pending_outlives(?lt_2, ?lt_1)})
state1 = flow_state([scope(none, None, {}, None, [], []), scope(none, None, {}, None, [], []), scope(some(U(4)), None, {}, None, [(b, X), (p, &?lt_1 mut X)], [b : X, p : &?lt_1 mut X]), scope(some(U(4)), Some('l), {}, Some({* p}), [], [])], point_flow_state({pending_outlives(?lt_1, ?lt_3), pending_outlives(?lt_2, ?lt_1), pending_outlives(?lt_3, ?lt_4), pending_outlives(?lt_4, ?lt_1)}, {loan(?lt_2, b : X, mut), loan(?lt_3, *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target, mut)}, {}), {labeled_flow_state('l, point_flow_state({pending_outlives(?lt_1, ?lt_3), pending_outlives(?lt_2, ?lt_1)}, {loan(?lt_2, b : X, mut), loan(?lt_3, *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target, mut)}, {}))}, {}, {pending_outlives(?lt_1, ?lt_3), pending_outlives(?lt_2, ?lt_1), pending_outlives(?lt_3, ?lt_4), pending_outlives(?lt_4, ?lt_1)})
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 = *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target
&access.place = *(p : &?lt_1 mut X) : <&?lt_1 mut X 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_3, ?lt_4}
&lifetime.upcast() = ?lt_1
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `p`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target
place_loaned_ref = p : &?lt_1 mut X
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 = *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target
&access.place = *(p : &?lt_1 mut X) : <&?lt_1 mut X 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_3, ?lt_4}
&lifetime.upcast() = ?lt_1
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `p`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(p : &?lt_1 mut X) : <&?lt_1 mut X as Derefable>::Target
place_loaned_ref = p : &?lt_1 mut X"#]]);
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_57165_CONDITIONAL,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4066
#[test]
fn issue_57165_conditional_with_indirection() {
// [nll]: rustc passes
FormalityTest::new(feature_gate_program(
NLL_GATE,
ISSUE_57165_CONDITIONAL_WITH_INDIRECTION,
))
.skip_execute()
.ok();
// [polonius]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_57165_CONDITIONAL_WITH_INDIRECTION,
))
.skip_execute()
.ok();
// [legacy]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_57165_CONDITIONAL_WITH_INDIRECTION,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4074
#[test]
fn issue_57165_conditional_with_indirection() {
// [nll]: rustc passes
FormalityTest::new(feature_gate_program(
NLL_GATE,
ISSUE_57165_CONDITIONAL_WITH_INDIRECTION,
))
.skip_execute()
.ok();
// [polonius]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_57165_CONDITIONAL_WITH_INDIRECTION,
))
.skip_execute()
.ok();
// [legacy]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_57165_CONDITIONAL_WITH_INDIRECTION,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4082
#[test]
fn issue_57165_conditional_with_indirection() {
// [nll]: rustc passes
FormalityTest::new(feature_gate_program(
NLL_GATE,
ISSUE_57165_CONDITIONAL_WITH_INDIRECTION,
))
.skip_execute()
.ok();
// [polonius]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_57165_CONDITIONAL_WITH_INDIRECTION,
))
.skip_execute()
.ok();
// [legacy]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_57165_CONDITIONAL_WITH_INDIRECTION,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4137
#[test]
fn issue_46859_to_refs() {
// [nll]: rustc passes
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_46859_TO_REFS))
.skip_execute()
.ok();
// [polonius]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_46859_TO_REFS,
))
.skip_execute()
.ok();
// [legacy]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_46859_TO_REFS,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4145
#[test]
fn issue_46859_to_refs() {
// [nll]: rustc passes
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_46859_TO_REFS))
.skip_execute()
.ok();
// [polonius]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_46859_TO_REFS,
))
.skip_execute()
.ok();
// [legacy]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_46859_TO_REFS,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4153
#[test]
fn issue_46859_to_refs() {
// [nll]: rustc passes
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_46859_TO_REFS))
.skip_execute()
.ok();
// [polonius]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_46859_TO_REFS,
))
.skip_execute()
.ok();
// [legacy]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_46859_TO_REFS,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4191
#[test]
fn issue_46859_to_refs2() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_46859_TO_REFS2))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_46859_TO_REFS2,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_46859_TO_REFS2,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4199
#[test]
fn issue_46859_to_refs2() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_46859_TO_REFS2))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_46859_TO_REFS2,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_46859_TO_REFS2,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4207
#[test]
fn issue_46859_to_refs2() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_46859_TO_REFS2))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_46859_TO_REFS2,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_46859_TO_REFS2,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4256
#[test]
fn issue_46859_to_refs3() {
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_46859_TO_REFS3))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_46859_TO_REFS3,
))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_46859_TO_REFS3,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4263
#[test]
fn issue_46859_to_refs3() {
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_46859_TO_REFS3))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_46859_TO_REFS3,
))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_46859_TO_REFS3,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4270
#[test]
fn issue_46859_to_refs3() {
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_46859_TO_REFS3))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_46859_TO_REFS3,
))
.skip_execute()
.ok();
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_46859_TO_REFS3,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4394
#[test]
fn issue_46859_decoder_next() {
// [nll]: rustc errors
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_46859_DECODER_NEXT))
.skip_execute()
.err(expect_test::expect![[r#"
the rule "fixed-point" at (nll.rs) failed because
condition evaluated to false: `state0 == state1`
state0 = flow_state([scope(some(U(1)), None, {}, None, [(d, &!lt_1 mut Decoder)], [d : &!lt_1 mut Decoder]), scope(some(U(1)), None, {}, None, [], []), scope(some(U(3)), None, {}, None, [], []), scope(some(U(3)), Some('l), {}, Some({(* d) . buf_read}), [], [])], point_flow_state({pending_outlives(!lt_1, ?lt_2), pending_outlives(?lt_2, ?lt_3), pending_outlives(?lt_3, !lt_1)}, {}, {}), {}, {}, {pending_outlives(!lt_1, ?lt_2), pending_outlives(?lt_2, ?lt_3), pending_outlives(?lt_3, !lt_1)})
state1 = flow_state([scope(some(U(1)), None, {}, None, [(d, &!lt_1 mut Decoder)], [d : &!lt_1 mut Decoder]), scope(some(U(1)), None, {}, None, [], []), scope(some(U(3)), None, {}, None, [], []), scope(some(U(3)), Some('l), {}, Some({(* d) . buf_read}), [], [])], point_flow_state({pending_outlives(!lt_1, ?lt_2), pending_outlives(?lt_2, ?lt_3), pending_outlives(?lt_3, !lt_1)}, {loan(?lt_2, *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32, mut)}, {}), {}, {}, {pending_outlives(!lt_1, ?lt_2), pending_outlives(?lt_2, ?lt_3), pending_outlives(?lt_3, !lt_1)})
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 = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
&access.place = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
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 `*(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct]`
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `d`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
place_loaned_ref = d : &!lt_1 mut Decoder
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 = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
&access.place = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
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 `*(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct]`
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `d`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
place_loaned_ref = d : &!lt_1 mut Decoder"#]]);
// [polonius]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_46859_DECODER_NEXT,
))
.skip_execute()
.ok();
// [legacy]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_46859_DECODER_NEXT,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4402
#[test]
fn issue_46859_decoder_next() {
// [nll]: rustc errors
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_46859_DECODER_NEXT))
.skip_execute()
.err(expect_test::expect![[r#"
the rule "fixed-point" at (nll.rs) failed because
condition evaluated to false: `state0 == state1`
state0 = flow_state([scope(some(U(1)), None, {}, None, [(d, &!lt_1 mut Decoder)], [d : &!lt_1 mut Decoder]), scope(some(U(1)), None, {}, None, [], []), scope(some(U(3)), None, {}, None, [], []), scope(some(U(3)), Some('l), {}, Some({(* d) . buf_read}), [], [])], point_flow_state({pending_outlives(!lt_1, ?lt_2), pending_outlives(?lt_2, ?lt_3), pending_outlives(?lt_3, !lt_1)}, {}, {}), {}, {}, {pending_outlives(!lt_1, ?lt_2), pending_outlives(?lt_2, ?lt_3), pending_outlives(?lt_3, !lt_1)})
state1 = flow_state([scope(some(U(1)), None, {}, None, [(d, &!lt_1 mut Decoder)], [d : &!lt_1 mut Decoder]), scope(some(U(1)), None, {}, None, [], []), scope(some(U(3)), None, {}, None, [], []), scope(some(U(3)), Some('l), {}, Some({(* d) . buf_read}), [], [])], point_flow_state({pending_outlives(!lt_1, ?lt_2), pending_outlives(?lt_2, ?lt_3), pending_outlives(?lt_3, !lt_1)}, {loan(?lt_2, *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32, mut)}, {}), {}, {}, {pending_outlives(!lt_1, ?lt_2), pending_outlives(?lt_2, ?lt_3), pending_outlives(?lt_3, !lt_1)})
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 = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
&access.place = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
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 `*(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct]`
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `d`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
place_loaned_ref = d : &!lt_1 mut Decoder
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 = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
&access.place = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
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 `*(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct]`
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `d`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(d : &!lt_1 mut Decoder) : <&!lt_1 mut Decoder as Derefable>::Target . buf_read[Decoder , struct] : u32
place_loaned_ref = d : &!lt_1 mut Decoder"#]]);
// [polonius]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_46859_DECODER_NEXT,
))
.skip_execute()
.ok();
// [legacy]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_46859_DECODER_NEXT,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4536
#[test]
fn issue_92985_filtering_lending_iterator() {
// [nll]: rustc errors
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_92985_FILTER_NEXT))
.skip_execute()
.err(expect_test::expect![[r#"
the rule "fixed-point" at (nll.rs) failed because
condition evaluated to false: `state0 == state1`
state0 = flow_state([scope(some(U(1)), None, {}, None, [(f, &!lt_1 mut Filter)], [f : &!lt_1 mut Filter]), scope(some(U(1)), None, {}, None, [], []), scope(some(U(4)), None, {}, None, [], []), scope(some(U(4)), Some('l), {}, Some({(* f) . iter, (* f) . predicate}), [], [])], point_flow_state({pending_outlives(!lt_1, ?lt_2), pending_outlives(!lt_1, ?lt_3), pending_outlives(?lt_2, !lt_1), pending_outlives(?lt_2, ?lt_4)}, {}, {}), {}, {}, {pending_outlives(!lt_1, ?lt_2), pending_outlives(!lt_1, ?lt_3), pending_outlives(?lt_2, !lt_1), pending_outlives(?lt_2, ?lt_4)})
state1 = flow_state([scope(some(U(1)), None, {}, None, [(f, &!lt_1 mut Filter)], [f : &!lt_1 mut Filter]), scope(some(U(1)), None, {}, None, [], []), scope(some(U(4)), None, {}, None, [], []), scope(some(U(4)), Some('l), {}, Some({(* f) . iter, (* f) . predicate}), [], [])], point_flow_state({pending_outlives(!lt_1, ?lt_2), pending_outlives(!lt_1, ?lt_3), pending_outlives(?lt_2, !lt_1), pending_outlives(?lt_2, ?lt_4)}, {loan(?lt_2, *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32, mut), loan(?lt_3, *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . predicate[Filter , struct] : u32, mut)}, {}), {labeled_flow_state('l, point_flow_state({pending_outlives(!lt_1, ?lt_2), pending_outlives(!lt_1, ?lt_3), pending_outlives(?lt_2, !lt_1), pending_outlives(?lt_2, ?lt_4)}, {loan(?lt_2, *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32, mut)}, {}))}, {}, {pending_outlives(!lt_1, ?lt_2), pending_outlives(!lt_1, ?lt_3), pending_outlives(?lt_2, !lt_1), pending_outlives(?lt_2, ?lt_4)})
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 = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
&access.place = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
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, ?lt_4}
&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 `*(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct]`
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `f`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
place_loaned_ref = f : &!lt_1 mut Filter
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 = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
&access.place = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
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, ?lt_4}
&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 `*(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct]`
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `f`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
place_loaned_ref = f : &!lt_1 mut Filter"#]]);
// [polonius]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_92985_FILTER_NEXT,
))
.skip_execute()
.ok();
// [legacy]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_92985_FILTER_NEXT,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4544
#[test]
fn issue_92985_filtering_lending_iterator() {
// [nll]: rustc errors
FormalityTest::new(feature_gate_program(NLL_GATE, ISSUE_92985_FILTER_NEXT))
.skip_execute()
.err(expect_test::expect![[r#"
the rule "fixed-point" at (nll.rs) failed because
condition evaluated to false: `state0 == state1`
state0 = flow_state([scope(some(U(1)), None, {}, None, [(f, &!lt_1 mut Filter)], [f : &!lt_1 mut Filter]), scope(some(U(1)), None, {}, None, [], []), scope(some(U(4)), None, {}, None, [], []), scope(some(U(4)), Some('l), {}, Some({(* f) . iter, (* f) . predicate}), [], [])], point_flow_state({pending_outlives(!lt_1, ?lt_2), pending_outlives(!lt_1, ?lt_3), pending_outlives(?lt_2, !lt_1), pending_outlives(?lt_2, ?lt_4)}, {}, {}), {}, {}, {pending_outlives(!lt_1, ?lt_2), pending_outlives(!lt_1, ?lt_3), pending_outlives(?lt_2, !lt_1), pending_outlives(?lt_2, ?lt_4)})
state1 = flow_state([scope(some(U(1)), None, {}, None, [(f, &!lt_1 mut Filter)], [f : &!lt_1 mut Filter]), scope(some(U(1)), None, {}, None, [], []), scope(some(U(4)), None, {}, None, [], []), scope(some(U(4)), Some('l), {}, Some({(* f) . iter, (* f) . predicate}), [], [])], point_flow_state({pending_outlives(!lt_1, ?lt_2), pending_outlives(!lt_1, ?lt_3), pending_outlives(?lt_2, !lt_1), pending_outlives(?lt_2, ?lt_4)}, {loan(?lt_2, *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32, mut), loan(?lt_3, *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . predicate[Filter , struct] : u32, mut)}, {}), {labeled_flow_state('l, point_flow_state({pending_outlives(!lt_1, ?lt_2), pending_outlives(!lt_1, ?lt_3), pending_outlives(?lt_2, !lt_1), pending_outlives(?lt_2, ?lt_4)}, {loan(?lt_2, *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32, mut)}, {}))}, {}, {pending_outlives(!lt_1, ?lt_2), pending_outlives(!lt_1, ?lt_3), pending_outlives(?lt_2, !lt_1), pending_outlives(?lt_2, ?lt_4)})
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 = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
&access.place = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
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, ?lt_4}
&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 `*(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct]`
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `f`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
place_loaned_ref = f : &!lt_1 mut Filter
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 = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
&access.place = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
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, ?lt_4}
&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 `*(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct]`
the rule "write-indirect" at (nll.rs) failed because
pattern `TypedPlaceExpressionData::Deref(place_loaned_ref)` did not match value `f`
the rule "write-indirect" at (nll.rs) failed because
condition evaluated to false: `place_accessed.is_prefix_of(place_loaned_ref)`
place_accessed = *(f : &!lt_1 mut Filter) : <&!lt_1 mut Filter as Derefable>::Target . iter[Filter , struct] : u32
place_loaned_ref = f : &!lt_1 mut Filter"#]]);
// [polonius]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
ISSUE_92985_FILTER_NEXT,
))
.skip_execute()
.ok();
// [legacy]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
ISSUE_92985_FILTER_NEXT,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4618
#[test]
fn flow_sensitive_invariance_use_it() {
// [nll]: rustc errors
FormalityTest::new(feature_gate_program(
NLL_GATE,
FLOW_SENSITIVE_INVARIANCE_USE_IT,
))
.skip_execute()
.err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:8:1: no applicable rules for prove_via { goal: !lt_1 : !lt_2, via: @ wf(?lt_0), assumptions: {@ wf(?lt_0)}, env: Env { variables: [!lt_1, !lt_2, ?lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_outlives.rs:8:1: no applicable rules for prove_outlives { a: !lt_1, b: !lt_2, assumptions: {@ wf(?lt_0)}, env: Env { variables: [!lt_1, !lt_2, ?lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
// [polonius]: rustc errors
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
FLOW_SENSITIVE_INVARIANCE_USE_IT,
))
.skip_execute()
.err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:8:1: no applicable rules for prove_via { goal: !lt_1 : !lt_2, via: @ wf(?lt_0), assumptions: {@ wf(?lt_0)}, env: Env { variables: [!lt_1, !lt_2, ?lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_outlives.rs:8:1: no applicable rules for prove_outlives { a: !lt_1, b: !lt_2, assumptions: {@ wf(?lt_0)}, env: Env { variables: [!lt_1, !lt_2, ?lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
// [legacy]: rustc passes
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
FLOW_SENSITIVE_INVARIANCE_USE_IT,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4711
#[test]
fn flow_sensitive_invariance_same_region() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(
NLL_GATE,
FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4719
#[test]
fn flow_sensitive_invariance_same_region() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(
NLL_GATE,
FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
))
.skip_execute()
.ok();
}
Source location: tests/borrowck.rs:4727
#[test]
fn flow_sensitive_invariance_same_region() {
// [nll]: rustc passes.
FormalityTest::new(feature_gate_program(
NLL_GATE,
FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
))
.skip_execute()
.ok();
// [polonius]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_ALPHA_GATE,
FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
))
.skip_execute()
.ok();
// [legacy]: rustc passes.
FormalityTest::new(feature_gate_program(
POLONIUS_UNLOCKED_GATE,
FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
))
.skip_execute()
.ok();
}
Source location: tests/codegen.rs:11
fn main() -> () {
println!(22_i32);
}
Source location: tests/codegen.rs:24
fn main() -> () {
println!(1_i32);
println!(true);
println!(false);
}
Source location: tests/codegen.rs:36
fn main() -> () {
let x: i32 = 42_i32;
println!(x);
}
Source location: tests/codegen.rs:49
fn main() -> () {
let x: i32 = 1_i32;
x = 2 _ i32;
println!(x);
}
Source location: tests/codegen.rs:64
fn main() -> () {
let y: i32 = add_one(1_i32);
println!(y);
}
Source location: tests/codegen.rs:79
fn main() -> () {
let y: i32 = identity::<i32>(42_i32);
println!(y);
}
Source location: tests/codegen.rs:95
fn main() -> () {
let x: i32 = 1_i32;
if true {
println!(x);
} else {
println!(0_i32);
}
}
Source location: tests/codegen.rs:110
fn main() -> () {
let x: i32 = 0_i32;
'a: loop {
println!(x);
break 'a;
}
}
Source location: tests/codegen.rs:127
fn main() -> () {
{
let x: i32 = 99_i32;
println!(x);
}
exists<'a> {
println!(1_i32);
}
}
Source location: tests/codegen.rs:141
fn main() -> () {
let p: Pair = Pair { x: 10_i32, y: 20_i32 };
println!(p.x);
println!(p.y);
}
Source location: tests/codegen.rs:171
fn main() -> () {
let a: usize = 100_usize;
let b: isize = 200_isize;
println!(a);
println!(b);
}
Source location: tests/codegen.rs:188
fn main() -> () {
let a: i32 = f(1_i32);
let b: i32 = f(2_i32);
let c: i32 = f(3_i32);
println!(a);
println!(b);
println!(c);
}
Source location: tests/codegen.rs:201
fn main() -> () {
let y: i32 = f(f(42_i32));
println!(y);
}
Source location: tests/codegen.rs:218
fn main() -> () {
let r: i32 = outer(7_i32);
println!(r);
}
Source location: tests/codegen.rs:238
fn main() -> () {
a();
}
Source location: tests/codegen.rs:251
fn main() -> () {
let r: i32 = first::<i32, bool>(10_i32, true);
println!(r);
}
Source location: tests/codegen.rs:264
fn main() -> () {
let w: Wrapper<i32> = Wrapper::<i32> { val: 42_i32 };
println!(w.val);
}
Source location: tests/codegen.rs:318
fn main() -> () {
let x: i32 = 0_i32;
'a: loop {
if true {
println!(x);
break 'a;
} else {
continue 'a;
}
}
}
Source location: tests/codegen.rs:336
fn main() -> () {
'outer: loop {
println!(1_i32);
'inner: loop {
println!(2_i32);
break 'outer;
}
}
println!(3_i32);
}
Source location: tests/codegen.rs:356
fn main() -> () {
'a: loop {
if true {
println!(1_i32);
break 'a;
} else {
println!(2_i32);
break 'a;
}
}
println!(3_i32);
}
Source location: tests/codegen.rs:377
fn main() -> () {
let x: i32 = 0_i32;
'a: loop {
if false {
x = 1_i32;
break 'a;
} else {
x = 2_i32;
break 'a;
}
}
println!(x);
}
Source location: tests/codegen.rs:443
fn main() -> () {
let x: i32 = 0_i32;
'a: loop {
x = 77_i32;
break 'a;
}
println!(x);
}
Source location: tests/codegen.rs:461
fn main() -> () {
let x: i32 = 0_i32;
'a: loop {
{
x = 88_i32;
break 'a;
}
}
println!(x);
}
Source location: tests/codegen.rs:477
fn main() -> () {
'a: {
println!(1_i32);
break 'a;
println!(2_i32);
}
println!(3_i32);
}
Source location: tests/coherence_orphan.rs:84
#[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:98
#[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:196
#[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:147
#[test]
fn neg_CoreTrait_for_CoreStruct_implies_no_overlap() {
FormalityTest::new(crates![crate core {
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:206
#[test]
fn u32_T_where_T_Not_impls() {
FormalityTest::new(crates![crate core {
trait Foo {}
impl Foo for u32 {}
impl<T> Foo for T where T: Not {}
trait Not {}
}])
.skip_execute()
.ok()
}
Source location: tests/coherence_overlap.rs:229
#[test]
fn u32_i32_impls() {
FormalityTest::new(crates![crate core {
trait Foo {}
impl Foo for u32 {}
impl Foo for i32 {}
}])
.skip_execute()
.ok()
}
Source location: tests/coherence_overlap.rs:307
#[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/const_generics_rv_tsv_parse.rs:11
#[test]
fn parse_minirust_22() {
FormalityTest::new(crates![crate Foo {
trait Trait<const N> where type_of_const N is usize {}
impl Trait<usize(22)> for u32 {}
}])
.skip_execute()
.ok()
}
Source location: tests/consts.rs:11
#[test]
fn nonsense_rigid_const_bound() {
FormalityTest::new(crates![crate Foo {
// This where-clause is not *provable*, but it is well-formed.
trait Foo where type_of_const true is u32 {}
}])
.skip_execute()
.ok()
}
Source location: tests/consts.rs:23
#[test]
fn ok() {
FormalityTest::new(crates![crate Foo {
trait Foo<const C> where type_of_const C is bool {}
trait Bar<const C> where type_of_const C is u32 {}
impl<const C> Foo<C> for u32 where type_of_const C is bool {}
}])
.skip_execute()
.ok()
}
Source location: tests/consts.rs:49
#[test]
fn holds() {
FormalityTest::new(crates![crate Foo {
trait Foo<const C> where type_of_const C is bool {}
impl Foo<true> for u32 {}
}])
.skip_execute()
.ok()
}
Source location: tests/consts.rs:58
#[test]
fn rigid_const_bound() {
FormalityTest::new(crates![crate Foo {
trait Foo where type_of_const true is bool {}
}])
.skip_execute()
.ok()
}
Source location: tests/consts.rs:92
#[test]
fn generic_match() {
FormalityTest::new(crates![crate Foo {
trait Foo<const C> where type_of_const C is bool {}
// Here, the impl matches the trait bound.
impl<const C> Foo<C> for u32 where type_of_const C is bool {}
}])
.skip_execute()
.ok()
}
Source location: tests/consts.rs:101
#[test]
fn multiple_type_of_const() {
FormalityTest::new(crates![crate Foo {
trait Foo<const C> where type_of_const C is bool, type_of_const C is u32 {}
}])
.skip_execute()
.ok()
}
Source location: tests/decl_safety.rs:12
#[test]
fn unsafe_trait() {
FormalityTest::new(crates![crate baguette {
unsafe trait Foo {}
unsafe impl Foo for u32 {}
}])
.skip_execute()
.ok()
}
Source location: tests/decl_safety.rs:22
#[test]
fn safe_trait() {
FormalityTest::new(crates![crate baguette {
safe trait Foo {}
safe impl Foo for u32 {}
}])
.skip_execute()
.ok()
}
Source location: tests/decl_safety.rs:32
#[test]
fn unsafe_trait_negative_impl() {
FormalityTest::new(crates![crate baguette {
unsafe trait Foo {}
impl !Foo for u32 {}
}])
.skip_execute()
.ok()
}
Source location: tests/drop.rs:20
#[test]
fn drop_impl_simple_struct() {
FormalityTest::new(crates![
crate Foo {
struct MyStruct {
value: u32,
}
impl Drop for MyStruct {}
}
])
.skip_execute()
.ok()
}
Source location: tests/drop.rs:38
#[test]
fn drop_impl_generic_struct() {
FormalityTest::new(crates![
crate Foo {
trait Clone {}
struct MyStruct<T> where T: Clone {
value: T,
}
impl<T> Drop for MyStruct<T> where T: Clone {}
}
])
.skip_execute()
.ok()
}
Source location: tests/drop.rs:54
#[test]
fn drop_impl_generic_no_where_clauses() {
FormalityTest::new(crates![
crate Foo {
struct Wrapper<T> {
value: T,
}
impl<T> Drop for Wrapper<T> {}
}
])
.skip_execute()
.ok()
}
Source location: tests/drop.rs:78
#[test]
fn drop_impl_subset_where_clauses() {
FormalityTest::new(crates![
crate Foo {
trait Clone {}
trait Debug {}
struct MyStruct<T> where T: Clone, T: Debug {
value: T,
}
// Impl has no where-clauses — but the struct requires them.
impl<T> Drop for MyStruct<T> {}
}
])
.skip_execute()
.ok()
}
Source location: tests/drop.rs:94
#[test]
fn drop_impl_enum() {
FormalityTest::new(crates![
crate Foo {
enum MyEnum {
Variant{},
}
impl Drop for MyEnum {}
}
])
.skip_execute()
.ok()
}
Source location: tests/drop.rs:111
#[test]
fn drop_impl_cross_crate_local() {
FormalityTest::new(crates![
crate a {
struct MyStruct {
value: u32,
}
impl Drop for MyStruct {}
},
crate b {}
])
.skip_execute()
.ok()
}
Source location: tests/field_projections.rs:17
fn test(ptr: Ptr) -> () {
let x: () = *ptr;
}
Source location: tests/functions.rs:24
Source location: tests/functions.rs:37
Source location: tests/mir_typeck.rs:13
fn foo (v1: u32) -> u32 {
return v1;
}
Source location: tests/mir_typeck.rs:35
fn foo () -> u8 {
let v1: u16 = 5_u16;
let v2: u32 = 5_u32;
let v3: u64 = 5_u64;
let v4: usize = 5_usize;
let v5: i8 = 5_i8;
let v6: i16 = 5_i16;
let v7: i32 = 5_i32;
let v8: i64 = 5_i64;
let v9: isize = 5_isize;
let v10: bool = false;
return 5_u8;
}
Source location: tests/mir_typeck.rs:89
fn foo (v1: u32) -> u32 {
return v1;
}
Source location: tests/mir_typeck.rs:105
fn foo() -> u32 {
let v0: u32 = 0_u32;
loop {
v0 = v0;
}
}
Source location: tests/mir_typeck.rs:117
fn foo () -> bool {
return true;
}
Source location: tests/mir_typeck.rs:133
fn foo (b: bool) -> u32 {
if b {
return 1_u32;
} else {
return 2_u32;
}
}
Source location: tests/mir_typeck.rs:171
fn bar(v1: u32) -> u32 {
let v0: u32 = foo(v1);
return v0;
}
Source location: tests/mir_typeck.rs:191
fn foo (v1: u32) -> u32 {
return v1;
}
Source location: tests/mir_typeck.rs:234
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:250
fn foo() -> () {
let s1: S1<u8>;
}
Source location: tests/mir_typeck.rs:345
fn bar(v1: u32) -> u32 {
let v0: u32 = identity::<u32>(v1);
return v0;
}
Source location: tests/mir_typeck.rs:670
fn foo() -> bool {
let v1: bool = false;
return v1;
}
Source location: tests/mir_typeck.rs:693
fn foo<'a>(v1: &'a u32) -> &'a u32 {
exists<'r0> {
let v2: &'r0 u32 = v1;
return v2;
}
}
Source location: tests/mir_typeck.rs:710
fn foo () -> u32 {
exists<'a> {
let v0: u32 = 0_u32;
let v1: &'a u32 = &'a v0;
let v2: u32 = *v1;
return v2;
}
}
Source location: tests/mir_typeck.rs:729
fn foo<'a, T>(v1: &'a T) -> T
where
T: Copy,
T: 'a,
{
exists<'r0> {
let v2: T = *v1;
return v2;
}
}
Source location: tests/mir_typeck.rs:755
fn foo() -> u32 {
'a: loop {
break 'a;
}
return 0_u32;
}
Source location: tests/mir_typeck.rs:802
fn foo() -> u32 {
'a: loop {
continue 'a;
}
return 0_u32;
}
Source location: tests/mir_typeck.rs:857
fn foo<'a>(v1: &'a Pair) -> u32 {
exists<'r0> {
let v2: u32 = (*v1).value;
return v2;
}
}
Source location: tests/mir_typeck.rs:882
fn foo() -> u32 {
'a: {
break 'a;
}
return 0_u32;
}
Source location: tests/references.rs:36
Source location: tests/return_validation.rs:31
fn foo() -> () {
}
Source location: tests/return_validation.rs:48
fn foo(b: bool) -> u32 {
if b {
return 1_u32;
} else {
return 2_u32;
}
}
Source location: tests/return_validation.rs:79
fn foo() -> u32 {
loop {
}
}
Source location: tests/return_validation.rs:111
fn foo() -> u32 {
'a: loop {
break 'a;
}
return 0_u32;
}
Source location: tests/return_validation.rs:124
fn foo() -> u32 {
return 42_u32;
}
Source location: tests/traits.rs:13
Source location: tests/traits.rs:26
#[test]
fn trait_with_valid_associated_type() {
FormalityTest::new(crates![
crate core {
trait A {
type Assoc : [];
}
}
])
.skip_execute()
.ok();
}
Source location: tests/well_formed_struct.rs:17
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
#[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
#[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
#[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
#[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()
}