Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-pattern macro in pattern position: include_bytes #104414

Closed
trinity-1686a opened this issue Nov 14, 2022 · 5 comments · Fixed by #104416
Closed

non-pattern macro in pattern position: include_bytes #104414

trinity-1686a opened this issue Nov 14, 2022 · 5 comments · Fixed by #104416
Assignees
Labels
C-bug Category: This is a bug. P-high High priority regression-untriaged Untriaged performance or correctness regression.

Comments

@trinity-1686a
Copy link
Contributor

trinity-1686a commented Nov 14, 2022

Code

I tried this code:

fn main() {
    match b"a\n" {
        include_bytes!("file.inc") => (),
        _ => panic!("no match"),
    }
}

I expected to see this happen: code compiles and execute

Instead, this happened: compilation fails with

error: non-pattern macro in pattern position: include_bytes
 --> src/main.rs:3:9
  |
4 |         include_bytes!("file.inc") => (),
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: could not compile `regression` due to previous error

Version it worked on

It most recently worked on: rustc 1.65.0 (897e37553 2022-11-02) and rustc 1.67.0-nightly (1286ee23e 2022-11-05)

Version with regression

rustc --version --verbose:

rustc 1.67.0-nightly (e631891f7 2022-11-13)
binary: rustc
commit-hash: e631891f7ad40eac3ef58ec3c2b57ecd81e40615
commit-date: 2022-11-13
host: x86_64-unknown-linux-gnu
release: 1.67.0-nightly
LLVM version: 15.0.4

Notes

used by x509-signature. I suspect #103812 (but did not confirm) might be the cause of the breakage as it is a recent change on that area.

@trinity-1686a trinity-1686a added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Nov 14, 2022
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Nov 14, 2022
@petrochenkov
Copy link
Contributor

cc @clubby789

@Rageking8
Copy link
Contributor

The code posted has a missing delimiter.

@trinity-1686a
Copy link
Contributor Author

oops, fixed

@clubby789
Copy link
Contributor

@rustbot claim

@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-high

@rustbot rustbot added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Nov 15, 2022
@bors bors closed this as completed in 7a3eca6 Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. P-high High priority regression-untriaged Untriaged performance or correctness regression.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants