Skip to content

Commit 47cc221

Browse files
committed
add mcve for issue 72442
1 parent 64ad709 commit 47cc221

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// edition:2018
2+
3+
use std::fs::File;
4+
use std::future::Future;
5+
use std::io::prelude::*;
6+
7+
fn main() -> Result<(), Box<dyn std::error::Error>> {
8+
block_on(async {
9+
{
10+
let path = std::path::Path::new(".");
11+
let mut f = File::open(path.to_str())?;
12+
//~^ ERROR the trait bound `std::option::Option<&str>: std::convert::AsRef<std::path::Path>` is not satisfied
13+
let mut src = String::new();
14+
f.read_to_string(&mut src)?;
15+
Ok(())
16+
}
17+
})
18+
}
19+
20+
fn block_on<F>(f: F) -> F::Output
21+
where
22+
F: Future<Output = Result<(), Box<dyn std::error::Error>>>,
23+
{
24+
Ok(())
25+
}

0 commit comments

Comments
 (0)