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
I expect this code to compile but panic at runtime if I call x(), but instead I get this compile-time error:
error[E0277]: the trait bound `(): Foo` is not satisfied
--> src/main.rs:10:15
|
10 | fn x() -> impl Foo {
| ^^^^^^^^ the trait `Foo` is not implemented for `()`
|
help: this trait has no implementations, consider adding one
--> src/main.rs:1:1
|
1 | trait Foo {}
| ^^^^^^^^^
Meta
rustc --version --verbose:
rustc 1.77.1 (7cf61ebde 2024-03-27)
Backtrace: n/a (output same as above)
The text was updated successfully, but these errors were encountered:
Hi! When there are
impl Trait
return types in trait definitions, the todo!() macro doesn't work as expected in them:I expect this code to compile but panic at runtime if I call
x()
, but instead I get this compile-time error:Meta
rustc --version --verbose
:Backtrace: n/a (output same as above)
The text was updated successfully, but these errors were encountered: