diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-05-13 14:07:56 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-05-27 15:58:35 +1000 |
| commit | dbdc7dd0dcb7e7525fec145787d715d31d651a4b (patch) | |
| tree | 9766a1f882c1ca0371ccba2683ed73be9949212e | |
| parent | 1a9514d5ce6d1a9fc2474bde8907493671012911 (diff) | |
| download | rust-dbdc7dd0dcb7e7525fec145787d715d31d651a4b.tar.gz rust-dbdc7dd0dcb7e7525fec145787d715d31d651a4b.zip | |
Rename `ProcMacro` trait as `BangProcMacro`.
Similar to the existing `AttrProcMacro` trait.
| -rw-r--r-- | compiler/rustc_expand/src/base.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_expand/src/proc_macro.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs index e48ce602185..bb671b8705e 100644 --- a/compiler/rustc_expand/src/base.rs +++ b/compiler/rustc_expand/src/base.rs @@ -266,7 +266,7 @@ where } } -pub trait ProcMacro { +pub trait BangProcMacro { fn expand<'cx>( &self, ecx: &'cx mut ExtCtxt<'_>, @@ -275,7 +275,7 @@ pub trait ProcMacro { ) -> Result<TokenStream, ErrorGuaranteed>; } -impl<F> ProcMacro for F +impl<F> BangProcMacro for F where F: Fn(TokenStream) -> TokenStream, { @@ -640,7 +640,7 @@ pub enum SyntaxExtensionKind { /// A token-based function-like macro. Bang( /// An expander with signature TokenStream -> TokenStream. - Box<dyn ProcMacro + sync::Sync + sync::Send>, + Box<dyn BangProcMacro + sync::Sync + sync::Send>, ), /// An AST-based function-like macro. diff --git a/compiler/rustc_expand/src/proc_macro.rs b/compiler/rustc_expand/src/proc_macro.rs index b3679b31c6c..115f3ef3838 100644 --- a/compiler/rustc_expand/src/proc_macro.rs +++ b/compiler/rustc_expand/src/proc_macro.rs @@ -17,7 +17,7 @@ pub struct BangProcMacro { pub client: pm::bridge::client::Client<fn(pm::TokenStream) -> pm::TokenStream>, } -impl base::ProcMacro for BangProcMacro { +impl base::BangProcMacro for BangProcMacro { fn expand<'cx>( &self, ecx: &'cx mut ExtCtxt<'_>, |
