about summary refs log tree commit diff
path: root/tests/ui/macros/assert-macro-lifetimes.rs
blob: cc25928320477db499172f680ac5fccf45c4918d (plain)
1
2
3
4
5
6
7
8
//@ check-pass
#[derive(PartialEq, Eq, Hash)]
struct S;
fn main() {
    let foo = std::rc::Rc::new(std::cell::RefCell::new(std::collections::HashMap::<S, S>::new()));
    // Ensure that the lifetimes of the borrow do not leak past the end of `main`.
    assert!(matches!(foo.borrow().get(&S).unwrap(), S))
}