delegation: emit error when there is an error in lowered user-specified generic args#156953
Open
aerooneqq wants to merge 1 commit into
Open
delegation: emit error when there is an error in lowered user-specified generic args#156953aerooneqq wants to merge 1 commit into
aerooneqq wants to merge 1 commit into
Conversation
|
|
||
| // If self type is present skip it, as error will be emitted when self type will be accessed. | ||
| let skip_self = self_ty.is_some() as usize; | ||
| if parent_args.iter().skip(skip_self).chain(child_args).any(|arg| arg.references_error()) { |
Contributor
There was a problem hiding this comment.
The referenced error here is constructed using ErrorGuaranteed from a span_delayed_bug in HIR->ty lowering.
Our conclusion here is that some regular error (not a delayed bug) needs to be reported there, instead of reporting this kind of "some unknown error happened in the past" message post-factum.
It's not very clear what that error should be, and whether the code from #156848 should compile or not at all, and how an explicitly passed '_ should be propagated.
Contributor
|
☔ The latest upstream changes (presumably #156967) made this pull request unmergeable. Please resolve the merge conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR checks if lowered user-specified generic args reference error and emits error if so. And
get_delegation_user_specified_argsis now query as we invoke it two times.Somewhat similar to #156565.
Fixes #156848. Part of #118212.
r? @petrochenkov