]> git.proxmox.com Git - rustc.git/blame - src/test/ui-fulldeps/auxiliary/outlive-expansion-phase.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui-fulldeps / auxiliary / outlive-expansion-phase.rs
CommitLineData
1a4d82fc
JJ
1// force-host
2
c34b1796 3#![feature(box_syntax, rustc_private)]
1a4d82fc 4
ba9703b0 5extern crate rustc_middle;
416331ca 6extern crate rustc_driver;
1a4d82fc
JJ
7
8use std::any::Any;
9use std::cell::RefCell;
e1599b0c 10use rustc_driver::plugin::Registry;
1a4d82fc
JJ
11
12struct Foo {
c34b1796 13 foo: isize
1a4d82fc
JJ
14}
15
16impl Drop for Foo {
17 fn drop(&mut self) {}
18}
19
94222f64
XL
20#[no_mangle]
21fn __rustc_plugin_registrar(_: &mut Registry) {
1a4d82fc
JJ
22 thread_local!(static FOO: RefCell<Option<Box<Any+Send>>> = RefCell::new(None));
23 FOO.with(|s| *s.borrow_mut() = Some(box Foo { foo: 10 } as Box<Any+Send>));
24}