ensure that the proc_macro crate exists in the sysroot
This commit is contained in:
parent
4062fe2bd9
commit
8ab4803736
2 changed files with 21 additions and 1 deletions
|
|
@ -1,5 +1,16 @@
|
|||
// This is a proc-macro crate.
|
||||
|
||||
extern crate proc_macro; // make sure proc_macro is in the sysroot
|
||||
|
||||
#[cfg(doctest)]
|
||||
compile_error!("rustdoc should not touch me");
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(miri)]
|
||||
compile_error!("Miri should not touch me");
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
#[proc_macro]
|
||||
pub fn make_answer(_item: TokenStream) -> TokenStream {
|
||||
"fn answer() -> u32 { 42 }".parse().unwrap()
|
||||
}
|
||||
|
|
|
|||
9
src/tools/miri/tests/pass/sysroot.rs
Normal file
9
src/tools/miri/tests/pass/sysroot.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
//! Just check that some things are available in the sysroot.
|
||||
#![feature(test)]
|
||||
#![allow(unused)]
|
||||
|
||||
extern crate proc_macro;
|
||||
extern crate std;
|
||||
extern crate test;
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue