]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/issue-17718-constants-not-static.rs
Rollup merge of #106717 - klensy:typo, r=lcnr
[rust.git] / tests / ui / consts / issue-17718-constants-not-static.rs
1 fn id<T>(x: T) -> T { x }
2
3 const FOO: usize = 3;
4
5 fn foo() -> &'static usize { &id(FOO) }
6 //~^ ERROR: cannot return reference to temporary value
7
8 fn main() {
9 }