You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of rust-lang#125289 - WaffleLapkin:never-obligations, r=compiler-errors
Implement lint for obligations broken by never type fallback change
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 with `fallback = !` 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:
- rust-lang#123748
= help: did you intend to use the type `()` here instead?
9
9
10
10
error[E0277]: the trait bound `!: Default` is not satisfied
11
-
--> $DIR/never-type-fallback-breaking.rs:30:5
11
+
--> $DIR/never-type-fallback-breaking.rs:34:5
12
12
|
13
13
LL | deserialize()?;
14
14
| ^^^^^^^^^^^^^ the trait `Default` is not implemented for `!`
15
15
|
16
16
= note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #48950 <https://github.com/rust-lang/rust/issues/48950> for more information)
17
17
= help: did you intend to use the type `()` here instead?
0 commit comments