Skip to content

Copy over some methods from At to InferCtxt - #163978

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
fallible-algebra:at-removal/at-methods-on-infctxt
Oct 12, 2026
Merged

rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
fallible-algebra:at-removal/at-methods-on-infctxt

Conversation

@fallible-algebra

@fallible-algebra fallible-algebra commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Replaces #163448.

@lcnr wants the At struct removed, this is the first step in doing that. This change naively copies over some of the methods from At onto InferCtxt without removing any calls to InferCtxt::at or the At methods themselves.

@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 Oct 8, 2026
@rustbot

rustbot commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

r? @nnethercote

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

@fallible-algebra

Copy link
Copy Markdown
Member Author

r? lcnr

@rustbot rustbot assigned lcnr and unassigned nnethercote Oct 8, 2026
@fallible-algebra
fallible-algebra force-pushed the at-removal/at-methods-on-infctxt branch from 2904319 to 8880c1b Compare October 12, 2026 08:12
@rustbot

rustbot commented Oct 12, 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.

@lcnr

lcnr commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

hmm, this change by itself feels somewhat 🤷 would it be easier to copy these methods over one by one instead of one PR which copies the method and then having later PRs which copy these methods incrementally?

right now we have a weird intermediate state where it's unclear which of the At vs InferCtxt methods should be used, while we don't have that when incrementally copying methods over to the InferCtxt as all methods always only exist once at a time

@fallible-algebra

fallible-algebra commented Oct 12, 2026 •

Copy link
Copy Markdown
Member Author

I'd rather copy the methods in this module all at once, then start picking out the use of At methods individually shortly afterwards. Could mark the At methods as soft-depreciated in their doc comments?

@lcnr

lcnr commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

sure, I guess, please add a "FIXME: Should be removed in favor of the methods directly on InferCtxt"

Comment thread compiler/rustc_infer/src/infer/at.rs Outdated
/// call like `foo(x)`, where `foo: fn(i32)`, you might have
/// `sup(i32, x)`, since the "expected" type is the type that
/// appears in the signature.
pub fn sup<T>(

@lcnr lcnr Oct 12, 2026 •

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 feel like we may want to name all these functions X_raw with a comment that one should prefer the wrappers on either ObligationCtxt, FnCtxt or rustc_borrowck::TypeChecker when available

View changes since the review

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.

yeah 🤔 please do that

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will do :)

@lcnr

lcnr commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 031d65a has been tentatively approved by lcnr

It will be put into the queue for this repository once PR CI succeeds.

@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 Oct 12, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 12, 2026
…hods-on-infctxt, r=lcnr

Copy over some methods from At to InferCtxt

Replaces rust-lang#163448.

@lcnr wants the `At` struct removed, this is the first step in doing that. This change naively copies over some of the methods from `At` onto `InferCtxt` without removing any calls to `InferCtxt::at` or the `At` methods themselves.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 12, 2026
…hods-on-infctxt, r=lcnr

Copy over some methods from At to InferCtxt

Replaces rust-lang#163448.

@lcnr wants the `At` struct removed, this is the first step in doing that. This change naively copies over some of the methods from `At` onto `InferCtxt` without removing any calls to `InferCtxt::at` or the `At` methods themselves.
rust-bors Bot pushed a commit that referenced this pull request Oct 12, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #164196 (`rust-analyzer` subtree update)
 - #164037 (Restrict application of optimization attributes from instance)
 - #164201 (Improve `--bless` output for `tests/debuginfo`)
 - #164202 ([rustdoc] Move the creation of `IndividualTestOptions` into the test runner closure to ensure the temporary folder is removed right after the test is done running)
 - #162140 (fn_addr_eq: we actually can guarantee basically nothing)
 - #163946 (Fix transmutability type mismatch bug)
 - #163978 (Copy over some methods from At to InferCtxt)
 - #164045 (-Zassumptions-on-binders: replace region vars with bound vars when handling alias outlives')
@rust-bors
rust-bors Bot merged commit e1d10f3 into rust-lang:main Oct 12, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 12, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 12, 2026
Rollup merge of #163978 - fallible-algebra:at-removal/at-methods-on-infctxt, r=lcnr

Copy over some methods from At to InferCtxt

Replaces #163448.

@lcnr wants the `At` struct removed, this is the first step in doing that. This change naively copies over some of the methods from `At` onto `InferCtxt` without removing any calls to `InferCtxt::at` or the `At` methods themselves.
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.

4 participants