-
Notifications
You must be signed in to change notification settings - Fork 13.3k
GCI: Don't try to eval / collect mono items inside overly generic free const items #136168
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me when green
There's a difference between const _: () = panic!(); and const _<'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.
You can feel free to do this in a separate PR, since it may cause some perf changes. Maybe open a follow-up issue for this?
@bors r=compiler-errors |
Rollup of 9 pull requests Successful merges: - rust-lang#136121 (Deduplicate operand creation between scalars, non-scalars and string patterns) - rust-lang#136134 (Fix SIMD codegen tests on LLVM 20) - rust-lang#136153 (Locate asan-odr-win with other sanitizer tests) - rust-lang#136161 (rustdoc: add nobuild typescript checking to our JS) - rust-lang#136166 (interpret: is_alloc_live: check global allocs last) - rust-lang#136168 (GCI: Don't try to eval / collect mono items inside overly generic free const items) - rust-lang#136170 (Reject unsound toggling of Arm atomics-32 target feature) - rust-lang#136176 (Render pattern types nicely in mir dumps) - rust-lang#136186 (uefi: process: Fix args) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - rust-lang#136121 (Deduplicate operand creation between scalars, non-scalars and string patterns) - rust-lang#136134 (Fix SIMD codegen tests on LLVM 20) - rust-lang#136153 (Locate asan-odr-win with other sanitizer tests) - rust-lang#136161 (rustdoc: add nobuild typescript checking to our JS) - rust-lang#136166 (interpret: is_alloc_live: check global allocs last) - rust-lang#136168 (GCI: Don't try to eval / collect mono items inside overly generic free const items) - rust-lang#136170 (Reject unsound toggling of Arm atomics-32 target feature) - rust-lang#136176 (Render pattern types nicely in mir dumps) - rust-lang#136186 (uefi: process: Fix args) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136168 - fmease:gci-fix-mono, r=compiler-errors GCI: Don't try to eval / collect mono items inside overly generic free const items Fixes rust-lang#136156. Thanks for the pointers, errs! There's one (preexisting) thing of note (maybe?). There's a difference between `const _: () = panic!();` and `const _<'a>: () = panic!();`: The former is a pre-mono error, the latter is a post-mono error. For comparison, both `fn _f() { const { panic!() } }` and `fn _f<'a: 'a>() { const { panic!() } }` are post-mono errors. cc `@oli-obk` r? compiler-errors or reassign
Rollup of 9 pull requests Successful merges: - rust-lang#136121 (Deduplicate operand creation between scalars, non-scalars and string patterns) - rust-lang#136134 (Fix SIMD codegen tests on LLVM 20) - rust-lang#136153 (Locate asan-odr-win with other sanitizer tests) - rust-lang#136161 (rustdoc: add nobuild typescript checking to our JS) - rust-lang#136166 (interpret: is_alloc_live: check global allocs last) - rust-lang#136168 (GCI: Don't try to eval / collect mono items inside overly generic free const items) - rust-lang#136170 (Reject unsound toggling of Arm atomics-32 target feature) - rust-lang#136176 (Render pattern types nicely in mir dumps) - rust-lang#136186 (uefi: process: Fix args) r? `@ghost` `@rustbot` modify labels: rollup
Fixes #136156. Thanks for the pointers, errs!
There's one (preexisting) thing of note (maybe?). There's a difference between
const _: () = panic!();
andconst _<'a>: () = panic!();
: The former is a pre-mono error, the latter is a post-mono error. For comparison, bothfn _f() { const { panic!() } }
andfn _f<'a: 'a>() { const { panic!() } }
are post-mono errors.cc @oli-obk
r? compiler-errors or reassign