Make (try_)subst_and_normalize_erasing_regions take EarlyBinder#110297
Make (try_)subst_and_normalize_erasing_regions take EarlyBinder#110297bors merged 4 commits intorust-lang:masterfrom
(try_)subst_and_normalize_erasing_regions take EarlyBinder#110297Conversation
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
There was a problem hiding this comment.
So, seems like the subst_identity().skip_binder() call to create this isn't correct...
There was a problem hiding this comment.
Hmm, yeah I agree that this looks weird now. Would it be better as skip_binder().skip_binder()? Or are you envisioning a larger change here?
There was a problem hiding this comment.
I have to look a bit more at this. But likely the easiest thing is to either just leave it as-is with a comment, or map/skip_binder above.
There was a problem hiding this comment.
Ah okay thanks! I changed it to skip_binder() above in the most recent commit, but happy to try to improve it further.
Yeah, I also thought about mapping it, it seems like we always skip the inner Binder there but want to keep the EarlyBinder around, so could do something like
let fn_sig = cx.tcx.fn_sig(def_id).map_bound(|t| t.skip_binder());(and then replace the calls to .inputs() with .skip_binder().inputs())
but I wasn't sure if this was more or less readable than how it is now
There was a problem hiding this comment.
I think this PR doesn't necessarily need to fix this, at minimum we should probably open a clippy issue about it and add a FIXME before this PR lands
823b771 to
7753208
Compare
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
|
☔ The latest upstream changes (presumably #96840) made this pull request unmergeable. Please resolve the merge conflicts. |
7753208 to
8f57d5b
Compare
|
I will r+ this once its been rebased again, that |
… skip_binder in mir subst methods
8f57d5b to
d27f401
Compare
|
Hi @BoxyUwU, thanks for taking a look! Sorry, I've also been busy recently and sort of forgot about this PR 😅 I rebased and added the FIXME as you suggested, the |
|
@bors r+ |
Rollup of 7 pull requests Successful merges: - rust-lang#110297 (Make `(try_)subst_and_normalize_erasing_regions` take `EarlyBinder`) - rust-lang#110827 (Fix lifetime suggestion for type aliases with objects in them) - rust-lang#111022 (Use smaller ints for bitflags) - rust-lang#111056 (Fix some suggestions where a `Box<T>` is expected.) - rust-lang#111262 (Further normalize msvc-non-utf8-ouput) - rust-lang#111265 (Make generics_of has_self on RPITITs delegate to the opaque) - rust-lang#111323 (Give a more helpful error when running the rustc shim directly) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Changes
subst_and_normalize_erasing_regionsandtry_subst_and_normalize_erasing_regionsto takeEarlyBinder<T>instead ofT.(related to #105779)
This was suggested by @BoxyUwU in #107753 (comment). After changing
type_ofto returnEarlyBinder, there were several places where the binder was immediately skipped to calltcx.subst_and_normalize_erasing_regions, only for the binder to be reconstructed inside of that method.r? @BoxyUwU