]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-11681.rs
Auto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini
[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; //~ ERROR borrowed value does not live long enough
13   return testValue;
14 }
15
16
17 pub fn main() {
18     createTest();
19 }