-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Another oddity I'm afraid. This:
use fehler::throws;
#[throws(std::io::Error)] // ERROR: Wrapper type must be a normal path type
pub fn zonk() {
let mut _unused : Box<dyn FnOnce()> = Box::new(||());
}
pub fn works0() -> Result<(), std::io::Error> {
let mut _unused : Box<dyn FnOnce()> = Box::new(||());
Ok(())
}
pub fn works1() {
let mut _unused : Box<dyn FnOnce()> = Box::new(||());
}
#[throws(std::io::Error)]
pub fn works2() {
let mut _unused : Box<()> = Box::new(());
}
Produces this:
error: custom attribute panicked
--> src/lib.rs:4:1
|
3 | #[throws(std::io::Error)] // ERROR: Wrapper type must be a normal path type
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: Wrapper type must be a normal path type
I think zonk should compile and be equivalent to works0. Again, this test case is minimised from a larger program. Thanks for your attention.
hen-x, anti-social and MartinKavik
Metadata
Metadata
Assignees
Labels
No labels