summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-ret.rs
blob: 580545ef8566cfa53100753cb4d7d5a4b1553bf4 (plain)
1
2
3
4
5
6
7
8
fn id<T>(x: T) -> T { x }

fn f(_x: &isize) -> &isize {
    return &id(3); //~ ERROR cannot return reference to temporary value
}

fn main() {
}