Skip to content

Rename ModDefId to ModId and use more#159197

Merged
rust-bors[bot] merged 6 commits into
rust-lang:mainfrom
camsteffen:more-modid
Jul 15, 2026
Merged

Rename ModDefId to ModId and use more#159197
rust-bors[bot] merged 6 commits into
rust-lang:mainfrom
camsteffen:more-modid

Conversation

@camsteffen

@camsteffen camsteffen commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

View all comments

Addresses some FIXMEs.

The ModDefId was used pretty sparingly, and honestly I wondered if it should exist at all. After making these changes, I think the type is worth it. Most notably it is now used in Visibility::Restricted.

I first renamed ModDefId to ModId since I think the former is over-specific, and also this is more in line with BodyId or OwnerId.

I'll wait for initial feedback before fixing rustdoc/clippy.

@rustbot

rustbot commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

HIR ty lowering was modified

cc @fmease

Some changes occurred in exhaustiveness checking

cc @Nadrieril

Some changes occurred in match checking

cc @Nadrieril

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 12, 2026
@rustbot

rustbot commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

r? @JonathanBrouwer

rustbot has assigned @JonathanBrouwer.
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 75 candidates
  • Random selection from 19 candidates

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@petrochenkov petrochenkov self-assigned this Jul 13, 2026
Comment thread compiler/rustc_metadata/src/rmeta/encoder.rs Outdated
Comment thread compiler/rustc_metadata/src/rmeta/encoder.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

I wondered if it should exist at all. After making these changes, I think the type is worth it.

I think using (Local)ModId in visibilities and other places finally gave it some acceptable level of usefulness, yes.

@petrochenkov petrochenkov 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 13, 2026
@rustbot

rustbot commented Jul 14, 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 A-rustdoc-json Area: Rustdoc JSON backend 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 Jul 14, 2026
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@camsteffen

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@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 Jul 14, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

CI failed due to a spurious network error.
r? me @bors r+

@rust-bors

rust-bors Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit acdd18e has been approved by petrochenkov

It is now in the queue for this repository.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 14, 2026
Rename ModDefId to ModId and use more

Addresses some FIXMEs.

The `ModDefId` was used pretty sparingly, and honestly I wondered if it should exist at all. After making these changes, I think the type is worth it. Most notably it is now used in `Visibility::Restricted`.

I first renamed `ModDefId` to `ModId` since I think the former is over-specific, and also this is more in line with `BodyId` or `OwnerId`.

I'll wait for initial feedback before fixing rustdoc/clippy.
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #159278 (comment)

@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 Jul 14, 2026
@rust-bors

rust-bors Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#159278), which was unapproved.

View changes since this unapproval

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Also this one I think
#159278 (comment)

@rust-log-analyzer

This comment has been minimized.

@rustbot

rustbot commented Jul 14, 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

Fixed the errors. @rustbot ready

@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 Jul 14, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2c70f93 has been approved by petrochenkov

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

Rollup of 8 pull requests

Successful merges:

 - #159197 (Rename ModDefId to ModId and use more)
 - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too)
 - #159296 (Implement `bool::toggle`)
 - #158302 (Fix `overflowing_literals` lint with repeated negation)
 - #158484 (Add documentation for the `cold` and `track_caller` attributes)
 - #159239 (Add codegen test for remainder match)
 - #159330 (fix some edition annotations in UI tests)
 - #159331 (Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs)

Failed merges:

 - #158962 (Add `proc_macro` attribute documentation)
rust-bors Bot pushed a commit that referenced this pull request Jul 15, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159197 (Rename ModDefId to ModId and use more)
 - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too)
 - #159296 (Implement `bool::toggle`)
 - #158302 (Fix `overflowing_literals` lint with repeated negation)
 - #158484 (Add documentation for the `cold` and `track_caller` attributes)
 - #159239 (Add codegen test for remainder match)
 - #159330 (fix some edition annotations in UI tests)
 - #159331 (Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs)

Failed merges:

 - #158962 (Add `proc_macro` attribute documentation)
rust-bors Bot pushed a commit that referenced this pull request Jul 15, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159197 (Rename ModDefId to ModId and use more)
 - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too)
 - #159296 (Implement `bool::toggle`)
 - #158302 (Fix `overflowing_literals` lint with repeated negation)
 - #158484 (Add documentation for the `cold` and `track_caller` attributes)
 - #159239 (Add codegen test for remainder match)
 - #159330 (fix some edition annotations in UI tests)
 - #159331 (Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs)

Failed merges:

 - #158962 (Add `proc_macro` attribute documentation)
@rust-bors
rust-bors Bot merged commit 8fdc29c into rust-lang:main Jul 15, 2026
13 checks passed
rust-timer added a commit that referenced this pull request Jul 15, 2026
Rollup merge of #159197 - camsteffen:more-modid, r=petrochenkov

Rename ModDefId to ModId and use more

Addresses some FIXMEs.

The `ModDefId` was used pretty sparingly, and honestly I wondered if it should exist at all. After making these changes, I think the type is worth it. Most notably it is now used in `Visibility::Restricted`.

I first renamed `ModDefId` to `ModId` since I think the former is over-specific, and also this is more in line with `BodyId` or `OwnerId`.

I'll wait for initial feedback before fixing rustdoc/clippy.
@rustbot rustbot added this to the 1.99.0 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustdoc-json Area: Rustdoc JSON backend 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 Relevant to the rustdoc 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.

5 participants