Closed
Description
Playpen: http://is.gd/izhPM3
use std::io::IoError;
use std::error::FromError;
enum MyError {
IoError(std::io::IoError),
OtherError
}
impl FromError<std::io::IoError> for MyError {
fn from_error(err: std::io::IoError) -> MyError {
MyError::IoError(err);
}
}
fn somefun() -> Result<(), MyError>
{
let mut w = Vec::new();
write!(&mut w, "test")
}
fn main() {
}
yields
<std macros>:4:9: 5:6 error: mismatched types: expected `core::result::Result<(), MyError>`, found `core::result::Result<(), std::io::IoError>` (expected enum MyError, found struct std::io::IoError)
<std macros>:4 format_args!(|args| { dst.write_fmt(args) }, $($arg)*)
<std macros>:5 })
neither location nor name of the macro is shown. Also the location of the invokation is missing.