-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Implement lint for obligations broken by never type fallback change #125289
Conversation
This comment has been minimized.
This comment has been minimized.
So, yeah, we talked about this. IIRC, what I said was basically like "we can't find diff two error sets" but as long as we only try to report We can chat on zulip about details here, but I would probably approach this by selecting a couple test cases where you want better diagnostics, then look at the errors that you get and what info is there, then figure out how to extract out that info. Then you can generalize across tests. |
Quite a few of existing tests get the warning, should I do something with it? The options I see are bless them (what I currently did), fix them and allow the warning. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #125313) made this pull request unmergeable. Please resolve the merge conflicts. |
fec6f70
to
cedada8
Compare
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
cedada8
to
596bbcb
Compare
This comment has been minimized.
This comment has been minimized.
04d9c37
to
b73eb9a
Compare
@bors r+ |
actually wait wait i forgot to run perf ever @bors r- |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
@@ -70,12 +70,16 @@ mod opaque { | |||
|
|||
pub fn opaque_arg(_: impl Trait) -> i32 { 0 } | |||
pub fn opaque_ret() -> impl Trait { unimplemented!() } | |||
//~^ warn: this function depends on never type fallback being `()` | |||
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
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.
Is there a way to show what error would be emitted?
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've implemented a rudimentary attempt at #126367
@bors r- please rebase and bless tests, then r=me! |
Don't depend on the fact that `!` falls back to `()` and so panic-ish things can be used in `-> impl ImplementedForUnit` functions
looks like prim@ stuff does not work here (is it possibly not handled by rustdoc at all?)
b73eb9a
to
ea98e42
Compare
@bors r=compiler-errors |
☀️ Test successful - checks-actions |
Finished benchmarking commit (b6e5e3f): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary 1.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -3.4%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 672.787s -> 671.147s (-0.24%) |
…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`
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`
This is the second (and probably last major?) lint required for the never type fallback change.
The idea is to check if the code errors with
fallback = ()
and if it errors withfallback = !
and if it went from "ok" to "error", lint.I'm not happy with the diagnostic, ideally we'd highlight what bound is the problem. But I'm really unsure how to do that (cc @jackh726, iirc you had some ideas?)
r? @compiler-errors
Thanks @BoxyUwU with helping with trait solver stuff when I was implementing the initial version of this lint.
Tracking:
!
fall back to!
#123748