mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-11 22:43:42 +00:00
Fix using include_bytes
in pattern position
This commit is contained in:
parent
96ddd32c4b
commit
47eda6b7db
@ -507,7 +507,7 @@ impl MacResult for MacEager {
|
||||
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,
|
||||
|
@ -123,4 +123,10 @@ expand_expr_fail!(echo_pm!(arbitrary_expression() + "etc"));
|
||||
|
||||
const _: u32 = recursive_expand!(); //~ ERROR: recursion limit reached while expanding `recursive_expand!`
|
||||
|
||||
fn main() {}
|
||||
fn main() {
|
||||
// https://github.com/rust-lang/rust/issues/104414
|
||||
match b"a" {
|
||||
include_bytes!("auxiliary/included-file.txt") => (),
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user