Uh oh!
There was an error while loading. Please reload this page.
Improve the ICE message for invalid nullary intrinsic calls - #148118
Conversation
rustbot
commented
Oct 25, 2025
Some changes occurred in compiler/rustc_codegen_ssa |
rustbot
commented
Oct 25, 2025
This comment has been minimized.
This comment has been minimized.
folkertdev
commented
Oct 25, 2025
In this particular case it would have been helpful to know that the problem is calling the intrinsic directly. I did not consider that that might be happening (and So yeah some note about how directly calling these intrinsics is discouraged (or some stronger word: it just does not work) would have helped. |
d890b26 to
07f144eComparesaethlin
commented
Oct 25, 2025
@bors r=Noratrieb rollup |
bors
commented
Oct 25, 2025
There was a problem hiding this comment.
Should we leave a comment stating that this can only be called at compile time? I can see this comment in some intrinsics (like needs_drop), but not in align_of. When I see Nullary intrinsic align_of must be called in a const block, I don't understand why this must be called in a const block.
saethlin
commented
Oct 26, 2025
I'll come back to that. |
07f144e to
7a0d9c8Comparerustbot
commented
Oct 26, 2025
saethlin
commented
Oct 26, 2025
dianqk
commented
Oct 26, 2025
@bors r=Noratrieb,dianqk |
bors
commented
Oct 26, 2025
…ug-msg, r=Noratrieb,dianqk Improve the ICE message for invalid nullary intrinsic calls In rust-lang#148104, we found the panic message here rather confusing, and (if I'm reading the tea leaves right) that's because the intended audience for either side of the phrase is very different. I think this is more clear if/when this is encountered by users. I expect this ICE to be hit in practice by people calling the `size_of` and `align_of` intrinsics, so it's now _kind of_ helpful for those users too. The original effort to stop backends from needing to support nullary intrinsics added a note to all these const-only intrinsics, but when rust-lang#147793 ported two more the paragraph wasn't added. I've added it.
Rollup of 4 pull requests Successful merges: - #145665 (Don't require `T: RefUnwindSafe` for `vec::IntoIter<T>: UnwindSafe`) - #147728 (tests: activate misspelled `gdb-check` in `function-arg-initialization.rs`) - #148097 (tests/debuginfo/closures.rs: Activate misspelled `cdb-check`) - #148118 (Improve the ICE message for invalid nullary intrinsic calls) r? `@ghost` `@rustbot` modify labels: rollup
…ug-msg, r=Noratrieb,dianqk Improve the ICE message for invalid nullary intrinsic calls In rust-lang#148104, we found the panic message here rather confusing, and (if I'm reading the tea leaves right) that's because the intended audience for either side of the phrase is very different. I think this is more clear if/when this is encountered by users. I expect this ICE to be hit in practice by people calling the `size_of` and `align_of` intrinsics, so it's now _kind of_ helpful for those users too. The original effort to stop backends from needing to support nullary intrinsics added a note to all these const-only intrinsics, but when rust-lang#147793 ported two more the paragraph wasn't added. I've added it.
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #148118 - saethlin:nullary-intrinsic-check-bug-msg, r=Noratrieb,dianqk Improve the ICE message for invalid nullary intrinsic calls In #148104, we found the panic message here rather confusing, and (if I'm reading the tea leaves right) that's because the intended audience for either side of the phrase is very different. I think this is more clear if/when this is encountered by users. I expect this ICE to be hit in practice by people calling the `size_of` and `align_of` intrinsics, so it's now _kind of_ helpful for those users too. The original effort to stop backends from needing to support nullary intrinsics added a note to all these const-only intrinsics, but when #147793 ported two more the paragraph wasn't added. I've added it.
…ug-msg, r=Noratrieb,dianqk Improve the ICE message for invalid nullary intrinsic calls In rust-lang#148104, we found the panic message here rather confusing, and (if I'm reading the tea leaves right) that's because the intended audience for either side of the phrase is very different. I think this is more clear if/when this is encountered by users. I expect this ICE to be hit in practice by people calling the `size_of` and `align_of` intrinsics, so it's now _kind of_ helpful for those users too. The original effort to stop backends from needing to support nullary intrinsics added a note to all these const-only intrinsics, but when rust-lang#147793 ported two more the paragraph wasn't added. I've added it.
In #148104, we found the panic message here rather confusing, and (if I'm reading the tea leaves right) that's because the intended audience for either side of the phrase is very different. I think this is more clear if/when this is encountered by users.
I expect this ICE to be hit in practice by people calling the
size_ofandalign_ofintrinsics, so it's now kind of helpful for those users too.The original effort to stop backends from needing to support nullary intrinsics added a note to all these const-only intrinsics, but when #147793 ported two more the paragraph wasn't added. I've added it.