diff options
Diffstat (limited to 'tests/ui/lifetimes/struct-lifetime-field-assignment-13405.rs')
| -rw-r--r-- | tests/ui/lifetimes/struct-lifetime-field-assignment-13405.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/lifetimes/struct-lifetime-field-assignment-13405.rs b/tests/ui/lifetimes/struct-lifetime-field-assignment-13405.rs new file mode 100644 index 00000000000..9482d89681b --- /dev/null +++ b/tests/ui/lifetimes/struct-lifetime-field-assignment-13405.rs @@ -0,0 +1,21 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13405 + +//@ check-pass +#![allow(dead_code)] +#![allow(unused_variables)] + +struct Foo<'a> { + i: &'a bool, + j: Option<&'a isize>, +} + +impl<'a> Foo<'a> { + fn bar(&mut self, j: &isize) { + let child = Foo { + i: self.i, + j: Some(j) + }; + } +} + +fn main() {} |
