mv compiler to compiler/
This commit is contained in:
parent
db534b3ac2
commit
9e5f7d5631
1686 changed files with 941 additions and 1051 deletions
20
compiler/rustc_builtin_macros/src/compile_error.rs
Normal file
20
compiler/rustc_builtin_macros/src/compile_error.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
// The compiler code necessary to support the compile_error! extension.
|
||||
|
||||
use rustc_ast::tokenstream::TokenStream;
|
||||
use rustc_expand::base::{self, *};
|
||||
use rustc_span::Span;
|
||||
|
||||
pub fn expand_compile_error<'cx>(
|
||||
cx: &'cx mut ExtCtxt<'_>,
|
||||
sp: Span,
|
||||
tts: TokenStream,
|
||||
) -> Box<dyn base::MacResult + 'cx> {
|
||||
let var = match get_single_str_from_tts(cx, sp, tts, "compile_error!") {
|
||||
None => return DummyResult::any(sp),
|
||||
Some(v) => v,
|
||||
};
|
||||
|
||||
cx.span_err(sp, &var);
|
||||
|
||||
DummyResult::any(sp)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue