ensure that the proc_macro crate exists in the sysroot

This commit is contained in:
Ralf Jung 2023-05-05 09:23:15 +02:00
parent 4062fe2bd9
commit 8ab4803736
2 changed files with 21 additions and 1 deletions

View file

@ -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()
}

View 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() {}