Skip to content

Distinguish prepending and replacing self ty in predicates - #144694

Merged
bors merged 1 commit into
rust-lang:masterfrom
compiler-errors:with-self-ty
Aug 4, 2025
Merged

Distinguish prepending and replacing self ty in predicates#144694
bors merged 1 commit into
rust-lang:masterfrom
compiler-errors:with-self-ty

Conversation

@compiler-errors

Copy link
Copy Markdown
Contributor

There are two kinds of functions called with_self_ty:

  1. Prepends the Self type onto an ExistentialPredicate which lacks it in its internal representation.
  2. Replaces the Self type of an existing predicate, either for diagnostics purposes or in the new trait solver when normalizing that self type.

This PR distinguishes these two because I often want to only grep for one of them. Namely, let's call it with_replaced_self_ty when all we're doing is replacing the self type.

@rustbot

Copy link
Copy Markdown
Collaborator

r? @SparrowLii

rustbot has assigned @SparrowLii.
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

@rustbotrustbot added 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jul 30, 2025
@rustbot

Copy link
Copy Markdown
Collaborator

HIR ty lowering was modified

cc @fmease

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@SparrowLii

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Aug 4, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 2ae048e has been approved by SparrowLii

It is now in the queue for this repository.

@borsbors 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 Aug 4, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 4, 2025
…arrowLii
Distinguish prepending and replacing self ty in predicates
There are two kinds of functions called `with_self_ty`:
1. Prepends the `Self` type onto an `ExistentialPredicate` which lacks it in its internal representation.
2. Replaces the `Self` type of an existing predicate, either for diagnostics purposes or in the new trait solver when normalizing that self type.
This PR distinguishes these two because I often want to only grep for one of them. Namely, let's call it `with_replaced_self_ty` when all we're doing is replacing the self type.
This was referenced Aug 4, 2025
bors added a commit that referenced this pull request Aug 4, 2025
Rollup of 2 pull requests
Successful merges:
- #144694 (Distinguish prepending and replacing self ty in predicates)
- #144875 (Add some pre-codegen MIR tests for debug mode)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 7307dc0 into rust-lang:masterAug 4, 2025
10 checks passed
@rustbotrustbot added this to the 1.91.0 milestone Aug 4, 2025
rust-timer added a commit that referenced this pull request Aug 4, 2025
Rollup merge of #144694 - compiler-errors:with-self-ty, r=SparrowLii
Distinguish prepending and replacing self ty in predicates
There are two kinds of functions called `with_self_ty`:
1. Prepends the `Self` type onto an `ExistentialPredicate` which lacks it in its internal representation.
2. Replaces the `Self` type of an existing predicate, either for diagnostics purposes or in the new trait solver when normalizing that self type.
This PR distinguishes these two because I often want to only grep for one of them. Namely, let's call it `with_replaced_self_ty` when all we're doing is replacing the self type.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 7, 2025
…arrowLii
Distinguish prepending and replacing self ty in predicates
There are two kinds of functions called `with_self_ty`:
1. Prepends the `Self` type onto an `ExistentialPredicate` which lacks it in its internal representation.
2. Replaces the `Self` type of an existing predicate, either for diagnostics purposes or in the new trait solver when normalizing that self type.
This PR distinguishes these two because I often want to only grep for one of them. Namely, let's call it `with_replaced_self_ty` when all we're doing is replacing the self type.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-clippyRelevant to the Clippy team.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@compiler-errors@rustbot@SparrowLii@bors