Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Test drop

Source location: tests/drop.rs:192

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;
}

Rules proved (0)

This test records no positive coverage.

Premises failed (10)

The last column links to the premise’s page when the judgment view counts this failure against that premise. It does not when the premise is read as infallible, or when the failure was blamed inside a multi-line premise that carries no record on its own first line.

JudgmentRulePremiseAll tests of this premise
check_trait_implcheck_trait_implscope(enter_universally(Env::default(), binder) … (line 23, blamed at line 36)not counted by the judgment view
check_trait_impl_itemfn in implcheck_fn_in_impl(program, env, assumptions, trai… (line 163)3 tests
check_fn_in_implcheck_fn_in_implscope(enter_universally(env, &merge_binders(&ii_… (line 197, blamed at line 212)not counted by the judgment view
check_all_cratescheck all prefixesfor_all(i in 0..crates.len()) (let program = cra… (line 52, blamed at line 54)not counted by the judgment view
check_cratecheck cratefor_all(item in &c.items) (check_crate_item(prog… (line 73, blamed at line 74)not counted by the judgment view
check_crate_itemtrait implcheck_trait_impl(program, v, crate_id) => () (line 194)16 tests
prove_predicatesubtypeprove_sub(decls, env, assumptions, a, b) => c (line 121)11 tests
prove_predicate_listsomeprove_predicate(decls, env, assumptions, wc0) =>… (line 26)67 tests
prove_subnormalize-lprove_normalize(decls, env, assumptions, x) => C… (line 27)11 tests
prove_subnormalize-rprove_normalize(decls, env, assumptions, y) => C… (line 34)11 tests

Proof trees

Failed proof tree

How to read this page