about summary refs log tree commit diff
path: root/tests/ui/borrowck/borrowed-pointer-in-struct-5884.rs
blob: d2f17cf905d33362b425e058e867d13c54e6f178 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// https://github.com/rust-lang/rust/issues/5884
//@ build-pass
#![allow(dead_code)]

pub struct Foo {
    a: isize,
}

struct Bar<'a> {
    a: Box<Option<isize>>,
    b: &'a Foo,
}

fn check(a: Box<Foo>) {
    let _ic = Bar{ b: &*a, a: Box::new(None) };
}

pub fn main(){}