]> git.lizzy.rs Git - rust.git/blob - src/test/ui-fulldeps/auxiliary/outlive-expansion-phase.rs
Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into sync_cg_clif-2022-10-23
[rust.git] / src / test / 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 }