]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-11681.rs
Enable full revision in const generics ui tests
[rust.git] / src / test / ui / issues / issue-11681.rs
1 // This tests verifies that unary structs and enum variants
2 // are treated as rvalues and their lifetime is not bounded to
3 // the static scope.
4
5 struct Test;
6
7 impl Drop for Test {
8     fn drop (&mut self) {}
9 }
10
11 fn createTest<'a>() -> &'a Test {
12   let testValue = &Test;
13   return testValue; //~ ERROR cannot return value referencing temporary value
14 }
15
16
17 pub fn main() {
18     createTest();
19 }