]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/issue-67641.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / consts / issue-67641.rs
CommitLineData
6a06907d 1// compile-flags: -Z mir-opt-level=3
dfeec247
XL
2// run-pass
3
4use std::cell::Cell;
5
6#[derive(Debug)]
7struct B<'a> {
8 a: [Cell<Option<&'a B<'a>>>; 2]
9}
10
11impl<'a> B<'a> {
12 fn new() -> B<'a> {
13 B { a: [Cell::new(None), Cell::new(None)] }
14 }
15}
16
17fn f() {
18 let b2 = B::new();
19 b2.a[0].set(Some(&b2));
20}
21
22fn main() {
23 f();
24}