Uh oh!
There was an error while loading. Please reload this page.
Consider structurally impossible Sized predicates in MIR - #156609
Conversation
rustbot
commented
May 15, 2026
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
rustbot
commented
May 15, 2026
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
qaijuang
commented
May 15, 2026
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
5672c89 to
eeacc59Comparerustbot
commented
Jun 13, 2026
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. |
This comment has been minimized.
This comment has been minimized.
eeacc59 to
f86ad47Compareqaijuang
commented
Jul 10, 2026
Hi @TaKO8Ki are there any blockers on this PR that i should know? |
qaijuang
commented
Jul 13, 2026
Safe to @rustbot reroll |
petrochenkov
commented
Jul 13, 2026
@rustbot reroll |
TaKO8Ki
commented
Jul 13, 2026
Sorry for the delay, I completely overlooked this PR and your ping because I got a lot of notifications. @bors r+ rollup r? TaKO8Ki |
…predicates, r=TaKO8Ki Consider structurally impossible Sized predicates in MIR Fixesrust-lang#156051 `ImpossiblePredicates` filters predicates mentioning local generics before invoking the trait solver, which avoids normalization and solver work in generic contexts, thereby skipping predicates such as `dyn Trait<T>: Sized`, even though they are impossible for every substitution. This PR adds a narrow structural fast path for positive `Sized` predicates whose self type is known-unsized without normalization, letting the pass clear unreachable bodies before later MIR opts can evaluate `SizedTypeProperties` constants such as `size_of::<Self>()`.
…uwer Rollup of 13 pull requests Successful merges: - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets) - #157706 (Deny `todo!()` in tidy) - #156712 (Pointer authentication config and user facing options) - #158535 (Support `#[track_caller]` on EII declarations) - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - #159002 (Small refactorings in `need_type_info` module) - #159202 (Bump rustc-demangle to 0.1.28) - #159216 (Avoid using probe self_ty for delegation arguments) - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too) - #156609 (Consider structurally impossible Sized predicates in MIR) - #158854 (Add `#[rustc_test_entrypoint_marker]`) - #158998 (Some minor ast validation and visiting cleanups) - #159123 (doc: clarify attr parser APIs)
…predicates, r=TaKO8Ki Consider structurally impossible Sized predicates in MIR Fixesrust-lang#156051 `ImpossiblePredicates` filters predicates mentioning local generics before invoking the trait solver, which avoids normalization and solver work in generic contexts, thereby skipping predicates such as `dyn Trait<T>: Sized`, even though they are impossible for every substitution. This PR adds a narrow structural fast path for positive `Sized` predicates whose self type is known-unsized without normalization, letting the pass clear unreachable bodies before later MIR opts can evaluate `SizedTypeProperties` constants such as `size_of::<Self>()`.
…uwer Rollup of 14 pull requests Successful merges: - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets) - #157706 (Deny `todo!()` in tidy) - #158535 (Support `#[track_caller]` on EII declarations) - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - #158846 (Fix unused variable warnings for diverging expressions) - #159002 (Small refactorings in `need_type_info` module) - #159202 (Bump rustc-demangle to 0.1.28) - #159216 (Avoid using probe self_ty for delegation arguments) - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too) - #156609 (Consider structurally impossible Sized predicates in MIR) - #157993 (Expose more info about ADTs and functions in rustc_public) - #158854 (Add `#[rustc_test_entrypoint_marker]`) - #158998 (Some minor ast validation and visiting cleanups) - #159123 (doc: clarify attr parser APIs)
…predicates, r=TaKO8Ki Consider structurally impossible Sized predicates in MIR Fixesrust-lang#156051 `ImpossiblePredicates` filters predicates mentioning local generics before invoking the trait solver, which avoids normalization and solver work in generic contexts, thereby skipping predicates such as `dyn Trait<T>: Sized`, even though they are impossible for every substitution. This PR adds a narrow structural fast path for positive `Sized` predicates whose self type is known-unsized without normalization, letting the pass clear unreachable bodies before later MIR opts can evaluate `SizedTypeProperties` constants such as `size_of::<Self>()`.
…uwer Rollup of 15 pull requests Successful merges: - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets) - #157706 (Deny `todo!()` in tidy) - #156047 (Fix trait method resolution on an adjusted never type) - #158535 (Support `#[track_caller]` on EII declarations) - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - #158846 (Fix unused variable warnings for diverging expressions) - #159002 (Small refactorings in `need_type_info` module) - #159202 (Bump rustc-demangle to 0.1.28) - #159216 (Avoid using probe self_ty for delegation arguments) - #156609 (Consider structurally impossible Sized predicates in MIR) - #157993 (Expose more info about ADTs and functions in rustc_public) - #158804 (Clarify `as_uninit_mut` may point to uninitialized memory) - #158854 (Add `#[rustc_test_entrypoint_marker]`) - #158998 (Some minor ast validation and visiting cleanups) - #159123 (doc: clarify attr parser APIs)
…uwer Rollup of 13 pull requests Successful merges: - #157706 (Deny `todo!()` in tidy) - #158535 (Support `#[track_caller]` on EII declarations) - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - #158846 (Fix unused variable warnings for diverging expressions) - #159002 (Small refactorings in `need_type_info` module) - #159202 (Bump rustc-demangle to 0.1.28) - #159216 (Avoid using probe self_ty for delegation arguments) - #156609 (Consider structurally impossible Sized predicates in MIR) - #157993 (Expose more info about ADTs and functions in rustc_public) - #158804 (Clarify `as_uninit_mut` may point to uninitialized memory) - #158854 (Add `#[rustc_test_entrypoint_marker]`) - #158998 (Some minor ast validation and visiting cleanups) - #159123 (doc: clarify attr parser APIs)
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #156609 - qaijuang:mir-opt-impossible-sized-predicates, r=TaKO8Ki Consider structurally impossible Sized predicates in MIR Fixes#156051 `ImpossiblePredicates` filters predicates mentioning local generics before invoking the trait solver, which avoids normalization and solver work in generic contexts, thereby skipping predicates such as `dyn Trait<T>: Sized`, even though they are impossible for every substitution. This PR adds a narrow structural fast path for positive `Sized` predicates whose self type is known-unsized without normalization, letting the pass clear unreachable bodies before later MIR opts can evaluate `SizedTypeProperties` constants such as `size_of::<Self>()`.
…uwer Rollup of 13 pull requests Successful merges: - rust-lang/rust#157706 (Deny `todo!()` in tidy) - rust-lang/rust#158535 (Support `#[track_caller]` on EII declarations) - rust-lang/rust#158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - rust-lang/rust#158846 (Fix unused variable warnings for diverging expressions) - rust-lang/rust#159002 (Small refactorings in `need_type_info` module) - rust-lang/rust#159202 (Bump rustc-demangle to 0.1.28) - rust-lang/rust#159216 (Avoid using probe self_ty for delegation arguments) - rust-lang/rust#156609 (Consider structurally impossible Sized predicates in MIR) - rust-lang/rust#157993 (Expose more info about ADTs and functions in rustc_public) - rust-lang/rust#158804 (Clarify `as_uninit_mut` may point to uninitialized memory) - rust-lang/rust#158854 (Add `#[rustc_test_entrypoint_marker]`) - rust-lang/rust#158998 (Some minor ast validation and visiting cleanups) - rust-lang/rust#159123 (doc: clarify attr parser APIs)
Kobzol
commented
Jul 21, 2026
@rust-timer build 25028da For #159246. |
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Jul 21, 2026
Finished benchmarking commit (25028da): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 2.4%, secondary -20.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -14.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 488.117s -> 486.539s (-0.32%) |
…uwer Rollup of 13 pull requests Successful merges: - rust-lang/rust#157706 (Deny `todo!()` in tidy) - rust-lang/rust#158535 (Support `#[track_caller]` on EII declarations) - rust-lang/rust#158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - rust-lang/rust#158846 (Fix unused variable warnings for diverging expressions) - rust-lang/rust#159002 (Small refactorings in `need_type_info` module) - rust-lang/rust#159202 (Bump rustc-demangle to 0.1.28) - rust-lang/rust#159216 (Avoid using probe self_ty for delegation arguments) - rust-lang/rust#156609 (Consider structurally impossible Sized predicates in MIR) - rust-lang/rust#157993 (Expose more info about ADTs and functions in rustc_public) - rust-lang/rust#158804 (Clarify `as_uninit_mut` may point to uninitialized memory) - rust-lang/rust#158854 (Add `#[rustc_test_entrypoint_marker]`) - rust-lang/rust#158998 (Some minor ast validation and visiting cleanups) - rust-lang/rust#159123 (doc: clarify attr parser APIs)
…uwer Rollup of 13 pull requests Successful merges: - rust-lang/rust#157706 (Deny `todo!()` in tidy) - rust-lang/rust#158535 (Support `#[track_caller]` on EII declarations) - rust-lang/rust#158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - rust-lang/rust#158846 (Fix unused variable warnings for diverging expressions) - rust-lang/rust#159002 (Small refactorings in `need_type_info` module) - rust-lang/rust#159202 (Bump rustc-demangle to 0.1.28) - rust-lang/rust#159216 (Avoid using probe self_ty for delegation arguments) - rust-lang/rust#156609 (Consider structurally impossible Sized predicates in MIR) - rust-lang/rust#157993 (Expose more info about ADTs and functions in rustc_public) - rust-lang/rust#158804 (Clarify `as_uninit_mut` may point to uninitialized memory) - rust-lang/rust#158854 (Add `#[rustc_test_entrypoint_marker]`) - rust-lang/rust#158998 (Some minor ast validation and visiting cleanups) - rust-lang/rust#159123 (doc: clarify attr parser APIs)
Fixes#156051
ImpossiblePredicatesfilters predicates mentioning local generics before invoking the trait solver, which avoids normalization and solver work in generic contexts, thereby skipping predicates such asdyn Trait<T>: Sized, even though they are impossible for every substitution.This PR adds a narrow structural fast path for positive
Sizedpredicates whose self type is known-unsized without normalization, letting the pass clear unreachable bodies before later MIR opts can evaluateSizedTypePropertiesconstants such assize_of::<Self>().