X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_expand%2Fsrc%2Fbase.rs;h=8955abebf1e0f0d116d100e84ba1f0b1e9c12e3d;hb=2c5d3705ecb7ff07f5f47e736489d3abf3b64aa7;hp=04fe6c4007e948fd106f14fb95947ae1003e3090;hpb=0858ca97da2da8b8a7fbfc422e59bd87731b5060;p=rust.git diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs index 04fe6c4007e..8955abebf1e 100644 --- a/compiler/rustc_expand/src/base.rs +++ b/compiler/rustc_expand/src/base.rs @@ -507,7 +507,7 @@ fn make_pat(self: Box) -> Option> { return Some(p); } if let Some(e) = self.expr { - if let ast::ExprKind::Lit(_) = e.kind { + if matches!(e.kind, ast::ExprKind::Lit(_) | ast::ExprKind::IncludedBytes(_)) { return Some(P(ast::Pat { id: ast::DUMMY_NODE_ID, span: e.span, @@ -676,8 +676,13 @@ pub enum SyntaxExtensionKind { /// A token-based derive macro. Derive( - /// An expander with signature TokenStream -> TokenStream (not yet). + /// An expander with signature TokenStream -> TokenStream. /// The produced TokenSteam is appended to the input TokenSteam. + /// + /// FIXME: The text above describes how this should work. Currently it + /// is handled identically to `LegacyDerive`. It should be migrated to + /// a token-based representation like `Bang` and `Attr`, instead of + /// using `MultiItemModifier`. Box, ),