Skip to content
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

regression: no name for DefPath ICE #123274

Closed
Mark-Simulacrum opened this issue Mar 31, 2024 · 3 comments
Closed

regression: no name for DefPath ICE #123274

Mark-Simulacrum opened this issue Mar 31, 2024 · 3 comments
Assignees
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@Mark-Simulacrum
Copy link
Member

[INFO] [stdout] error: internal compiler error: compiler/rustc_middle/src/ty/mod.rs:1582:13: item_name: no name for DefPath { data: [DisambiguatedDefPathData { data: ValueNs("hello_struct"), disambiguator: 0 }, DisambiguatedDefPathData { data: AnonConst, disambiguator: 0 }], krate: crate0 }

https://crater-reports.s3.amazonaws.com/beta-1.78-3/beta-2024-03-30/reg/hello_bash_plugin-0.1.0/log.txt

@Mark-Simulacrum Mark-Simulacrum added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Mar 31, 2024
@Mark-Simulacrum Mark-Simulacrum added this to the 1.78.0 milestone Mar 31, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Mar 31, 2024
@matthiaskrgr
Copy link
Member

might be related to #123243

@compiler-errors
Copy link
Member

Yep, this is due to #121644, cc @oli-obk.

Specifically, it's kind of sketchy that the static allocations inherit the codegen flags from their parent statics -- in this case (see the issue @matthiaskrgr linked), we have an static allocation who inherits the #[no_mangle] flag from the parent; however, the allocation doesn't actually have an item name to use for #[no_mangle].

This should also affect other attrs like #[export_name], #[link_name]...

I'm gonna put up a fix PR.

@compiler-errors compiler-errors self-assigned this Apr 1, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Apr 1, 2024
…n-attrs, r=oli-obk

Don't inherit codegen attrs from parent static

Putting this up partly for discussion and partly for review. Specifically, in rust-lang#121644, `@oli-obk` designed a system that creates new static items for representing nested allocations in statics. However, in that PR, oli made it so that these statics inherited the codegen attrs from the parent.

This causes problems such as colliding symbols with `#[export_name]` and ICEs with `#[no_mangle]` since these synthetic statics have no `tcx.item_name(..)`.

So the question is, is there any case where we *do* want to inherit codegen attrs from the parent? The only one that seems a bit suspicious is the thread-local attribute. And there may be some interesting interactions with the coverage attributes as well...

Fixes (after backport) rust-lang#123274. Fixes rust-lang#123243. cc rust-lang#121644.

r? `@oli-obk` cc `@nnethercote` `@RalfJung` (reviewers on that pr)
@apiraino apiraino removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 2, 2024
@jieyouxu jieyouxu added the A-codegen Area: Code generation label Apr 3, 2024
@cuviper
Copy link
Member

cuviper commented Apr 12, 2024

Backported in #123466.

@cuviper cuviper closed this as completed Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants