Skip to content

Remove outdated comments from va_list.rs - #160157

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
beetrees:va-list-outdated-backend-comments
Jul 31, 2026
Merged

Remove outdated comments from va_list.rs#160157
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
beetrees:va-list-outdated-backend-comments

Conversation

@beetrees

@beetrees beetrees commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Since #150436 codegen backends haven't needed to implement va_copy or va_end as they are implemented using intrinsic fallback bodies, so the comments on the #[inline] annotations are no longer relevant. I've left the #[inline] annotations themselves as they seem worthwhile since va_copy and va_end are a memcpy and a no-op respectively.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 29, 2026
@rustbot

rustbot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

r? @JohnTitor

rustbot has assigned @JohnTitor.
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: libs
  • libs expanded to 12 candidates
  • Random selection from 8 candidates

@folkertdev

Copy link
Copy Markdown
Contributor

This was added in #154133, I believe that we're really using a side-effect of #[inline] here which stores MIR in the rlib files and only actually performs codegen in a crate that uses these definitions. We should clarify what is going on.

cc @bjorn3 who made that change (specifically for the cranelift backend).

@beetrees

Copy link
Copy Markdown
Contributor Author

I believe that we're really using a side-effect of #[inline] here which stores MIR in the rlib files and only actually performs codegen in a crate that uses these definitions

Indeed. That side-effect of #[inline] is only needed (in this file) for va_arg, as va_copy and va_end have fallback bodies and therefore can codegen fine on all backends.

We should clarify what is going on.

Should I expand the comment next to the #[inline] on next_arg? I considered it but this isn't the only time #[inline] has been used when some codegen backends don't support things so I wonder if there is somewhere more central to document it, or maybe some existing documentation that could be linked to (of course this is only useful for standard library development and isn't a user-facing guarantee of #[inline]).

@folkertdev

Copy link
Copy Markdown
Contributor

Well I'm confused by #150436 predating #154133, so I'm wondering if it did solve a specific problem. Otherwise, that comment would have been incorrect from the start?!

If not then just having #[inline] without a comment is fine, as you say we use that all over the place.

@folkertdev

Copy link
Copy Markdown
Contributor

r? me

@bjorn3 can you clarify the intent of the comments, and whether there is more to it than a normal #[inline]?

@rustbot rustbot assigned folkertdev and unassigned JohnTitor Jul 29, 2026
@bjorn3

bjorn3 commented Jul 31, 2026

Copy link
Copy Markdown
Member

These #[inline] are to delay codegen to their actual use. This way libcore can compile fine with a codegen backend that doesn't support these intrinsics and only actually using VaList in user code triggers an error for such backend. Removing those #[inline] will break cg_clif currently.

Edit: If they have fallback bodies, then yeah fine to remove the comments.

@folkertdev folkertdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks!

@bors r+ rollup

View changes since this review

@rust-bors

rust-bors Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 41f5caa has been approved by folkertdev

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 Jul 31, 2026
@folkertdev folkertdev added the F-c_variadic `#![feature(c_variadic)]` label Jul 31, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 31, 2026
…comments, r=folkertdev

Remove outdated comments from `va_list.rs`

Since rust-lang#150436 codegen backends haven't needed to implement `va_copy` or `va_end` as they are implemented using intrinsic fallback bodies, so the comments on the `#[inline]` annotations are no longer relevant. I've left the `#[inline]` annotations themselves as they seem worthwhile since `va_copy` and `va_end` are a memcpy and a no-op respectively.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 31, 2026
…comments, r=folkertdev

Remove outdated comments from `va_list.rs`

Since rust-lang#150436 codegen backends haven't needed to implement `va_copy` or `va_end` as they are implemented using intrinsic fallback bodies, so the comments on the `#[inline]` annotations are no longer relevant. I've left the `#[inline]` annotations themselves as they seem worthwhile since `va_copy` and `va_end` are a memcpy and a no-op respectively.
rust-bors Bot pushed a commit that referenced this pull request Jul 31, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - #160100 (Add "system" option to `override-allocator` directive)
 - #159675 (rustc: Support `--jobs` options for limiting parallelism in various parts of the compiler)
 - #159999 (Fix invalidation of stdlib in bootstrap when using non-LLVM codegen backends)
 - #160233 (Bubble bad path error while parsing field to avoid unecessary second error)
 - #160272 (rustc_metadata: Move native library search code to `rustc_codegen_ssa`)
 - #154202 (rustfmt: Format `cfg_select!`)
 - #158835 (rustc_passes: lint unused `#[path]` attributes on inline modules)
 - #159520 (Suggest `Vec<T>` instead of `[T]`)
 - #160034 (Move "macro only" check for `#[allow_internal_unsafe/unstable]` to attribute parser)
 - #160066 (rustc_middle: lint attribute cleanups)
 - #160085 (Remove various superfluous lint attributes)
 - #160113 (Coalesce `rustc_on_unimplemented` attributes and lint malformed filters)
 - #160119 (fix query cycle in `coroutine_hidden_types` for the next solver)
 - #160147 (tests: Remove `-Zthreads` options from tests in `ui/parallel-rustc`)
 - #160157 (Remove outdated comments from `va_list.rs`)
 - #160159 (More accurately check for interior mutability in `invalid_reference_casting` lint)
 - #160208 (rustdoc: Fix crash when trying to list attributes on an opaque type)
 - #160244 (Rename splat to rustc_splat in error messages)
 - #160246 (dont fire `unused_mut` on `&pin mut self`)
 - #160247 (Configure backport nominations for rustfmt)
 - #160274 (renovate: update lock files weekly)
rust-bors Bot pushed a commit that referenced this pull request Jul 31, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #160100 (Add "system" option to `override-allocator` directive)
 - #160220 (Refactor: shrink region ext traits)
 - #159675 (rustc: Support `--jobs` options for limiting parallelism in various parts of the compiler)
 - #159999 (Fix invalidation of stdlib in bootstrap when using non-LLVM codegen backends)
 - #160233 (Bubble bad path error while parsing field to avoid unecessary second error)
 - #160272 (rustc_metadata: Move native library search code to `rustc_codegen_ssa`)
 - #154202 (rustfmt: Format `cfg_select!`)
 - #159520 (Suggest `Vec<T>` instead of `[T]`)
 - #159710 (Add rustdoc/cargo PGO profiles to reproducible artifacts)
 - #160034 (Move "macro only" check for `#[allow_internal_unsafe/unstable]` to attribute parser)
 - #160066 (rustc_middle: lint attribute cleanups)
 - #160085 (Remove various superfluous lint attributes)
 - #160113 (Coalesce `rustc_on_unimplemented` attributes and lint malformed filters)
 - #160119 (fix query cycle in `coroutine_hidden_types` for the next solver)
 - #160147 (tests: Remove `-Zthreads` options from tests in `ui/parallel-rustc`)
 - #160157 (Remove outdated comments from `va_list.rs`)
 - #160159 (More accurately check for interior mutability in `invalid_reference_casting` lint)
 - #160208 (rustdoc: Fix crash when trying to list attributes on an opaque type)
 - #160244 (Rename splat to rustc_splat in error messages)
 - #160246 (dont fire `unused_mut` on `&pin mut self`)
 - #160247 (Configure backport nominations for rustfmt)
 - #160274 (renovate: update lock files weekly)
@rust-bors
rust-bors Bot merged commit 11b6289 into rust-lang:main Jul 31, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 31, 2026
rust-timer added a commit that referenced this pull request Jul 31, 2026
Rollup merge of #160157 - beetrees:va-list-outdated-backend-comments, r=folkertdev

Remove outdated comments from `va_list.rs`

Since #150436 codegen backends haven't needed to implement `va_copy` or `va_end` as they are implemented using intrinsic fallback bodies, so the comments on the `#[inline]` annotations are no longer relevant. I've left the `#[inline]` annotations themselves as they seem worthwhile since `va_copy` and `va_end` are a memcpy and a no-op respectively.
@beetrees
beetrees deleted the va-list-outdated-backend-comments branch July 31, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-c_variadic `#![feature(c_variadic)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants