Conversation
1103014 to
b881312
Compare
This comment has been minimized.
This comment has been minimized.
d0aeadc to
8806add
Compare
8806add to
52cc388
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
r? lcnr |
|
r? adwinwhite I think |
| parent_param_env, | ||
| &wf_tys, | ||
| t, | ||
| ty::Unnormalized::new_wip(t), |
There was a problem hiding this comment.
We probably don't want to have trait solving inside liveness analysis.
The types here are actually Params so they don't need normalization.
A quick solution is to have a private ty_known_to_outlive in this module, duplicated from the original impl.
A minimal param outlives evaluator would be good but we need to handle region graph. Then it's no longer minimal :<
As a micro-optimization, we can use resolve_regions_with_outlives_env rather than resolve_regions in this private helper since the wf_tys are the same. This might not matter.
| }) | ||
| let infcx = tcx.infer_ctxt().build(TypingMode::non_body_analysis()); | ||
|
|
||
| let ty = ty.skip_norm_wip(); |
There was a problem hiding this comment.
We only need to skip in the old solver branch.
| ty: Unnormalized<'tcx, Ty<'tcx>>, | ||
| region: ty::Region<'tcx>, | ||
| ) -> bool { | ||
| test_region_obligations(tcx, id, param_env, wf_tys, |infcx| { |
There was a problem hiding this comment.
we can still use test_region_obligations and just normalize the ty?
There was a problem hiding this comment.
yeah that's the part I overlooked 😬 I reused test_region_obligations here
|
Thanks for working on this! @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
This comment has been minimized.
This comment has been minimized.
|
b7361f8 to
ed266c7
Compare
This comment has been minimized.
This comment has been minimized.
ed266c7 to
66801ea
Compare
This comment has been minimized.
This comment has been minimized.
816b78c to
b1a9216
Compare
This comment has been minimized.
This comment has been minimized.
b1a9216 to
7f7e359
Compare
|
@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 non-rigid aliases in ty_known_to_outlive
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (8fb5e25): comparison URL. Overall result: no relevant changes - 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 countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary -2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 2.5%)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: 497.899s -> 498.337s (0.09%) |
|
@bors r+ rollup |
…s, r=adwinwhite Normalize non-rigid aliases in ty_known_to_outlive Fixes rust-lang#161067 `ty_known_to_outlive` directly registers a TypeOutlives region obligation without normalization. With the next solver, we do not expect non-rigid aliases in lexical region solving. Normalize non-rigid aliases before registering the obligation while avoiding trait solving for inputs that do not contain them.
Rollup of 16 pull requests Successful merges: - #161596 (coretests: Add more pattern tests.) - #162796 (libtest: do not early exit from test runners) - #162844 (Add loan reachability traces to polonius MIR dumps) - #162876 (Move operations out of `rustc_middle::query::job`) - #160108 (Stabilize `windows_process_extensions_main_thread_handle`) - #160212 (traits: Fix rigid alias liveness matching) - #160544 (Stabilize `feature(trim_prefix_suffix)` (`{str, [T], Path}::trim_prefix` and `{str, [T]}::trim_suffix`)) - #161246 (Normalize non-rigid aliases in ty_known_to_outlive) - #161305 (Use the entire type of a dropped local to compute variance (edge direction) for Polonius alpha) - #161838 (tests: accept LLVM 24 optimization in this test) - #162805 (Add `must_use` lint to `ExitCode`) - #162825 (core: Add examples for `debug_closure_helpers`) - #162841 (enable asm tests for xtensa targets) - #162842 (reintroduce check RibKind::ConstParamTy did in direct consts) - #162845 (mgca: fix issue with mismatched array valtree/valtree tys) - #162856 (Stabilize CommandExt::show_window)
| @@ -0,0 +1,17 @@ | |||
| //@ compile-flags: -Zassumptions-on-binders | |||
| //@ needs-rustc-debug-assertions | |||
| //@ normalize-stderr: "(\n)\n$" -> "$1" | |||
There was a problem hiding this comment.
why this?
There was a problem hiding this comment.
this was only normalizing an extra trailing newline in stderr
There was a problem hiding this comment.
pls remove, that doesn't feel worth it
| param_env: ty::ParamEnv<'tcx>, | ||
| wf_tys: &FxIndexSet<Ty<'tcx>>, | ||
| add_constraints: impl FnOnce(&InferCtxt<'tcx>), | ||
| add_constraints: impl FnOnce(&InferCtxt<'tcx>) -> bool, |
There was a problem hiding this comment.
maybe Result<(), ()> instead of bool?
There was a problem hiding this comment.
the bool is only being used to signal normalization failure. I think Result is clearer here
There was a problem hiding this comment.
do you want me to update this and cleanup now ?
There was a problem hiding this comment.
either now, or in a separate PR. I guess if u fix the ui test, doing it in this PR would be easier
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
7f7e359 to
c6c7dfd
Compare
|
This pull request was unapproved. This PR was contained in a rollup (#162887), which was closed. |
| wf_tys: &FxIndexSet<Ty<'tcx>>, | ||
| add_constraints: impl FnOnce(&InferCtxt<'tcx>), | ||
| add_constraints: impl FnOnce(&InferCtxt<'tcx>) -> Result<(), ()>, | ||
| ) -> bool { |
There was a problem hiding this comment.
don't have to do it in this PR, but you can also return Result here and imo should do so then you can do ?
View all comments
Fixes #161067
ty_known_to_outlivedirectly registers a TypeOutlives region obligation without normalization. With the next solver, we do not expect non-rigid aliases in lexical region solving.Normalize non-rigid aliases before registering the obligation while avoiding trait solving for inputs that do not contain them.