rust/tests/ui/consts/issue-17718-constants-not-static.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
160 B
Rust
Raw Normal View History

2017-08-13 03:46:49 -05:00
fn id<T>(x: T) -> T { x }
const FOO: usize = 3;
2017-08-13 03:46:49 -05:00
fn foo() -> &'static usize { &id(FOO) }
//~^ ERROR: cannot return reference to temporary value
fn main() {
}