-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
WIP: Normalize associated types in structs when performing unsizing coercion #87548
Conversation
The job Click to see the possible cause of the failure (guessed by this bot)
|
|
||
debug!("coerce_unsized: normalized {:?} to {:?}; obls: {:?}", trait_pred, trait_pred2, obls); | ||
let trait_pred = trait_pred2; | ||
// coercion.obligations.extend(obls); |
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.
Why is this commented out? We definitely shouldn't drop these obligations.
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.
This is very WIP and actually even abandoned 😅
At the time, I was experimenting with this and was hitting problems I couldn't understand, so I was commenting out different parts in an attempt to understand what and how (doesn't) work.
We've discussed this with Niko in a zulip thread and he said that it would probably be better to remove the "special trait solver" altogether:
nikomatsakis: as it happens, I would love to remove this part of the coercion code that you are fixing
nikomatsakis: I'm not sure if we can get away with it, but it's going to be really painful to make a part of chalk
nikomatsakis: the reason I dislike this code is that it is basically reproducing part of the normal "evaluate whether a trait matches" logic
nikomatsakis: but doing it in a custom and different way
nikomatsakis: anyway, I imagine that this is part of why you are seeing different behavior
nikomatsakis: I'm debating whether I can convince you into trying to remove this logic, instead of fixing it
I wanted to work on this (the issue I'm trying to fix really bothers me), but this never ended up happening.
I can try to revive this PR or try to make the refactor Niko proposed. But I'd need some guidance since I haven't worked on the compiler much before, so I'm not sure if I'll help or just spend someones time 😅
I'm assuming since you've assigned yourself, you know this part of the compiler well?
I'm going to go ahead and close this as inactive...feel free to reopen if you want to continue working on it |
Closes #75899
r? @nikomatsakis