Skip to content

Prefer ModId in more places - #159787

Merged
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
camsteffen:fnctxt-modid
Sep 20, 2026
Merged

rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
camsteffen:fnctxt-modid

Conversation

@camsteffen

@camsteffen camsteffen commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

View all comments

Simplifying code a bit and adding consistency. Generally prefer passing around ModId instead of a more specific ID when a ModId will do.

@rustbot

rustbot commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

HIR ty lowering was modified

cc @fmease

@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 Jul 23, 2026
@rustbot

rustbot commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

r? @mu001999

rustbot has assigned @mu001999.
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 74 candidates
  • Random selection from 20 candidates

@mu001999

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 24, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 24, 2026
@rust-bors

rust-bors Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: d23ae58 (d23ae583eaadc5bb12614b8b6dc9e36776122523)
Base parent: 76c35a1 (76c35a14a45897a366c11657ecbbe9ec4153ad17)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (d23ae58): comparison URL.

Overall result: ❌ regressions - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.3%] 12
Regressions ❌
(secondary)
0.3% [0.1%, 0.5%] 18
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.3%] 12

Max RSS (memory usage)

Results (secondary -0.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.7% [2.7%, 2.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.6%, -2.2%] 2
All ❌✅ (primary) - - 0

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 488.274s -> 486.771s (-0.31%)
Artifact size: 387.66 MiB -> 387.61 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 24, 2026
@mu001999

mu001999 commented Jul 24, 2026

Copy link
Copy Markdown
Member

Seems this instead leads to a slight perf regression. Do you have any ideas?

@rustbot author

@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 Jul 24, 2026
@rustbot

rustbot commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

@rustbot rustbot added T-clippy Relevant to the Clippy team. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Aug 28, 2026
@rustbot

This comment has been minimized.

@camsteffen camsteffen changed the title Cache and use more ModId Prefer ModId in more places Aug 28, 2026
@camsteffen

Copy link
Copy Markdown
Contributor Author

This should be about perf neutral now. Adding a ModId to ItemCtxt was a loss so I took that out.

@mu001999

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 28, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 28, 2026
@rust-bors

rust-bors Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 5eb45c3 (5eb45c324decbc218a78c4fc379dd769318e60d7)
Base parent: d0f2ef5 (d0f2ef5e53039bd86fdcaa6e71860c4948880e04)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (5eb45c3): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary -2.3%, secondary 2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
7.1% [7.1%, 7.1%] 1
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) -2.3% [-2.3%, -2.3%] 1

Cycles

Results (primary -0.5%, secondary 10.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.2% [3.2%, 3.2%] 1
Regressions ❌
(secondary)
10.6% [3.0%, 18.3%] 4
Improvements ✅
(primary)
-2.4% [-2.6%, -2.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.5% [-2.6%, 3.2%] 3

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 475.629s -> 474.896s (-0.15%)
Artifact size: 402.76 MiB -> 402.77 MiB (0.00%)

@rustbot rustbot removed perf-regression Performance regression. S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 28, 2026
Comment thread compiler/rustc_lint/src/late.rs Outdated
@mu001999

Copy link
Copy Markdown
Member

r=me after nits

@rustbot author

@rust-bors

This comment has been minimized.

Use ModId more for visibility checks from TypeckRootCtxt. This just
simplifies things a bit and adds consistency.
We generally expect Visibility to have ModId or LocalModId, so it seems
good to restrict the impls as such. There is just one error path needing
adjustment to check that we actually have a ModId. It should be okay
since, if it is not a module, an error will be emitted elsewhere.
Especially in adjust_ident_and_get_scope and is_accessible_from.
@rustbot

rustbot commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@camsteffen

Copy link
Copy Markdown
Contributor Author

@bors r=mu001999

@rust-bors

rust-bors Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

@camsteffen: 🔑 Insufficient privileges: not in review users

@mu001999

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2532b72 has been approved by mu001999

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 20, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 20, 2026
Rollup of 17 pull requests

Successful merges:

 - #158515 (Make let-else respect macro_rules expr metavariable grouping)
 - #160028 (Better account for `Self` that might be a typo of `self`)
 - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor)
 - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner)
 - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes)
 - #162990 (post GH comment on types nominations)
 - #153662 (Suggest fully qualified path on method name collision)
 - #154665 (add safety section for mem::zeroed)
 - #159787 (Prefer ModId in more places)
 - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription)
 - #162705 (Trigger "C array" parse error recovery in far fewer cases)
 - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt)
 - #162988 (recover `true` and `false` in type position as `bool`)
 - #162995 (Constify `impl FromStr for NonZero<T>`)
 - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics)
 - #163007 (add Dir::try_clone)
 - #163039 (Use verbose suggestion for parenthetical `Fn` notation and fully-qualified path on ambiguous assoc item)
rust-bors Bot pushed a commit that referenced this pull request Sep 20, 2026
Rollup of 17 pull requests

Successful merges:

 - #158515 (Make let-else respect macro_rules expr metavariable grouping)
 - #160028 (Better account for `Self` that might be a typo of `self`)
 - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor)
 - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner)
 - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes)
 - #162990 (post GH comment on types nominations)
 - #153662 (Suggest fully qualified path on method name collision)
 - #154665 (add safety section for mem::zeroed)
 - #159787 (Prefer ModId in more places)
 - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription)
 - #162705 (Trigger "C array" parse error recovery in far fewer cases)
 - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt)
 - #162988 (recover `true` and `false` in type position as `bool`)
 - #162995 (Constify `impl FromStr for NonZero<T>`)
 - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics)
 - #163007 (add Dir::try_clone)
 - #163039 (Use verbose suggestion for parenthetical `Fn` notation and fully-qualified path on ambiguous assoc item)
@rust-bors
rust-bors Bot merged commit a40454f into rust-lang:main Sep 20, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 20, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 20, 2026
Rollup merge of #159787 - camsteffen:fnctxt-modid, r=mu001999

Prefer ModId in more places

Simplifying code a bit and adding consistency. Generally prefer passing around `ModId` instead of a more specific ID when a `ModId` will do.
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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants