]> git.lizzy.rs Git - rust.git/blob - tests/ui-fulldeps/auxiliary/outlive-expansion-phase.rs
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb
[rust.git] / tests / ui-fulldeps / auxiliary / outlive-expansion-phase.rs
1 // force-host
2
3 #![feature(rustc_private)]
4
5 extern crate rustc_middle;
6 extern crate rustc_driver;
7
8 use std::any::Any;
9 use std::cell::RefCell;
10 use rustc_driver::plugin::Registry;
11
12 struct Foo {
13     foo: isize
14 }
15
16 impl Drop for Foo {
17     fn drop(&mut self) {}
18 }
19
20 #[no_mangle]
21 fn __rustc_plugin_registrar(_: &mut Registry) {
22     thread_local!(static FOO: RefCell<Option<Box<Any+Send>>> = RefCell::new(None));
23     FOO.with(|s| *s.borrow_mut() = Some(Box::new(Foo { foo: 10 }) as Box<Any+Send>));
24 }