-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Restore diagnostics when no inherent const candidates found #149814
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
base: main
Are you sure you want to change the base?
Conversation
|
The job Click to see the possible cause of the failure (guessed by this bot) |
| // At the moment, we actually bail out with a hard error if the selection of an inherent | ||
| // associated item fails (see below). This means we never consider trait associated items | ||
| // as potential fallback candidates (#142006). To temporarily mask that issue, let's not | ||
| // select at all if there are no early inherent candidates. |
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 comment needs to be moved above the Type branch then, otherwise it no longer makes sense
| return Ok(None); | ||
| return match assoc_tag { | ||
| ty::AssocTag::Type => Ok(None), | ||
| ty::AssocTag::Const => Err(self.report_unresolved_inherent_assoc_item( |
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.
Just so we're clear, this is not the correct fix long term because we need to probe trait candidates, too, if there are no inherent candidates.
Moreover, adding this error back in just means we're likely just papering over some deeper mGCA issue that ultimately needs to be fixed some other way, possible. Well, I haven't really looked into the cause of the ICEs but Boxy knew of their existence all the way back when she worked on #140247.
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 should reside in tests/ui/const-generics/mgca/& be called differently. mGCA just reuses the feature gate of IATs for type-level assoc const resolution since they share the impl. Otherwise, mGCA is completely unrelated to IATs.
|
Reminder, once the PR becomes ready for a review, use |
resolve: #149809
resolve: #148949
(todo: change PR title)