Skip to content
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

Merged

Conversation

compiler-errors
Copy link
Member

Based on top of #125289, so just need to look at the last commit.

r? @WaffleLapkin

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 13, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jun 13, 2024

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()
Copy link
Member Author

@compiler-errors compiler-errors Jun 13, 2024

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 🤔

Copy link
Member

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()
Copy link
Member

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
Copy link
Member

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?

Copy link
Member Author

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?

Suggested change
.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 🤔

@bors
Copy link
Contributor

bors commented Jun 13, 2024

☔ The latest upstream changes (presumably #125289) made this pull request unmergeable. Please resolve the merge conflicts.

@compiler-errors compiler-errors force-pushed the point-out-failing-never-obligation branch from 05ecac2 to fdd90db Compare June 14, 2024 01:48
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.......... (120/124)
...F       (124/124)


/checkout/tests/rustdoc-gui/help-page.goml help-page... FAILED
[ERROR] `tests/rustdoc-gui/utils.goml` line 16
    from `tests/rustdoc-gui/help-page.goml` line 23
    from `tests/rustdoc-gui/help-page.goml` line 32: Error: Evaluation failed: The following errors happened: [localStorage item "rustdoc-theme" (of value "ayu") != "null"]: for command `assert-local-storage: {"rustdoc-theme": |theme|}`
Error: ()
Build completed unsuccessfully in 0:03:29
  local time: Fri Jun 14 02:38:17 UTC 2024
  network time: Fri, 14 Jun 2024 02:38:17 GMT

Copy link
Member

@WaffleLapkin WaffleLapkin left a 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

@compiler-errors
Copy link
Member Author

That CI failure is unrelated -- I think rustdoc was messing with CI last night #126445

@bors r=WaffleLapkin rollup

@bors
Copy link
Contributor

bors commented Jun 15, 2024

📌 Commit fdd90db has been approved by WaffleLapkin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 15, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 15, 2024
…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
@bors bors merged commit b473ec2 into rust-lang:master Jun 15, 2024
4 of 6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 15, 2024
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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants