5 use std::future::Future;
6 use std::io::prelude::*;
8 fn main() -> Result<(), Box<dyn std::error::Error>> {
11 let path = std::path::Path::new(".");
12 let mut f = File::open(path.to_str())?;
13 //~^ ERROR the trait bound
14 let mut src = String::new();
15 f.read_to_string(&mut src)?;
21 fn block_on<F>(f: F) -> F::Output
23 F: Future<Output = Result<(), Box<dyn std::error::Error>>>,