about summary refs log tree commit diff
path: root/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs
blob: 25c530d43919efe72ccbdeee1aa379f6569b5b3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//@ revisions: edition2021 edition2024
//@ [edition2024] edition: 2024
//@ [edition2024] run-pass

fn f() -> usize {
    let c = std::cell::RefCell::new("..");
    c.borrow().len() //[edition2021]~ ERROR: `c` does not live long enough
}

fn main() {
    let _ = f();
}