Improve the ICE message for invalid nullary intrinsic calls#148118
Improve the ICE message for invalid nullary intrinsic calls#148118bors merged 1 commit intorust-lang:masterfrom
Conversation
|
Some changes occurred in compiler/rustc_codegen_ssa |
This comment has been minimized.
This comment has been minimized.
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
07f144e
Compare
|
@bors r=Noratrieb rollup |
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.
|
I'll come back to that. |
07f144e to
7a0d9c8
Compare
|
@bors r=Noratrieb,dianqk |
…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.
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.