Point out failing never obligation for DEPENDENCY_ON_UNIT_NEVER_TYPE_FALLBACK by compiler-errors · Pull Request #126367 · rust-lang/rust (original) (raw)

compiler-errors

@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

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

compiler-errors

&& 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()

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 🤔

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.

compiler-errors

WaffleLapkin

&& 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()

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

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?

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 🤔

@bors

@compiler-errors

@rust-log-analyzer

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

WaffleLapkin

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

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

@bors r=WaffleLapkin rollup

@bors

📌 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

@bors

…iaskrgr

Rollup of 9 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Jun 15, 2024

@rust-timer

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