-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
normalize adt fields during structural match checking #72897
Conversation
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
383ee81
to
4725af3
Compare
Apparently this works even if I believe it shouldn't... edit: I think this is ok as we only check if consts are structurally matchable (at least on stable), which should always be fully monomorphic. |
@@ -251,7 +251,10 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for Search<'a, 'tcx> { | |||
// fields of ADT. | |||
let tcx = self.tcx(); | |||
for field_ty in adt_def.all_fields().map(|field| field.ty(tcx, substs)) { | |||
if field_ty.visit_with(self) { | |||
let ty = self.tcx().normalize_erasing_regions(ty::ParamEnv::empty(), field_ty); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty::Param::empty()
is incorrect - frankly I wonder if we should remove it.
You should have a ParamEnv
around.
(couple minutes later)
Hang on, this entire file is missing real ParamEnv
s?
That's liable to cause ICEs if generic parameters end up in these types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this block this PR? Afaik it's currently not possible on stable to hit this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may go ahead and fix this afterwards, but my current priority is mainly to fix #72896
Which probably means that we have to backport this to beta.
Another option would be to revert the structural match check for projections 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its probably my fault that we don't have ParamEnv
s threaded through here. This whole thing of switching from attributes to traits has been a real rabbit hole.
Still, I think landing this is better than reverting the structural match check for projections.
@bors r+ Lets land this band-aid now, even with the |
📌 Commit 4725af3 has been approved by |
Should this PR be backported to beta? |
@bors rollup=never p=1 |
⌛ Testing commit 4725af3 with merge 7262762fc854593a2e5b1ac0715027967415b888... |
@bors retry yield |
Rollup of 9 pull requests Successful merges: - rust-lang#72706 (Add windows group to triagebot) - rust-lang#72789 (resolve: Do not suggest imports from the same module in which we are resolving) - rust-lang#72890 (improper ctypes: normalize return types and transparent structs) - rust-lang#72897 (normalize adt fields during structural match checking) - rust-lang#73005 (Don't create impl candidates when obligation contains errors) - rust-lang#73023 (Remove noisy suggestion of hash_map ) - rust-lang#73070 (Add regression test for const generic ICE in rust-lang#72819) - rust-lang#73157 (Don't lose empty `where` clause when pretty-printing) - rust-lang#73184 (Reoder order in which MinGW libs are linked to fix recent breakage) Failed merges: r? @ghost
Discussed in todays T-compiler meeting. Approved for beta-backport. |
…-morse,Mark-Simulacrum [beta] backport This is a beta backport rollup of the following: * [beta] Revert heterogeneous SocketAddr PartialEq impls rust-lang#73318 * Fix emcc failure for wasm32. rust-lang#73213 * Revert rust-lang#71956 rust-lang#73153 * [beta] Update cargo rust-lang#73141 * Minor: off-by-one error in RELEASES.md rust-lang#72914 * normalize adt fields during structural match checking rust-lang#72897 * Revert pr 71840 rust-lang#72989 * rust-lang/cargo#8361 * e658200 from rust-lang#72901 r? @ghost
fixes #72896
currently only fixes the issue itself and compiles stage 1 libs.
I believe we have to use something else to normalize the adt fields here,
as I expect some partially resolved adts to cause problems 🤔
stage 1 libs and the test itself pass, not sure about the rest...
Will spend some more time looking into it tomorrow.
r? @pnkfelix cc @eddyb