mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
Rollup merge of #104416 - clubby789:fix-104414, r=eholk
Fix using `include_bytes` in pattern position Fix #104414
This commit is contained in:
commit
7a3eca690f
@ -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"Included file contents\n" {
|
||||
include_bytes!("auxiliary/included-file.txt") => (),
|
||||
_ => panic!("include_bytes! in pattern"),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user