Skip to content

Unconditionally breaking loops not allowed in constants. #62272

Closed
@eddyb

Description

@eddyb

Technically a regression from 1.24 to 1.25, but I don't think anyone used this.
Example code which used to be allowed:

pub const FOO: () = loop { break; };

I'm pretty sure this changed with #47802, which added the FalseUnwind terminator to MIR, but didn't handle it in const-checking (which otherwise ignores cleanup blocks).

cc @matthewjasper @nikomatsakis

Metadata

Metadata

Assignees

Labels

A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions