diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-9259.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-9259.rs b/src/test/ui/issues/issue-9259.rs new file mode 100644 index 000000000..d838edbdd --- /dev/null +++ b/src/test/ui/issues/issue-9259.rs @@ -0,0 +1,16 @@ +// run-pass +#![allow(dead_code)] + +struct A<'a> { + a: &'a [String], + b: Option<&'a [String]>, +} + +pub fn main() { + let b: &[String] = &["foo".to_string()]; + let a = A { + a: &["test".to_string()], + b: Some(b), + }; + assert_eq!(a.b.as_ref().unwrap()[0], "foo"); +} |