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