-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
This code:
trait Example {
#[throws]
fn foo();
}
expands to this:
trait Example {
fn foo() -> ::core::result::Result<(), Error> {
<_ as ::fehler::__internal::_Succeed>::from_ok(())
}
}
This inserts a default method for the trait which has two annoying effects:
- Complaints about an extra semi-colon
- No complaints in trait implementations that don't provide what should be a required method.
This is using rust 1.42.0 with fehler 1.0.0.
The problem appears to be in Throws::fold because the trait method is parsed by parse for ImplItemMethod. The implementation of this function in syn includes this comment:
// Accept methods without a body in an impl block because
// rustc's *parser* does not reject them (the compilation error
// is emitted later than parsing) and it can be useful for macro
// DSLs.
which causes this problem.
Metadata
Metadata
Assignees
Labels
No labels