-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Point out failing never obligation for DEPENDENCY_ON_UNIT_NEVER_TYPE_FALLBACK
#126367
Point out failing never obligation for DEPENDENCY_ON_UNIT_NEVER_TYPE_FALLBACK
#126367
Conversation
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
&& let never_errors = remaining_errors_if_fallback_to(self.tcx.types.never) | ||
&& !never_errors.is_empty() | ||
&& let mut never_errors = remaining_errors_if_fallback_to(self.tcx.types.never) | ||
&& let [ref mut never_error, ..] = never_errors.as_mut_slice() |
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.
Do you think we should lint individually on each failing obligation?
Or maybe I should make it a subdiagnostic so we can have multiple of them?
If we print out >1, I should probably do some deduplication like we do for real fulfillment errors 🤔
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.
I think ideally we should print out all the errors, but maybe it will be too noisy, idk. This PR as is seems like a good first step/clear improvement.
&& let never_errors = remaining_errors_if_fallback_to(self.tcx.types.never) | ||
&& !never_errors.is_empty() | ||
&& let mut never_errors = remaining_errors_if_fallback_to(self.tcx.types.never) | ||
&& let [ref mut never_error, ..] = never_errors.as_mut_slice() |
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.
I think ideally we should print out all the errors, but maybe it will be too noisy, idk. This PR as is seems like a good first step/clear improvement.
@@ -45,6 +45,7 @@ hir_typeck_convert_using_method = try using `{$sugg}` to convert `{$found}` to ` | |||
hir_typeck_ctor_is_private = tuple struct constructor `{$def}` is private | |||
|
|||
hir_typeck_dependency_on_unit_never_type_fallback = this function depends on never type fallback being `()` | |||
.note = in edition 2024, the requirement `{$obligation}` will fail |
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.
maybe we can mention somehow that we plan to break this on all editions eventually?
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.
do you have an opinion on the wording?
.note = in edition 2024, the requirement `{$obligation}` will fail | |
.note = in edition 2024, the requirement `{$obligation}` will fail, and eventually this will fail everywhere |
seems awkward, and I have no idea what a better wording could be 🤔
☔ The latest upstream changes (presumably #125289) made this pull request unmergeable. Please resolve the merge conflicts. |
05ecac2
to
fdd90db
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
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.
There are reports from users hitting the warning, I would like them to see at least some explanation for why they hit it, so we should merge this asap.
This is a clear improvement and we can delay more improvements to follow-ups.
r=me with green CI
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#126354 (Use `Variance` glob imported variants everywhere) - rust-lang#126367 (Point out failing never obligation for `DEPENDENCY_ON_UNIT_NEVER_TYPE_FALLBACK`) - rust-lang#126469 (MIR Shl/Shr: the offset can be computed with rem_euclid) - rust-lang#126471 (Use a consistent way to filter out bounds instead of splitting it into three places) - rust-lang#126472 (build `libcxx-version` only when it doesn't exist) - rust-lang#126497 (delegation: Fix hygiene for `self`) - rust-lang#126501 (make bors ignore comments in PR template) - rust-lang#126509 (std: suggest OnceLock over Once) - rust-lang#126512 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#126367 - compiler-errors:point-out-failing-never-obligation, r=WaffleLapkin Point out failing never obligation for `DEPENDENCY_ON_UNIT_NEVER_TYPE_FALLBACK` Based on top of rust-lang#125289, so just need to look at the last commit. r? `@WaffleLapkin`
Based on top of #125289, so just need to look at the last commit.
r? @WaffleLapkin