Skip to content

Many "predicate"-to-"clause" renamings - #159990

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
nnethercote:predicate-to-clause
Jul 28, 2026
Merged

Many "predicate"-to-"clause" renamings#159990
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
nnethercote:predicate-to-clause

Conversation

@nnethercote

@nnethercote nnethercote commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

View all comments

Lots of names weren't changed to account for the introduction of the Clause type as a specialized form of Predicate, presumably because it was tedious. This commit converts as many of them as I could find. It's mostly very tedious renamings of types, functions, variables, and queries. The more interesting ones are a couple of files (predicates_of.rs, impossible_predicates.rs) and a MIR pass (ImpossiblePredicates).

r? @oli-obk

@rustbot

rustbot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

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

cc @BoxyUwU, @tshepang

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

changes to the core type system

cc @lcnr

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a, @makai410

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

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

cc @rust-lang/clippy

Some changes occurred in const_evaluatable.rs

cc @BoxyUwU

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-rustc-dev-guide Area: rustc-dev-guide S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jul 27, 2026
@nnethercote

nnethercote commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Apologies for the large diff. I did this a while ago but wasn't sure if it was worth the churn. Then @spastorino mentioned #107250 to me and I saw the unchecked item "Rename identifiers like pred and predicates to clause if they're actually clauses around the codebase" (which is exactly what this does) and decided to file the PR.

Comment thread compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs Outdated

@ada4a ada4a 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.

I believe I've found some instances of the comments/code surrounding your changes which should be updated to mention clauses as well. Not an expert in this by any stretch of imagination though, so please double-check 👉👈

View changes since this review

Comment thread compiler/rustc_borrowck/src/diagnostics/region_name.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
Comment thread compiler/rustc_hir_analysis/src/check/compare_impl_item.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/check/compare_impl_item.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/check/compare_impl_item.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/check/wfcheck.rs
Comment thread compiler/rustc_hir_analysis/src/collect/clauses_of.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/collect/clauses_of.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/collect/clauses_of.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/collect/clauses_of.rs Outdated
@nnethercote
nnethercote force-pushed the predicate-to-clause branch from 13031e6 to 1a3be39 Compare July 27, 2026 08:51
Comment thread compiler/rustc_hir_analysis/src/collect/clauses_of.rs
@nnethercote
nnethercote force-pushed the predicate-to-clause branch from 1a3be39 to aa61b88 Compare July 27, 2026 09:39

@ada4a ada4a 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.

Comment thread compiler/rustc_hir_analysis/src/check/compare_impl_item.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
Comment thread compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
Comment thread compiler/rustc_hir_analysis/src/collect/clauses_of.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/collect/clauses_of.rs
Comment thread compiler/rustc_hir_analysis/src/delegation.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/delegation.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/delegation.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/delegation.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/delegation.rs Outdated

@ada4a ada4a 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.

last batch for today...

View changes since this review

Comment thread compiler/rustc_hir_analysis/src/delegation.rs
Comment thread compiler/rustc_hir_analysis/src/delegation.rs
Comment thread compiler/rustc_hir_analysis/src/delegation.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/outlives/explicit.rs Outdated
match predicate.kind().skip_binder() {
for &(clause, span) in gen_clauses.clauses {
match clause.kind().skip_binder() {
ty::ClauseKind::TypeOutlives(OutlivesPredicate(ty, reg)) => {

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.

possibly off-topic: since OutlivesPredicate seems to actually be a kind of Clause, should it be renamed to OutlivesClause maybe? With that, maybe RequiredPredicates could be renamed as well.

I guess OutlivesPredicate being in rustc_public would make all of this a bit more annoying..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe, but I'll put it in the too-hard basket for now.

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.

Would it make sense to leave TODOs for this?

Comment thread compiler/rustc_privacy/src/lib.rs Outdated
Comment thread compiler/rustc_trait_selection/src/error_reporting/infer/region.rs Outdated
Comment thread compiler/rustc_trait_selection/src/error_reporting/traits/mod.rs
Comment thread compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs Outdated
Lots of names weren't changed to account for the introduction of the
`Clause` type as a specialized form of `Predicate`, presumably because
it was tedious. This commit converts as many of them as I could find.
It's mostly very tedious renamings of types, functions, variables, and
queries. The more interesting ones are a couple of files
(`predicates_of.rs`, `impossible_predicates.rs`) and a MIR pass
(`ImpossiblePredicates`).
@nnethercote
nnethercote force-pushed the predicate-to-clause branch from aa61b88 to ff161b1 Compare July 28, 2026 01:48
@rustbot

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

@nnethercote

Copy link
Copy Markdown
Contributor Author

@ada4a: thank you for the extremely thorough review! I have made all your suggested changes except where noted above.

@oli-obk oli-obk added the I-types-nominated Nominated for discussion during a types team meeting. label Jul 28, 2026
@oli-obk

oli-obk commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

nominating for awareness during today's types meeting.

@oli-obk oli-obk 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.

@bors r+ p=1 reason=bitrotty

View changes since this review

@rust-bors

rust-bors Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ff161b1 has been approved by oli-obk

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 28, 2026
@oli-obk oli-obk removed the I-types-nominated Nominated for discussion during a types team meeting. label Jul 28, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 28, 2026
…=oli-obk

Many "predicate"-to-"clause" renamings

Lots of names weren't changed to account for the introduction of the `Clause` type as a specialized form of `Predicate`, presumably because it was tedious. This commit converts as many of them as I could find. It's mostly very tedious renamings of types, functions, variables, and queries. The more interesting ones are a couple of files (`predicates_of.rs`, `impossible_predicates.rs`) and a MIR pass (`ImpossiblePredicates`).

r? @oli-obk
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 28, 2026
…=oli-obk

Many "predicate"-to-"clause" renamings

Lots of names weren't changed to account for the introduction of the `Clause` type as a specialized form of `Predicate`, presumably because it was tedious. This commit converts as many of them as I could find. It's mostly very tedious renamings of types, functions, variables, and queries. The more interesting ones are a couple of files (`predicates_of.rs`, `impossible_predicates.rs`) and a MIR pass (`ImpossiblePredicates`).

r? @oli-obk
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 28, 2026
…=oli-obk

Many "predicate"-to-"clause" renamings

Lots of names weren't changed to account for the introduction of the `Clause` type as a specialized form of `Predicate`, presumably because it was tedious. This commit converts as many of them as I could find. It's mostly very tedious renamings of types, functions, variables, and queries. The more interesting ones are a couple of files (`predicates_of.rs`, `impossible_predicates.rs`) and a MIR pass (`ImpossiblePredicates`).

r? @oli-obk
rust-bors Bot pushed a commit that referenced this pull request Jul 28, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #159990 (Many "predicate"-to-"clause" renamings)
 - #159665 (Replace most `Ty::new_fn_def` calls with `type_of` queries directly)
 - #159687 (rustdoc: Set tracing max_level_info when debug-logging is false)
 - #160065 (Distinguish the dep-graph index space from the live node count)
 - #159978 (run intrinsic-test by default on x86_64-gnu)
 - #160008 (Avoid stale closure recovery state across statements)
 - #160027 (Add regression test for #132767)
 - #160030 (Update `browser-ui-test` version to `0.25.0`)
 - #160046 (Improve consistency of attribute error messages (part 2))
 - #160056 (Fix associated function suggestion for generic ADTs)
 - #160069 (Update Rust crate tracing-subscriber to v0.3.23 [SECURITY])
 - #160071 (sanitize_standard_fds: clarify macos comment)
 - #160076 (use unstable features when updating dependencies)
 - #160088 (fix 404 url in src/doc/rustdoc.md)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 28, 2026
…=oli-obk

Many "predicate"-to-"clause" renamings

Lots of names weren't changed to account for the introduction of the `Clause` type as a specialized form of `Predicate`, presumably because it was tedious. This commit converts as many of them as I could find. It's mostly very tedious renamings of types, functions, variables, and queries. The more interesting ones are a couple of files (`predicates_of.rs`, `impossible_predicates.rs`) and a MIR pass (`ImpossiblePredicates`).

r? @oli-obk
rust-bors Bot pushed a commit that referenced this pull request Jul 28, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - #159990 (Many "predicate"-to-"clause" renamings)
 - #159665 (Replace most `Ty::new_fn_def` calls with `type_of` queries directly)
 - #159687 (rustdoc: Set tracing max_level_info when debug-logging is false)
 - #160057 (refactor(mir-transform): Calculate optimization status inside `run_passes_inner`)
 - #160060 (codegen: skip stores for entirely-uninit constant aggregate fields, attempt #2)
 - #160063 (Fix ICE when dumping the dep graph with the parallel frontend)
 - #160065 (Distinguish the dep-graph index space from the live node count)
 - #158038 (Split register_tool into register_attribute_tool and register_lint_tool)
 - #159776 (remove const hack in alloc)
 - #159978 (run intrinsic-test by default on x86_64-gnu)
 - #160008 (Avoid stale closure recovery state across statements)
 - #160027 (Add regression test for #132767)
 - #160030 (Update `browser-ui-test` version to `0.25.0`)
 - #160046 (Improve consistency of attribute error messages (part 2))
 - #160056 (Fix associated function suggestion for generic ADTs)
 - #160069 (Update Rust crate tracing-subscriber to v0.3.23 [SECURITY])
 - #160071 (sanitize_standard_fds: clarify macos comment)
 - #160076 (use unstable features when updating dependencies)
 - #160092 (miri ui tests: don't run native tests on stage 0)
 - #160093 (Switch cargo assignments to weihanglo)
 - #160094 (Update assignment for docs)
@rust-bors
rust-bors Bot merged commit 0a1a25a into rust-lang:main Jul 28, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 28, 2026
rust-timer added a commit that referenced this pull request Jul 28, 2026
Rollup merge of #159990 - nnethercote:predicate-to-clause, r=oli-obk

Many "predicate"-to-"clause" renamings

Lots of names weren't changed to account for the introduction of the `Clause` type as a specialized form of `Predicate`, presumably because it was tedious. This commit converts as many of them as I could find. It's mostly very tedious renamings of types, functions, variables, and queries. The more interesting ones are a couple of files (`predicates_of.rs`, `impossible_predicates.rs`) and a MIR pass (`ImpossiblePredicates`).

r? @oli-obk
@nnethercote
nnethercote deleted the predicate-to-clause branch July 29, 2026 02:44
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Jul 29, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - rust-lang/rust#159990 (Many "predicate"-to-"clause" renamings)
 - rust-lang/rust#159665 (Replace most `Ty::new_fn_def` calls with `type_of` queries directly)
 - rust-lang/rust#159687 (rustdoc: Set tracing max_level_info when debug-logging is false)
 - rust-lang/rust#160057 (refactor(mir-transform): Calculate optimization status inside `run_passes_inner`)
 - rust-lang/rust#160060 (codegen: skip stores for entirely-uninit constant aggregate fields, attempt rust-lang/rust#2)
 - rust-lang/rust#160063 (Fix ICE when dumping the dep graph with the parallel frontend)
 - rust-lang/rust#160065 (Distinguish the dep-graph index space from the live node count)
 - rust-lang/rust#158038 (Split register_tool into register_attribute_tool and register_lint_tool)
 - rust-lang/rust#159776 (remove const hack in alloc)
 - rust-lang/rust#159978 (run intrinsic-test by default on x86_64-gnu)
 - rust-lang/rust#160008 (Avoid stale closure recovery state across statements)
 - rust-lang/rust#160027 (Add regression test for rust-lang/rust#132767)
 - rust-lang/rust#160030 (Update `browser-ui-test` version to `0.25.0`)
 - rust-lang/rust#160046 (Improve consistency of attribute error messages (part 2))
 - rust-lang/rust#160056 (Fix associated function suggestion for generic ADTs)
 - rust-lang/rust#160069 (Update Rust crate tracing-subscriber to v0.3.23 [SECURITY])
 - rust-lang/rust#160071 (sanitize_standard_fds: clarify macos comment)
 - rust-lang/rust#160076 (use unstable features when updating dependencies)
 - rust-lang/rust#160092 (miri ui tests: don't run native tests on stage 0)
 - rust-lang/rust#160093 (Switch cargo assignments to weihanglo)
 - rust-lang/rust#160094 (Update assignment for docs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-rustc-dev-guide Area: rustc-dev-guide 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants