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 expected to see this happen: Compilation works, but panic with unimplemented at runtime.
Instead, this happened: Unable to compile, I got these errors:
error[E0277]: expected a `Fn<(i32,)>` closure, found `()`
--> bug.rs:1:14
|
1 | fn test() -> impl Fn(i32) -> i32
| ^^^^^^^^^^^^^^^^^^^ expected an `Fn<(i32,)>` closure, found `()`
|
= help: the trait `Fn<(i32,)>` is not implemented for `()`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
error[E0277]: `()` doesn't implement `std::fmt::Display`
--> bug.rs:6:14
|
6 | fn test() -> impl Display
| ^^^^^^^^^^^^ `()` cannot be formatted with the default formatter
|
= help: the trait `std::fmt::Display` is not implemented for `()`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
In theory, unimplemented!() dosen't return, and just panic, so the type problem is not to be solved. And this is the purpose of unimplemented, to let functions.... unimplemented... just a draft... if we need to implements unimplemented functions.... they become implemented....
Hello,
I tried this code:
Or this code:
I expected to see this happen: Compilation works, but panic with unimplemented at runtime.
Instead, this happened: Unable to compile, I got these errors:
In theory, unimplemented!() dosen't return, and just panic, so the type problem is not to be solved. And this is the purpose of unimplemented, to let functions.... unimplemented... just a draft... if we need to implements unimplemented functions.... they become implemented....
Meta
rustc --version --verbose
:Thank you :)
The text was updated successfully, but these errors were encountered: