Skip to content

borrowck: Apply user_arg_index nomenclature more broadly#154895

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Enselic:user-arg-index
Apr 20, 2026
Merged

borrowck: Apply user_arg_index nomenclature more broadly#154895
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Enselic:user-arg-index

Conversation

@Enselic
Copy link
Copy Markdown
Member

@Enselic Enselic commented Apr 6, 2026

No change in behavior. Only renames and a couple of added comments.

As requested here: #154674 (comment)

r? jdonszelmann

No change in behavior. Only renames and a couple of added comments.
@rustbot rustbot added 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 Apr 6, 2026
/// as the name suggests. =)
///
/// N.B., in the case of a closure, index 0 is the implicit self parameter,
/// and not the first input as seen by the user.
Copy link
Copy Markdown
Contributor

@jdonszelmann jdonszelmann Apr 10, 2026

Choose a reason for hiding this comment

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

View changes since the review

is this also true for #[track_caller] parameters? might be nice to document all the cases.

Copy link
Copy Markdown
Member Author

@Enselic Enselic Apr 17, 2026

Choose a reason for hiding this comment

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

Good call. After browsing around the compiler code a bit, my impression is that #[track_caller] adds an argument to the ABI, but not to MIR. See in particular this:

assert_eq!(
fn_abi.args.len(),
mir_args + 1,
"#[track_caller] fn's must have 1 more argument in their ABI than in their MIR: {instance:?} {fn_span:?} {fn_abi:?}",
);

So AFAIK the added comment remains accurate.

@rustbot ready

@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 10, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 17, 2026
@jdonszelmann
Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 20, 2026

📌 Commit 2d14e74 has been approved by jdonszelmann

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 Apr 20, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 20, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #154654 (Move `std::io::ErrorKind` to `core::io`)
 - #145270 (Fix an ICE observed with an explicit tail-call in a default trait method)
 - #154895 (borrowck: Apply `user_arg_index` nomenclature more broadly)
 - #155213 (resolve: Make sure visibilities of import declarations make sense)
 - #155346 (`single_use_lifetimes`: respect `anonymous_lifetime_in_impl_trait`)
 - #155517 (Add a test for Mach-O `#[link_section]` API inherited from LLVM)
 - #155549 (Remove some unnecessary lifetimes.)
 - #154248 (resolve :  mark repr_simd as internal)
 - #154772 (slightly optimize the `non-camel-case-types` lint)
 - #155541 (Add `#[rust_analyzer::prefer_underscore_import]` to the traits in `rustc_type_ir::inherent`)
 - #155544 (bootstrap: Make "detected modifications" for download-rustc less verbose)
@rust-bors rust-bors Bot merged commit 6245e37 into rust-lang:main Apr 20, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 20, 2026
rust-timer added a commit that referenced this pull request Apr 20, 2026
Rollup merge of #154895 - Enselic:user-arg-index, r=jdonszelmann

borrowck: Apply `user_arg_index` nomenclature more broadly

No change in behavior. Only renames and a couple of added comments.

As requested here: #154674 (comment)

r? jdonszelmann
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Apr 21, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#154654 (Move `std::io::ErrorKind` to `core::io`)
 - rust-lang/rust#145270 (Fix an ICE observed with an explicit tail-call in a default trait method)
 - rust-lang/rust#154895 (borrowck: Apply `user_arg_index` nomenclature more broadly)
 - rust-lang/rust#155213 (resolve: Make sure visibilities of import declarations make sense)
 - rust-lang/rust#155346 (`single_use_lifetimes`: respect `anonymous_lifetime_in_impl_trait`)
 - rust-lang/rust#155517 (Add a test for Mach-O `#[link_section]` API inherited from LLVM)
 - rust-lang/rust#155549 (Remove some unnecessary lifetimes.)
 - rust-lang/rust#154248 (resolve :  mark repr_simd as internal)
 - rust-lang/rust#154772 (slightly optimize the `non-camel-case-types` lint)
 - rust-lang/rust#155541 (Add `#[rust_analyzer::prefer_underscore_import]` to the traits in `rustc_type_ir::inherent`)
 - rust-lang/rust#155544 (bootstrap: Make "detected modifications" for download-rustc less verbose)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

3 participants