Skip to content

Commit 16ba3e1

Browse files
committed
bless issue-72442
1 parent 7cdc897 commit 16ba3e1

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/test/ui/async-await/issue-72442.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// edition:2018
2+
// compile-flags:-Cincremental=tmp/issue-72442
23

34
use std::fs::File;
45
use std::future::Future;
@@ -9,7 +10,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
910
{
1011
let path = std::path::Path::new(".");
1112
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+
//~^ ERROR the trait bound
1314
let mut src = String::new();
1415
f.read_to_string(&mut src)?;
1516
Ok(())
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0277]: the trait bound `std::option::Option<&str>: std::convert::AsRef<std::path::Path>` is not satisfied
2+
--> $DIR/issue-72442.rs:12:36
3+
|
4+
LL | let mut f = File::open(path.to_str())?;
5+
| ^^^^^^^^^^^^^ the trait `std::convert::AsRef<std::path::Path>` is not implemented for `std::option::Option<&str>`
6+
|
7+
::: $SRC_DIR/libstd/fs.rs:LL:COL
8+
|
9+
LL | pub fn open<P: AsRef<Path>>(path: P) -> io::Result<File> {
10+
| ----------- required by this bound in `std::fs::File::open`
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)