From 16ba3e129d5d37c63b7000fcd4b52261e7f1c4f1 Mon Sep 17 00:00:00 2001 From: csmoe Date: Fri, 22 May 2020 10:12:03 +0800 Subject: [PATCH] bless issue-72442 --- src/test/ui/async-await/issue-72442.rs | 3 ++- src/test/ui/async-await/issue-72442.stderr | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/test/ui/async-await/issue-72442.stderr diff --git a/src/test/ui/async-await/issue-72442.rs b/src/test/ui/async-await/issue-72442.rs index cced1da48f6..61c8c8c1594 100644 --- a/src/test/ui/async-await/issue-72442.rs +++ b/src/test/ui/async-await/issue-72442.rs @@ -1,4 +1,5 @@ // edition:2018 +// compile-flags:-Cincremental=tmp/issue-72442 use std::fs::File; use std::future::Future; @@ -9,7 +10,7 @@ fn main() -> Result<(), Box> { { let path = std::path::Path::new("."); let mut f = File::open(path.to_str())?; - //~^ ERROR the trait bound `std::option::Option<&str>: std::convert::AsRef` is not satisfied + //~^ ERROR the trait bound let mut src = String::new(); f.read_to_string(&mut src)?; Ok(()) diff --git a/src/test/ui/async-await/issue-72442.stderr b/src/test/ui/async-await/issue-72442.stderr new file mode 100644 index 00000000000..56854333578 --- /dev/null +++ b/src/test/ui/async-await/issue-72442.stderr @@ -0,0 +1,14 @@ +error[E0277]: the trait bound `std::option::Option<&str>: std::convert::AsRef` is not satisfied + --> $DIR/issue-72442.rs:12:36 + | +LL | let mut f = File::open(path.to_str())?; + | ^^^^^^^^^^^^^ the trait `std::convert::AsRef` is not implemented for `std::option::Option<&str>` + | + ::: $SRC_DIR/libstd/fs.rs:LL:COL + | +LL | pub fn open>(path: P) -> io::Result { + | ----------- required by this bound in `std::fs::File::open` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. -- 2.44.0