We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64ad709 commit 47cc221Copy full SHA for 47cc221
src/test/ui/async-await/issue-72442.rs
@@ -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
25
0 commit comments