Skip to content

Commit

Permalink
Auto merge of #123310 - compiler-errors:nested-static-codegen-attrs, …
Browse files Browse the repository at this point in the history
…r=oli-obk

Don't inherit codegen attrs from parent static

Putting this up partly for discussion and partly for review. Specifically, in #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) #123274. Fixes #123243. cc #121644.

r? `@oli-obk` cc `@nnethercote` `@RalfJung` (reviewers on that pr)
  • Loading branch information
bors committed Apr 1, 2024
2 parents 829aadc + 241f3a7 commit 5f89928
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 5f89928

Please sign in to comment.