Skip to content

Greatly simplify lifetime captures in edition 2024 - #137334

Merged
bors merged 1 commit into
rust-lang:masterfrom
compiler-errors:edition-2024-fresh-2
Feb 23, 2025
Merged

Greatly simplify lifetime captures in edition 2024#137334
bors merged 1 commit into
rust-lang:masterfrom
compiler-errors:edition-2024-fresh-2

Conversation

@compiler-errors

@compiler-errorscompiler-errors commented Feb 20, 2025

Copy link
Copy Markdown
Contributor

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.

@rustbotrustbot 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

bors commented Feb 22, 2025

Copy link
Copy Markdown
Collaborator

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

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

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
ContributorAuthor

r? compiler

@saethlin

Copy link
Copy Markdown
Member

r? saethlin
r=me when CI is green

How many uses of Captures are left?

@rustbotrustbot assigned saethlin and unassigned SparrowLiiFeb 22, 2025
@compiler-errors

compiler-errors commented Feb 22, 2025

Copy link
Copy Markdown
ContributorAuthor
  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.

Comment threadcompiler/rustc_borrowck/src/region_infer/values.rs Outdated
Comment threadcompiler/rustc_borrowck/src/region_infer/values.rs Outdated
Comment threadcompiler/rustc_borrowck/src/universal_regions.rs
Comment threadcompiler/rustc_borrowck/src/universal_regions.rs
@compiler-errors

Copy link
Copy Markdown
ContributorAuthor

@bors r=saethlin,traviscross

@bors

bors commented Feb 22, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 12e3911 has been approved by saethlin,traviscross

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. S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Feb 22, 2025
@jhprattjhpratt mentioned this pull request Feb 23, 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:masterFeb 23, 2025
@rustbotrustbot 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
Copy Markdown
Member

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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)A-query-systemArea: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)A-translationArea: Translation infrastructure, and migrating existing diagnostics to SessionDiagnosticPG-exploit-mitigationsProject group: Exploit mitigationsS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.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.

7 participants

@compiler-errors@bors@rustbot@saethlin@Veykril@traviscross@SparrowLii