normalize in relations, not generalize, when relating infer with alias - #160443
Conversation
|
changes to the core type system cc @lcnr |
This comment has been minimized.
This comment has been minimized.
04d970b to
7ca8a78
Compare
| self.param_env(), | ||
| ty::ProjectionPredicate { projection_term: alias.into(), term: new_var.into() }, | ||
| )]); | ||
| self.tys(new_var, b)?; |
There was a problem hiding this comment.
that one is cool as it means for non-rigid eq non-rigid we emit two projection goals right away, for const aliases we currently do Projection(non-rigid, other-non-rigid). THinking whether creating a const infer var and then relating that would be better, even if for consts it's not strictly required as they are always equated, so no subtyping
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
normalize in relations, not generalize, when relating infer with alias
7ca8a78 to
ad05b23
Compare
| mut structurally_normalize: impl FnMut(Ty<'tcx>) -> Ty<'tcx>, | ||
| mut handle_field: impl FnMut(Ty<'tcx>, Option<VariantIdx>, FieldIdx, T) -> Ty<'tcx>, | ||
| // FIXME(#155345): This should only normalize when actually required. | ||
| mut structurally_normalize: impl FnMut(Unnormalized<'tcx, Ty<'tcx>>) -> Ty<'tcx>, |
There was a problem hiding this comment.
rename to normalize :> nothing structural about this anymore
| } | ||
| } | ||
| Ok(a) | ||
| panic!("Non-rigid aliases should be handled in the caller of super_combine_tys") |
There was a problem hiding this comment.
| panic!("Non-rigid aliases should be handled in the caller of super_combine_tys") | |
| panic!("non-rigid aliases should be handled in the caller of super_combine_tys") |
ad05b23 to
3dc2ef8
Compare
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (0721d75): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression 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 0.1%, secondary -0.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.2%, secondary 0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (secondary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 489.838s -> 490.783s (0.19%) |
|
@bors r=lcnr |
…ns, r=lcnr normalize in relations, not generalize, when relating infer with alias This removes the wonky `<?0 as Trait>::Assoc == ?0` handling in generalize, as the alias will be normalized before generalization gets invoked. (... in the new solver, the old solver is not touched). My gut feeling is that change is potentially minorly perf-sensitive I think, I've had perf impacts here before, and we're slightly changing the way aliases are handled - especially invariant relations now generate an extra var then immediately do a `equate_ty_vids_raw`, it short-circuited before. r? lcnr
…uwer Rollup of 22 pull requests Successful merges: - #160426 (`rust-analyzer` subtree update) - #160372 (Derive the allocator used by tools from rustc's allocator) - #146882 (fully deprecate the legacy integral modules) - #158727 (std: use `readdir` on nearly all UNIX platforms) - #159727 (Various steps in moving away from the big reflection enum to reflection functions) - #160443 (normalize in relations, not generalize, when relating infer with alias) - #160457 (implement -Zllvm-target-feature) - #160480 (Single-pass ASCII lower/upper case conversion) - #160502 (Reduce number of miri tests executed on PR CI) - #157430 (std::random: use little-endian for reproducibility) - #158110 (fix macro attribute feature-gate span) - #159975 (Use real ThinVec in StmtDebugInfos) - #160001 (Suggest mutable method when iterating over binding) - #160024 (Fix mono reachability with no-op landing pads) - #160154 (Add regression test for HRTB associated type projection closure) - #160176 (No more `tests/ui/issues`!) - #160326 (Remove hidden_glob_reexports) - #160407 (Add regression tests for a number of ICEs and diagnostics issues labelled `E-needs-test`) - #160430 (bootstrap: Don't produce mutated/filtered PathSets during command-line matching) - #160472 (Minor fixes to `core::io` & `alloc::io` Documentation) - #160486 (Remove unused `FreeRegionsVisitor`) - #160496 (clarify non-determinism docs for algebraic operations) Failed merges: - #160501 (Add bootstrap CLI snapshot test for testing miri)
Rollup merge of #160443 - khyperia:move-normalize-to-relations, r=lcnr normalize in relations, not generalize, when relating infer with alias This removes the wonky `<?0 as Trait>::Assoc == ?0` handling in generalize, as the alias will be normalized before generalization gets invoked. (... in the new solver, the old solver is not touched). My gut feeling is that change is potentially minorly perf-sensitive I think, I've had perf impacts here before, and we're slightly changing the way aliases are handled - especially invariant relations now generate an extra var then immediately do a `equate_ty_vids_raw`, it short-circuited before. r? lcnr
…uwer Rollup of 22 pull requests Successful merges: - rust-lang/rust#160426 (`rust-analyzer` subtree update) - rust-lang/rust#160372 (Derive the allocator used by tools from rustc's allocator) - rust-lang/rust#146882 (fully deprecate the legacy integral modules) - rust-lang/rust#158727 (std: use `readdir` on nearly all UNIX platforms) - rust-lang/rust#159727 (Various steps in moving away from the big reflection enum to reflection functions) - rust-lang/rust#160443 (normalize in relations, not generalize, when relating infer with alias) - rust-lang/rust#160457 (implement -Zllvm-target-feature) - rust-lang/rust#160480 (Single-pass ASCII lower/upper case conversion) - rust-lang/rust#160502 (Reduce number of miri tests executed on PR CI) - rust-lang/rust#157430 (std::random: use little-endian for reproducibility) - rust-lang/rust#158110 (fix macro attribute feature-gate span) - rust-lang/rust#159975 (Use real ThinVec in StmtDebugInfos) - rust-lang/rust#160001 (Suggest mutable method when iterating over binding) - rust-lang/rust#160024 (Fix mono reachability with no-op landing pads) - rust-lang/rust#160154 (Add regression test for HRTB associated type projection closure) - rust-lang/rust#160176 (No more `tests/ui/issues`!) - rust-lang/rust#160326 (Remove hidden_glob_reexports) - rust-lang/rust#160407 (Add regression tests for a number of ICEs and diagnostics issues labelled `E-needs-test`) - rust-lang/rust#160430 (bootstrap: Don't produce mutated/filtered PathSets during command-line matching) - rust-lang/rust#160472 (Minor fixes to `core::io` & `alloc::io` Documentation) - rust-lang/rust#160486 (Remove unused `FreeRegionsVisitor`) - rust-lang/rust#160496 (clarify non-determinism docs for algebraic operations) Failed merges: - rust-lang/rust#160501 (Add bootstrap CLI snapshot test for testing miri)
This removes the wonky
<?0 as Trait>::Assoc == ?0handling in generalize, as the alias will be normalized before generalization gets invoked. (... in the new solver, the old solver is not touched).My gut feeling is that change is potentially minorly perf-sensitive I think, I've had perf impacts here before, and we're slightly changing the way aliases are handled - especially invariant relations now generate an extra var then immediately do a
equate_ty_vids_raw, it short-circuited before.r? lcnr