-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed as not planned
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team
Description
I tried this code:
trait Foo {}
fn not_implemented() -> impl Foo {
todo!()
}
I expected to see this happen: compiles.
Instead, this happened:
Compiling playground v0.0.1 (/playground)
error[[E0277]](https://doc.rust-lang.org/stable/error_codes/E0277.html): the trait bound `(): Foo` is not satisfied
--> src/lib.rs:4:25
|
4 | fn not_implemented() -> impl Foo {
| ^^^^^^^^ the trait `Foo` is not implemented for `()`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `playground` (lib) due to previous error
Meta
rustc --version --verbose
:
$ rustc --version --verbose
rustc 1.73.0-nightly (180dffba1 2023-08-14)
binary: rustc
commit-hash: 180dffba142c47240ca0d93096ce90b9fd97c8d7
commit-date: 2023-08-14
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 17.0.0
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team