Skip to content

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented Oct 6, 2025

r? @ghost

Late sync. Was at Oktoberfest on Thursday and then forgot to do it over the long weekend in Germany.

changelog: none

m-ou-se and others added 17 commits August 26, 2025 15:54
Clean up `ty::Dynamic`

1. As a follow-up to PR rust-lang/rust#143036, remove `DynKind` entirely.
2. Inside HIR ty lowering, consolidate modules `dyn_compatibility` and `lint` into `dyn_trait`
   * `dyn_compatibility` wasn't about dyn compatibility itself, it's about lowering trait object types
   * `lint` contained dyn-Trait-specific diagnostics+lints only
I.e. do not mark them as used, or non-speculative loaded, or similar.
Previously they were sometimes finalized during early resolution, causing issues like rust-lang/rust#144793 (comment).
Extended temporary argument to format_args!() in all cases

Fixes rust-lang/rust#145880 by removing the special case.
resolve: Do not finalize shadowed bindings

I.e. do not mark them as used, or non-speculatively loaded, or similar.
Previously they were sometimes finalized during early resolution, causing issues like rust-lang/rust#144793 (comment).
Much of the compiler calls functions on Align projected from AbiAlign.
AbiAlign impls Deref to its inner Align, so we can simplify these away.
Also, it will minimize disruption when AbiAlign is removed.

For now, preserve usages that might resolve to PartialOrd or PartialEq,
as those have odd inference.
Turn ProjectionElem::Subtype into CastKind::Subtype

I noticed that drop elaboration can't, in general, handle `ProjectionElem::SubType`. It creates a disjoint move path that overlaps with other move paths. (`Subslice` does too, and I'm working on a different PR to make that special case less fragile.) If its skipped and treated as the same move path as its parent then `MovePath.place` has multiple possible projections. (It would probably make sense to remove all `Subtype` projections for the canonical place but it doesn't make sense to have this special case for a problem that doesn't actually occur in real MIR.)

The only reason this doesn't break is that `Subtype` is always the sole projection of the local its applied to. For the same reason, it works fine as a `CastKind` so I figured that makes more sense than documenting and validating this hidden invariant.

cc rust-lang/rust#112651, rust-lang/rust#133258

r? Icnr (bc you've been the main person dealing with `Subtype` it looks like)
Split Bound index into Canonical and Bound

See [#t-types/trait-system-refactor > perf &rust-lang#96;async-closures/post-mono-higher-ranked-hang.rs&rust-lang#96;](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/perf.20.60async-closures.2Fpost-mono-higher-ranked-hang.2Ers.60/with/541535613) for context

Things compile and tests pass, but not sure if this actually solves the perf issue (edit: it does). Opening up this to do a perf (and maybe crater) run.

r? lcnr
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 6, 2025
@flip1995 flip1995 enabled auto-merge October 6, 2025 15:28
@flip1995 flip1995 added this pull request to the merge queue Oct 6, 2025
Copy link

github-actions bot commented Oct 6, 2025

Lintcheck changes for 085ddaa

Lint Added Removed Changed
clippy::incompatible_msrv 6 6 0
clippy::missing_trait_methods 0 0 41210
clippy::useless_conversion 0 0 3

This comment will be updated if you push new changes

Merged via the queue into rust-lang:master with commit 2dc84cb Oct 6, 2025
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.