Skip to content

ICE: "encountered errors lowering pattern: [ConstEval(ConstEvalErr { ... kind: NonConstPath })]" #43250

Closed
@est31

Description

@est31

Following (wrong) code gives an error on beta 1.19 and stable 1.18, but ICEs on current nightly:

fn main() {
	let mut y;
	macro_rules! m {
		($a:expr) => {
			let $a = 0;
		}
	}
	m!(y);
}

The error (expected behaviour):

error: expected pattern, found `y`

The ICE message (new behaviour):

internal compiler error: /checkout/src/librustc_const_eval/pattern.rs:282: encountered errors lowering pattern: [ConstEval(ConstEvalErr { span: src/main.rs:8:5: 8:6, kind: NonConstPath })]

Nightly (soon beta) regression. Bisected using rust-bisect to #42964 (7acce37).

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions