Negative coverage: check_trait_impl_item / fn in impl / premise check_fn_in_impl(program, env, assumptions, trait_items, v, crate_id) => ()
Premise at line 163. Observed failure causes: failed_judgment.
fn in impl| Line | Coverage | Source |
|---|---|---|
| 163 | 3 | (check_fn_in_impl(program, env, assumptions, trait_items, v, crate_id) => ()) |
| ──────── ("fn in impl") | ||
| 165 | 5 | (check_trait_impl_item(program, env, assumptions, trait_items, ImplItem::Fn(v), crate_id) => ()) |
3 tests failed proving this premise:
Source location: tests/drop.rs:83 (all coverage from this test)
Failed proof tree
check_all_crates failedmod.rs:42args
rule "check all prefixes"mod.rs:54check_crate failedmod.rs:61args
rule "check crate"mod.rs:74check_crate_item failedmod.rs:179rule "trait impl"mod.rs:194check_trait_impl failedimpls.rs:14rule "check_trait_impl"impls.rs:36check_trait_impl_item failedimpls.rs:151rule "fn in impl"impls.rs:163check_fn_in_impl failedimpls.rs:176rule "check_fn_in_impl"impls.rs:194check_fn failedfns.rs:31args
rule "check fn"fns.rs:50prove failedfunction.rs:250args
rulefunction.rs:250prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "assumption"prove_predicate.rs:48prove_via failedprove_via.rs:9args
rule "parameter well formed"prove_predicate.rs:149prove_wf failedprove_wf.rs:11args
rule "ADT"prove_wf.rs:64prove_after failedprove_after.rs:8args
rule "prove_after"prove_after.rs:19prove failedprove_after.rs:19args
ruleprove_after.rs:19prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "assumption"prove_predicate.rs:48prove_via failedprove_via.rs:9args
rule "trait implied bound"prove_predicate.rs:106 (failed: empty_collection)
Source location: tests/drop.rs:192 (all coverage from this test)
fn drop<'a>(self: &'a MyStruct) -> () {}
}
}])
rr(expect_test::expect![[r#"
r[E0053]: method `drop` has an incompatible type for trait
lib.rs
|
fn drop<'a10>(mut self: &'a10 MyStruct) -> () {}
^^^^^^^^^^^^^^ types differ in mutability
|
note: expected signature `fn(&mut MyStruct)`
found signature `fn(&MyStruct)`
: change the self-receiver type to match the trait
|
fn drop<'a10>(mut self: &'a10 MyStruct) -> () {}
fn drop<'a10>(mut &mut self) -> () {}
|
more information about this error, try `rustc --explain E0053`.
r: could not compile `Foo` (lib) due to 1 previous error
"#]])
ect_test::expect![[r#"
es/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &!lt_0 mut MyStruct, assumptions: {}, env: Env { variables: [!lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
es/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &!lt_0 MyStruct, assumptions: {}, env: Env { variables: [!lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
}
ust return unit, even when its body matches another return type.
#[test]
_non_unit_return() {
yTest::new(crates![crate Foo {
ct MyStruct {}
Drop for MyStruct {
fn drop<'a>(self: &'a mut MyStruct) -> u32 {
return 0_u32;
}
Failed proof tree
check_all_crates failedmod.rs:42args
rule "check all prefixes"mod.rs:54check_crate failedmod.rs:61args
rule "check crate"mod.rs:74check_crate_item failedmod.rs:179rule "trait impl"mod.rs:194check_trait_impl failedimpls.rs:14rule "check_trait_impl"impls.rs:36check_trait_impl_item failedimpls.rs:151rule "fn in impl"impls.rs:163check_fn_in_impl failedimpls.rs:176rule "check_fn_in_impl"impls.rs:212prove failedfunction.rs:250args
rulefunction.rs:250prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "subtype"prove_predicate.rs:121prove_sub failedprove_sub.rs:12args
rule "normalize-l"prove_sub.rs:27prove_normalize failedprove_normalize.rs:22args
rule "normalize-r"prove_sub.rs:34prove_normalize failedprove_normalize.rs:22args
Source location: tests/drop.rs:228 (all coverage from this test)
fn drop<'a>(self: &'a mut MyStruct) -> u32 {
return 0_u32;
}
Failed proof tree
check_all_crates failedmod.rs:42args
rule "check all prefixes"mod.rs:54check_crate failedmod.rs:61args
rule "check crate"mod.rs:74check_crate_item failedmod.rs:179rule "trait impl"mod.rs:194check_trait_impl failedimpls.rs:14rule "check_trait_impl"impls.rs:36check_trait_impl_item failedimpls.rs:151rule "fn in impl"impls.rs:163check_fn_in_impl failedimpls.rs:176rule "check_fn_in_impl"impls.rs:215prove failedfunction.rs:250args
rulefunction.rs:250prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "subtype"prove_predicate.rs:121prove_sub failedprove_sub.rs:12args
rule "normalize-l"prove_sub.rs:27prove_normalize failedprove_normalize.rs:22args
rule "normalize-r"prove_sub.rs:34prove_normalize failedprove_normalize.rs:22args