-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't even parse an intrinsic unless the feature gate is enabled #123603
Conversation
This comment has been minimized.
This comment has been minimized.
1fa20dc
to
651d02a
Compare
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 gated on only one thing: do we already have any tests where intrinsics are enabled and the function doesn't exist? I'm concerned that unrecognized intrinsic function: f1
is not being tested in any other test.
I'll add it if not |
We already have tests for this, e.g. @bors r=estebank rollup |
Rollup of 7 pull requests Successful merges: - rust-lang#123016 (Remove `TypeVariableOriginKind` and `ConstVariableOriginKind`) - rust-lang#123462 (Cleanup: Rename `ModSep` to `PathSep`) - rust-lang#123603 (Don't even parse an intrinsic unless the feature gate is enabled) - rust-lang#123926 (Fix pretty HIR for anon consts in diagnostics) - rust-lang#123973 (crashes: readme: add reminder to add Fixes #abcde to prs to automatically close issues.) - rust-lang#123984 (sanitizers: Add rustc_sanitizers to triagebot.toml) - rust-lang#123989 (Just use `type_dependent_def_id` to figure out what the method is for an expr) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#123603 - compiler-errors:no-intrinsic, r=estebank Don't even parse an intrinsic unless the feature gate is enabled Don't return true in `tcx.is_intrinsic` if the function is defined locally and `#![feature(intrinsics)]` is not enabled. This is a slightly more general fix than rust-lang#123526, since rust-lang#123587 shows that we have simplifying assumptions about intrinsics elsewhere in the compiler. This will make the code ICE again if the user **enables** `#[feature(intrinsics)]`, but I kind of feel like if we want to fix that, we should make the `INTERNAL_FEATURES` lint `Deny` again. Perhaps we could do that on non-nightly compilers. Or we should just stop compilation altogether if they have `#![feature]` enabled on a non-nightly compiler. As for the UX of *real* cases of hitting these ICEs, I believe pretty strongly that if a compiler/stdlib dev is modifying internal intrinsics (intentionally, like when making a change to rustc) we have no guarantee to make the ICE better looking for them. Honestly, *not* spitting out a stack trace is probably a disservice to the people who hit those ICEs in that case. r? `@Nilstrieb` `@estebank`
Don't return true in
tcx.is_intrinsic
if the function is defined locally and#![feature(intrinsics)]
is not enabled. This is a slightly more general fix than #123526, since #123587 shows that we have simplifying assumptions about intrinsics elsewhere in the compiler.This will make the code ICE again if the user enables
#[feature(intrinsics)]
, but I kind of feel like if we want to fix that, we should make theINTERNAL_FEATURES
lintDeny
again. Perhaps we could do that on non-nightly compilers. Or we should just stop compilation altogether if they have#![feature]
enabled on a non-nightly compiler.As for the UX of real cases of hitting these ICEs, I believe pretty strongly that if a compiler/stdlib dev is modifying internal intrinsics (intentionally, like when making a change to rustc) we have no guarantee to make the ICE better looking for them. Honestly, not spitting out a stack trace is probably a disservice to the people who hit those ICEs in that case.
r? @Nilstrieb @estebank