-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Code:
use fehler::throws;
trait FooTrait {}
struct FooStruct;
struct FooError;
impl FooTrait for FooStruct {}
#[throws(FooError)]
fn foo() -> Box<dyn FooTrait> {
Box::new(FooStruct)
}
Compile result:
Error[E0271]: type mismatch resolving ...
|
104 | #[throws(FooError)]
| ^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn mymodule::FooTrait`, found struct `mymodule::FooStruct`
|
= note: expected type `std::boxed::Box<dyn mymodule::FooTrait>`
found struct `std::boxed::Box<mymodule::FooStruct>`
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels