delegation: emit error when there is an error in lowered user-specified generic args#156953
delegation: emit error when there is an error in lowered user-specified generic args#156953aerooneqq wants to merge 3 commits 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()) { |
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.
This comment has been minimized.
This comment has been minimized.
bcc26f4 to
cb59243
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
|
Now the error is emitted from |
|
A job failed! Check out the build log: (web) (plain enhanced) (plain) Click to see the possible cause of the failure (guessed by this bot) |
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