Skip to content

Commit 8ab4803

Browse files
committed
ensure that the proc_macro crate exists in the sysroot
1 parent 4062fe2 commit 8ab4803

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
// This is a proc-macro crate.
2+
3+
extern crate proc_macro; // make sure proc_macro is in the sysroot
4+
15
#[cfg(doctest)]
26
compile_error!("rustdoc should not touch me");
37

4-
#[cfg(test)]
8+
#[cfg(miri)]
59
compile_error!("Miri should not touch me");
10+
11+
use proc_macro::TokenStream;
12+
13+
#[proc_macro]
14+
pub fn make_answer(_item: TokenStream) -> TokenStream {
15+
"fn answer() -> u32 { 42 }".parse().unwrap()
16+
}

src/tools/miri/tests/pass/sysroot.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//! Just check that some things are available in the sysroot.
2+
#![feature(test)]
3+
#![allow(unused)]
4+
5+
extern crate proc_macro;
6+
extern crate std;
7+
extern crate test;
8+
9+
fn main() {}

0 commit comments

Comments
 (0)