-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Regression in diagnostic quality for unimplemented traits on arrays. #92113
Comments
@rustbot modify labels: -regression-untriaged +regression-from-stable-to-nightly |
While I think mentioning I think that we could actually change these diagnostics to more generally deal with stuff like deref impls by explicitly looking for potential impls instead of looking at the existing impl candidates. So when encountering a "trait bound is not satisfied" error for some type Do you want to look at this yourself, if not I should hopefully be able to make some time for this over the next few weeks cc @estebank |
Certainly not. I'm a little bummed that the work I did in #91314 is kaput, but I agree with you.
I like that idea, but it seems like we're lacking tests to tell us what else might have lost information as a result of #86986, which will make it harder to know exactly which types of potential impls we should look for. The work I was doing in #91314 obviously tells us one category of potential impls we need to check:
I was just poking around in there, but this seems like a larger time commitment compared to the very directed suggestion generation of #91314. With guidance, I'd be happy to try out doing just the @rustbot label +A-traits |
alright 👍 i also believe that we aren't doing anything like that, but i think the required changes won't be too large though they do require more knowledge about how rustc works 😅 . Going to write some instructions this week, feel free to ping me either here or on zulip in case i forget |
so, we collect the impl candidates in rust/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs Lines 1440 to 1443 in e100ec5
The reason we don't consider slice impls anymore is this comparision rust/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs Lines 1471 to 1473 in e100ec5
we want some fuzzy equality here instead of comparing their simplified types. How exactly that fuzzy equality should work requires a bit of fiddling so that's something you probably have to experiment with yourself. I would expect that directly using
|
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-low |
@rustbot label regression-from-stable-to-beta, -regression-from-stable-to-nightly |
This is fixed on stable. Not sure exactly what fixed it, but I suspect #93298.
|
Commit dcd716f (#86986) appears to have regressed the quality of compiler diagnostics produced when an array type does not satisfy a trait but its slice version does (there may be other scenarios that see similar regressions, but this is where I've seen it).
This is currently blocking #91314.
Motivating example (playground):
When compiled on dcd716f~1 (83b32f2), rustc provides a help message telling the user that the trait is implemented for slices:
Compiled on dcd716f, this help message no longer appears:
Inspiration for regression tests can be taken from #91314.
@rustbot modify labels: +A-diagnostics +T-compiler +D-terse
cc @lcnr
The text was updated successfully, but these errors were encountered: