File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
compiler/rustc_expand/src Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -507,7 +507,7 @@ impl MacResult for MacEager {
507507 return Some ( p) ;
508508 }
509509 if let Some ( e) = self . expr {
510- if let ast:: ExprKind :: Lit ( _) = e . kind {
510+ if matches ! ( e . kind , ast:: ExprKind :: Lit ( _) | ast :: ExprKind :: IncludedBytes ( _ ) ) {
511511 return Some ( P ( ast:: Pat {
512512 id : ast:: DUMMY_NODE_ID ,
513513 span : e. span ,
Original file line number Diff line number Diff line change @@ -123,4 +123,10 @@ expand_expr_fail!(echo_pm!(arbitrary_expression() + "etc"));
123123
124124const _: u32 = recursive_expand ! ( ) ; //~ ERROR: recursion limit reached while expanding `recursive_expand!`
125125
126- fn main ( ) { }
126+ fn main ( ) {
127+ // https://github.com/rust-lang/rust/issues/104414
128+ match b"Included file contents\n " {
129+ include_bytes ! ( "auxiliary/included-file.txt" ) => ( ) ,
130+ _ => panic ! ( "include_bytes! in pattern" ) ,
131+ }
132+ }
You can’t perform that action at this time.
0 commit comments