diff options
Diffstat (limited to 'src/test/ui/static/static-region-bound.rs')
-rw-r--r-- | src/test/ui/static/static-region-bound.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/static/static-region-bound.rs b/src/test/ui/static/static-region-bound.rs new file mode 100644 index 000000000..d70706e57 --- /dev/null +++ b/src/test/ui/static/static-region-bound.rs @@ -0,0 +1,12 @@ +fn id<T>(x: T) -> T { x } + +fn f<T:'static>(_: T) {} + +fn main() { + + let x: Box<_> = Box::new(3); + f(x); + + let x = &id(3); //~ ERROR temporary value dropped while borrowed + f(x); +} |