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 main

Source location: tests/mir_typeck.rs:1489

fn main() -> () { outer::<'static, 'static>(); }
}])
tc_ok()
);
}

#[test]
fn_value_with_unsatisfied_lifetime_bound() {
alityTest::new(crates![crate Foo {
fn require<'a, 'b>() -> () where 'a: 'b {}
fn outer<'a, 'b>() -> () { require::<'a, 'b>; }
fn main() -> () {}
}])
tc_err(expect_test::expect![[r#"
error: lifetime may not live long enough
 --> lib.rs
  |
7 | pub fn outer<'a00, 'a01>() -> () {
  |              ----  ---- lifetime `'a01` defined here
  |              |
  |              lifetime `'a00` defined here
8 |     require::<'a00, 'a01>;
  |     ^^^^^^^^^^^^^^^^^^^^^ requires that `'a00` must outlive `'a01`
  |
  = help: consider adding the following bound: `'a00: 'a01`

error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect!["crates/formality-rust/src/prove/prove_outlives.rs:8:1: no applicable rules for prove_outlives { a: !lt_0, b: !lt_1, assumptions: {}, env: Env { variables: [!lt_0, !lt_1], bias: Soundness, pending: [], allow_pending_outlives: false } }"]);
}

ound assignment of an integer of a different type should fail.
#[test]
compound_add_mismatched_int_types() {
alityTest::new(crates![crate Foo {
fn foo() -> () {
    let x: u32 = 1_u32;
    x += 2_u8;
}

Rules proved (49)

JudgmentRuleAll tests of this rule
borrow_checkborrow_check175 tests
borrow_check_blockbasic block175 tests
borrow_check_exprcall41 tests
borrow_check_exprturbofish30 tests
borrow_check_fn_reffn-ref43 tests
borrow_check_statementexpr47 tests
check_all_cratescheck all prefixes214 tests
check_associated_tycheck associated ty195 tests
check_associated_ty_valuecheck_associated_ty_value194 tests
check_coherencecheck_coherence214 tests
check_cratecheck crate214 tests
check_crate_itemfree fn175 tests
check_crate_itemtrait214 tests
check_crate_itemtrait impl210 tests
check_drop_impl_always_applicablenot a Drop impl210 tests
check_fncheck fn200 tests
check_fn_bodyexpr fn body175 tests
check_fn_bodyno fn body192 tests
check_fn_in_traitcheck fn in trait193 tests
check_free_fncheck free fn175 tests
check_safety_matchessafety matches210 tests
check_traitcheck trait214 tests
check_trait_implcheck_trait_impl210 tests
check_trait_impl_itemassociated ty value194 tests
check_trait_itemassociated ty in trait195 tests
check_trait_itemfn in trait193 tests
drop_placesdrop_places175 tests
is_local_trait_reflocal trait205 tests
orphan_checkorphan_check210 tests
overlap_check_impldifferent trait194 tests
overlap_check_implnot goal195 tests
overlap_check_implsame impl210 tests
prove_afterprove_after237 tests
prove_eqexistential223 tests
prove_eqrigid201 tests
prove_eqsymmetric220 tests
prove_existential_var_eqexistential-universal214 tests
prove_outlivesoutlive through assumption195 tests
prove_predicateeq231 tests
prove_predicateoutlives195 tests
prove_predicateparameter well formed204 tests
prove_predicatepositive impl219 tests
prove_predicatetrait ref is local211 tests
prove_predicate_listnone238 tests
prove_predicate_listsome237 tests
prove_ty_is_rigidrigid76 tests
prove_wfreferences192 tests
prove_wftuples200 tests
prove_wfuniversal variables206 tests

Premises failed (0)

This test records no negative coverage.

Proof trees

Proof tree
… (200 of 3446 nodes shown)

How to read this page