Skip to content

Next steps for FnDef binder changes (instantiate most FnDef binders) - #159403

Open
addiesh wants to merge 1 commit into
rust-lang:mainfrom
addiesh:call-me-turbofishmael
Open

Next steps for FnDef binder changes (instantiate most FnDef binders)#159403
addiesh wants to merge 1 commit into
rust-lang:mainfrom
addiesh:call-me-turbofishmael

Conversation

@addiesh

@addiesh addiesh commented Jul 16, 2026

Copy link
Copy Markdown

View all comments

This change is a part of the ongoing effort to clean up binder/turbofishing behavior in the compiler (#156581).

This PR instantiates binders that were previously created via ty::Binder::dummy() with meaningfully bound vars.

r? oli-obk

Call me Turbofishmael.
Some years ago- never mind how long precisely-
having little or no money in my purse,
and nothing particular to interest me in C++,
I thought I would sail about a little and see the rusty part of the world.

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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 16, 2026
@rustbot

rustbot commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @oli-obk (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@addiesh
addiesh force-pushed the call-me-turbofishmael branch 3 times, most recently from 014b214 to d780036 Compare July 16, 2026 19:40
@rust-log-analyzer

This comment has been minimized.

@addiesh

This comment was marked as resolved.

@addiesh
addiesh force-pushed the call-me-turbofishmael branch from d780036 to 6e740ba Compare July 16, 2026 20:10
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@addiesh
addiesh force-pushed the call-me-turbofishmael branch from 330681e to 83e428c Compare July 17, 2026 15:14
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@addiesh
addiesh force-pushed the call-me-turbofishmael branch from 9fb9767 to 3920a9e Compare July 17, 2026 22:34
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@addiesh
addiesh force-pushed the call-me-turbofishmael branch from 5373d53 to f118249 Compare July 20, 2026 15:15
@rust-log-analyzer

This comment has been minimized.

@addiesh
addiesh force-pushed the call-me-turbofishmael branch from f118249 to 6aeb29e Compare July 20, 2026 15:28
@rust-log-analyzer

This comment has been minimized.

@addiesh
addiesh force-pushed the call-me-turbofishmael branch from 6aeb29e to ac8e8e5 Compare July 20, 2026 15:33
@addiesh
addiesh marked this pull request as ready for review July 20, 2026 15:48
rust-timer added a commit that referenced this pull request Jul 28, 2026
Rollup merge of #159665 - addiesh:turbofish-fear-me, r=oli-obk

Replace most `Ty::new_fn_def` calls with `type_of` queries directly

This is so we can reduce the amount of code and changes in #159403. It should stand on its own, but really it's meant as an extended part of 159403.

This allows getting the right `ty::FnDef` even cross-crate, as the `type_of` query results are stored in metadata, in contrast to the queries for computing the binder for various declarations. These binders are already cached via `fn_sig`, but using that is somewhat overkill and can cause cycle errors in some cases.
@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the core trait solver

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

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

cc @jdonszelmann, @JonathanBrouwer

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 in coverage instrumentation.

cc @Zalathar

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

This PR changes rustc_public

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

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

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

cc @antoyo, @GuillaumeGomez

Some changes occurred in GUI tests.

cc @GuillaumeGomez

Some changes occurred to diagnostic attributes.

cc @mejrs

changes to the core type system

cc @lcnr

This PR modifies bootstrap.example.toml.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

Some changes occurred in const_evaluatable.rs

cc @BoxyUwU

Some changes occurred in compiler/rustc_hir/src/attrs

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure 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. labels Jul 29, 2026
@addiesh
addiesh force-pushed the call-me-turbofishmael branch from 1047fdb to d8350cc Compare July 29, 2026 14:33
@rustbot

This comment has been minimized.

@addiesh

This comment was marked as resolved.

@addiesh addiesh Jul 20, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

this """"fixed"""" issue #133613, but the errors are absolutely nasty and it uses experimental features. This is worth checking out.

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.

it's being fixed properly in #159958

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.

This issue has been fixed correctly on main now, so after a rebase your PR should not affect it anymore

@addiesh
addiesh force-pushed the call-me-turbofishmael branch from d8350cc to 85d2121 Compare July 29, 2026 14:52
@rustbot

rustbot commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

Some changes occurred in tests/codegen-llvm/sanitizer

cc @rcvalle

Warning

If you are changing how CI LLVM is built or linked, make sure to bump
src/bootstrap/download-ci-llvm-stamp.

cc @jieyouxu

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

cc @calebzulawski, @programmerjake

The reflection data structures are tied exactly to the implementation
in the compiler. Make sure to also adjust rustc_const_eval/src/const_eval/type_info.rs

cc @oli-obk

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging.

cc @davidtwco, @BoxyUwU

Some changes occurred in src/tools/cargo

cc @weihanglo

Some changes occurred in compiler/rustc_sanitizers

cc @rcvalle

The run-make-support library was changed

cc @jieyouxu

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @lolbinarycat

@rustbot rustbot added A-rustdoc-js Area: Rustdoc's JS front-end A-tidy Area: The tidy tool O-windows Operating system: Windows labels Jul 31, 2026
@rustbot

This comment has been minimized.

@addiesh

addiesh commented Jul 31, 2026

Copy link
Copy Markdown
Author

ohhh no

@GuillaumeGomez

Copy link
Copy Markdown
Member

git reflog will be your friend here. 😉

@addiesh
addiesh force-pushed the call-me-turbofishmael branch from 79d03c1 to 85d2121 Compare July 31, 2026 15:35
@addiesh
addiesh force-pushed the call-me-turbofishmael branch from 85d2121 to 71f6804 Compare July 31, 2026 15:36
@rustbot

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-js Area: Rustdoc's JS front-end A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool O-unix Operating system: Unix-like O-windows Operating system: Windows perf-regression Performance regression. PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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. 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.

6 participants