Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Greatly simplify lifetime captures in edition 2024 #137334

Merged
merged 1 commit into from
Feb 23, 2025

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Feb 20, 2025

Remove most of the + Captures and + '_ from the compiler, since they are now unnecessary with the new edition 2021 lifetime capture rules. Use some + 'tcx and + 'static rather than being overly verbose with precise capturing syntax.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Feb 20, 2025
@bors
Copy link
Contributor

bors commented Feb 22, 2025

☔ The latest upstream changes (presumably #137397) made this pull request unmergeable. Please resolve the merge conflicts.

@compiler-errors compiler-errors force-pushed the edition-2024-fresh-2 branch 3 times, most recently from f55a571 to e94d539 Compare February 22, 2025 19:05
@compiler-errors compiler-errors marked this pull request as ready for review February 22, 2025 19:07
@rustbot
Copy link
Collaborator

rustbot commented Feb 22, 2025

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri, @rust-lang/wg-const-eval

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in need_type_info.rs

cc @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

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

cc @rust-lang/rust-analyzer

Some changes occurred to the core trait solver

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

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

Some changes occurred in exhaustiveness checking

cc @Nadrieril

This PR changes Stable MIR

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

Some changes occurred to the CTFE machinery

cc @rust-lang/wg-const-eval

Some changes occurred in coverage instrumentation.

cc @Zalathar

@compiler-errors
Copy link
Member Author

r? compiler

@saethlin
Copy link
Member

r? saethlin
r=me when CI is green

How many uses of Captures are left?

@rustbot rustbot assigned saethlin and unassigned SparrowLii Feb 22, 2025
@compiler-errors
Copy link
Member Author

compiler-errors commented Feb 22, 2025

  1. usages in rust-analyzer which isn't yet migrated to edition 2024, which imports Captures through the pattern analysis crate.
  2. usages in librustdoc which isn't yet migrated to edition 2024, which imports Captures through the data structures crate.

The only change I did to rust-analyzer here was to remove the redundant RPITIT lifetimes.

@compiler-errors
Copy link
Member Author

@bors r=saethlin,traviscross

@bors
Copy link
Contributor

bors commented Feb 22, 2025

📌 Commit 12e3911 has been approved by saethlin,traviscross

It is now in the queue for this repository.

@bors bors 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. S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Feb 22, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 23, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang#135354 ([Debuginfo] Add MSVC Synthetic and Summary providers to LLDB)
 - rust-lang#136826 (Replace mem::zeroed with mem::MaybeUninit::uninit for large struct in Unix)
 - rust-lang#137194 (More const {} init in thread_local)
 - rust-lang#137334 (Greatly simplify lifetime captures in edition 2024)
 - rust-lang#137382 (bootstrap: add doc for vendor build step)
 - rust-lang#137423 (Improve a bit HIR pretty printer)
 - rust-lang#137435 (Fix "missing match arm body" suggestion involving `!`)
 - rust-lang#137448 (Fix bugs due to unhandled `ControlFlow` in compiler)
 - rust-lang#137458 (Fix missing self subst when rendering `impl Fn*<T>` with no output type)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7f14d2e into rust-lang:master Feb 23, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Feb 23, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 23, 2025
Rollup merge of rust-lang#137334 - compiler-errors:edition-2024-fresh-2, r=saethlin,traviscross

Greatly simplify lifetime captures in edition 2024

Remove most of the `+ Captures` and `+ '_` from the compiler, since they are now unnecessary with the new edition 2021 lifetime capture rules. Use some `+ 'tcx` and `+ 'static` rather than being overly verbose with precise capturing syntax.
@Veykril
Copy link
Member

Veykril commented Feb 23, 2025

usages in rust-analyzer which isn't yet migrated to edition 2024, which imports Captures through the pattern analysis crate.

We'll migrate in ~4 weeks fwiw (we try not to immediately bump our MSRV to latest when a new stable releases)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations 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. 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.

7 participants