2024-02-16 20:02:50 +00:00
|
|
|
//@ run-pass
|
2014-01-17 08:03:43 -05:00
|
|
|
// Test lifetimes are linked properly when we take reference
|
|
|
|
|
// to interior.
|
|
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
struct Foo(isize);
|
2014-01-17 08:03:43 -05:00
|
|
|
pub fn main() {
|
|
|
|
|
// Here the lifetime of the `&` should be at least the
|
|
|
|
|
// block, since a ref binding is created to the interior.
|
|
|
|
|
let &Foo(ref _x) = &Foo(3);
|
|
|
|
|
}
|