I was playing with a dyn
traits introduced in Rust 1.27 and stumbled into this compiler error:
error[E0433]: failed to resolve. Use of undeclared type or module `dyn`
--> src\main.rs:1:30
|
1 | fn _run0() -> Result<(), Box<dyn ::std::error::Error>> { Ok(()) }
| ^^^ Use of undeclared type or module `dyn`
All other variants compile fine:
fn _run0() -> Result<(), Box<dyn ::std::error::Error>> { Ok(()) } // Error
fn _run1() -> Result<(), Box<dyn std::error::Error>> { Ok(()) } // Ok
fn _run2() -> Result<(), Box<::std::error::Error>> { Ok(()) } // Ok
Is it intended behavior?
rustc 1.27.0 (3eda71b00 2018-06-19)