Open
Description
There's a difference between
const _: () = panic!();
andconst _<'a>: () = panic!();
: The former is a pre-mono error, the latter is a post-mono error.
This seems inconsistent, and pretty bad. But luckily something we can change before stabilizing generic consts :)
I think we should probably change the code introduced in #121387 to instead call requires_monomorphization
instead of is_empty
on the generics.
It should also preferably check for impossible predicates in the same way we do for -Clink-dead-code
/-Zcollect-mono-items=eager
, since we must avoid monomorphizing consts with impossible (possibly trivial) preds. You could probably turn that into an ICE today.
Originally posted by @compiler-errors in #136168 (review)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Progress
Milestone
Relationships
Development
No branches or pull requests
Activity
Auto merge of rust-lang#136429 - fmease:gci-fix-def-site-checks, r=<try>
Auto merge of rust-lang#136429 - fmease:gci-fix-def-site-checks, r=<try>
Auto merge of rust-lang#136429 - fmease:gci-fix-def-site-checks, r=<try>
Rollup merge of rust-lang#136429 - fmease:gci-fix-def-site-checks, r=…
Unrolled build for #136429
[-]Lifetime generics on Generic Const Items should not affect if const is checked for evaluatability[/-][+]Presence of lifetime generics on free const items should not affect if const is checked for evaluatability[/+][-]Presence of lifetime generics on free const items should not affect if const is checked for evaluatability[/-][+]Presence of lifetime params on free consts shouldn't affect evaluatability & impossible preds should prevent evaluation[/+]