]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-9259.rs
Rollup merge of #105796 - notriddle:notriddle/rustdoc-search-stop-doing-demerits...
[rust.git] / tests / ui / issues / issue-9259.rs
1 // run-pass
2 #![allow(dead_code)]
3
4 struct A<'a> {
5     a: &'a [String],
6     b: Option<&'a [String]>,
7 }
8
9 pub fn main() {
10     let b: &[String] = &["foo".to_string()];
11     let a = A {
12         a: &["test".to_string()],
13         b: Some(b),
14     };
15     assert_eq!(a.b.as_ref().unwrap()[0], "foo");
16 }