diff options
| author | bors <bors@rust-lang.org> | 2019-07-28 01:03:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-07-28 01:03:16 +0000 |
| commit | 9a239ef4ded03d155c72b68b5a2dd7aff013e141 (patch) | |
| tree | ddecacf7cf04b32211999b7d65dae0bbf2012102 /src/libsyntax_ext/proc_macro_impl.rs | |
| parent | c798dffac9dc8c82374db48f5b474690cc6e9686 (diff) | |
| parent | 34c0f4698bda7e06d66ee9040a2923250b0c12d0 (diff) | |
| download | rust-9a239ef4ded03d155c72b68b5a2dd7aff013e141.tar.gz rust-9a239ef4ded03d155c72b68b5a2dd7aff013e141.zip | |
Auto merge of #63057 - Centril:rollup-z3a3c6v, r=Centril
Rollup of 8 pull requests Successful merges: - #61207 (Allow lifetime elision in `Pin<&(mut) Self>`) - #62074 (squash of all commits for nth_back on ChunksMut) - #62771 (Break dependencies between `syntax_ext` and other crates) - #62883 (Refactoring use common code between option, result and accum) - #62949 (Re-enable assertions in PPC dist builder) - #62996 (tidy: Add a check for inline unit tests) - #63038 (Make more informative error on outer attribute after inner) - #63050 (ci: download awscli from our mirror) Failed merges: r? @ghost
Diffstat (limited to 'src/libsyntax_ext/proc_macro_impl.rs')
| -rw-r--r-- | src/libsyntax_ext/proc_macro_impl.rs | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/libsyntax_ext/proc_macro_impl.rs b/src/libsyntax_ext/proc_macro_impl.rs deleted file mode 100644 index f0fc6392cd7..00000000000 --- a/src/libsyntax_ext/proc_macro_impl.rs +++ /dev/null @@ -1,68 +0,0 @@ -use crate::proc_macro_server; - -use errors::FatalError; -use syntax::source_map::Span; -use syntax::ext::base::{self, *}; -use syntax::tokenstream::TokenStream; - -pub const EXEC_STRATEGY: proc_macro::bridge::server::SameThread = - proc_macro::bridge::server::SameThread; - -pub struct AttrProcMacro { - pub client: proc_macro::bridge::client::Client< - fn(proc_macro::TokenStream, proc_macro::TokenStream) -> proc_macro::TokenStream, - >, -} - -impl base::AttrProcMacro for AttrProcMacro { - fn expand<'cx>(&self, - ecx: &'cx mut ExtCtxt<'_>, - span: Span, - annotation: TokenStream, - annotated: TokenStream) - -> TokenStream { - let server = proc_macro_server::Rustc::new(ecx); - match self.client.run(&EXEC_STRATEGY, server, annotation, annotated) { - Ok(stream) => stream, - Err(e) => { - let msg = "custom attribute panicked"; - let mut err = ecx.struct_span_fatal(span, msg); - if let Some(s) = e.as_str() { - err.help(&format!("message: {}", s)); - } - - err.emit(); - FatalError.raise(); - } - } - } -} - -pub struct BangProcMacro { - pub client: proc_macro::bridge::client::Client< - fn(proc_macro::TokenStream) -> proc_macro::TokenStream, - >, -} - -impl base::ProcMacro for BangProcMacro { - fn expand<'cx>(&self, - ecx: &'cx mut ExtCtxt<'_>, - span: Span, - input: TokenStream) - -> TokenStream { - let server = proc_macro_server::Rustc::new(ecx); - match self.client.run(&EXEC_STRATEGY, server, input) { - Ok(stream) => stream, - Err(e) => { - let msg = "proc macro panicked"; - let mut err = ecx.struct_span_fatal(span, msg); - if let Some(s) = e.as_str() { - err.help(&format!("message: {}", s)); - } - - err.emit(); - FatalError.raise(); - } - } - } -} |
