Skip to content

cg_llvm: Use an invariant lifetime brand for LLVM attributes - #165861

Open
Zalathar wants to merge 1 commit into
rust-lang:mainfrom
Zalathar:llattr
Open

Zalathar wants to merge 1 commit into
rust-lang:mainfrom
Zalathar:llattr

Conversation

@Zalathar

Copy link
Copy Markdown
Member

This PR changes the type of LLVM attribute references from &'ll Attribute to Attribute<'ll> with an invariant lifetime brand, to help uphold soundness of the FFI bindings.

There should be no change to compiler output.


After the value migration, this step is thankfully much smaller.

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 12, 2026
@rustbot

rustbot commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

r? @mati865

rustbot has assigned @mati865.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 79 candidates
  • Random selection from 20 candidates

@wesleywiser

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 6703460 has been approved by wesleywiser

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 12, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 12, 2026
cg_llvm: Use an invariant lifetime brand for LLVM attributes

This PR changes the type of LLVM attribute references from `&'ll Attribute` to `Attribute<'ll>` with an invariant lifetime brand, to help uphold soundness of the FFI bindings.

There should be no change to compiler output.

---

After the value migration, this step is thankfully much smaller.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 12, 2026
cg_llvm: Use an invariant lifetime brand for LLVM attributes

This PR changes the type of LLVM attribute references from `&'ll Attribute` to `Attribute<'ll>` with an invariant lifetime brand, to help uphold soundness of the FFI bindings.

There should be no change to compiler output.

---

After the value migration, this step is thankfully much smaller.
rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #157721 (compiletest: Add testing for lint machinery at runtime)
 - #165565 (view-types: lower view types from HIR)
 - #165810 (reflection: reflect attributes from adts, fields, and variants)
 - #165855 (Update `sysinfo` version to `0.40.3`)
 - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes)
 - #165872 (Some attribute related cleanups)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 12, 2026
cg_llvm: Use an invariant lifetime brand for LLVM attributes

This PR changes the type of LLVM attribute references from `&'ll Attribute` to `Attribute<'ll>` with an invariant lifetime brand, to help uphold soundness of the FFI bindings.

There should be no change to compiler output.

---

After the value migration, this step is thankfully much smaller.
rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`)
 - #165565 (view-types: lower view types from HIR)
 - #165771 (tests: cover MSVC ThinLTO exported symbol preservation)
 - #165810 (reflection: reflect attributes from adts, fields, and variants)
 - #165855 (Update `sysinfo` version to `0.40.3`)
 - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes)
 - #165872 (Some attribute related cleanups)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 12, 2026
cg_llvm: Use an invariant lifetime brand for LLVM attributes

This PR changes the type of LLVM attribute references from `&'ll Attribute` to `Attribute<'ll>` with an invariant lifetime brand, to help uphold soundness of the FFI bindings.

There should be no change to compiler output.

---

After the value migration, this step is thankfully much smaller.
rust-bors Bot pushed a commit that referenced this pull request Nov 13, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #164707 (Re-enable rustc profile generation for static linked llvm on Windows x64 builds )
 - #165221 (Canonicalize more comparison operators)
 - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`)
 - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`)
 - #165565 (view-types: lower view types from HIR)
 - #165771 (tests: cover MSVC ThinLTO exported symbol preservation)
 - #165810 (reflection: reflect attributes from adts, fields, and variants)
 - #165823 (Tweak crate error wording and turn them into fatal errors)
 - #165849 (More opt-dist improvements)
 - #165855 (Update `sysinfo` version to `0.40.3`)
 - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes)
 - #165872 (Some attribute related cleanups)
rust-bors Bot pushed a commit that referenced this pull request Nov 13, 2026
Rollup of 13 pull requests

Successful merges:

 - #164707 (Re-enable rustc profile generation for static linked llvm on Windows x64 builds )
 - #165068 (Change color usage for highlights)
 - #165841 (Tell Miri about the alignment handling in the Windows System allocator)
 - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`)
 - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`)
 - #165565 (view-types: lower view types from HIR)
 - #165622 (small cleanups in rustc_codegen_llvm)
 - #165771 (tests: cover MSVC ThinLTO exported symbol preservation)
 - #165810 (reflection: reflect attributes from adts, fields, and variants)
 - #165823 (Tweak crate error wording and turn them into fatal errors)
 - #165849 (More opt-dist improvements)
 - #165855 (Update `sysinfo` version to `0.40.3`)
 - #165872 (Some attribute related cleanups)

Failed merges:

 - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes)
@Zalathar

Copy link
Copy Markdown
Member Author

Blocked on conflict with #165622. I'll rebase after that lands.

@bors r-

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 13, 2026
@rust-bors

rust-bors Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

View changes since this unapproval

rust-bors Bot pushed a commit that referenced this pull request Nov 13, 2026
Rollup of 11 pull requests

Successful merges:

 - #165068 (Change color usage for highlights)
 - #165841 (Tell Miri about the alignment handling in the Windows System allocator)
 - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`)
 - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`)
 - #165565 (view-types: lower view types from HIR)
 - #165622 (small cleanups in rustc_codegen_llvm)
 - #165771 (tests: cover MSVC ThinLTO exported symbol preservation)
 - #165810 (reflection: reflect attributes from adts, fields, and variants)
 - #165849 (More opt-dist improvements)
 - #165855 (Update `sysinfo` version to `0.40.3`)
 - #165872 (Some attribute related cleanups)

Failed merges:

 - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes)
@rust-bors

rust-bors Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #165918) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants