about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-04-19 12:20:49 +0900
committerYuki Okushi <huyuumi.dev@gmail.com>2020-04-19 12:31:37 +0900
commite171cdaada135ef2ecc64eeff86110de6c7f9370 (patch)
tree15e618d2f1304c4b9dd9c06ffef9b94d061f5241 /src
parent8001b96f48d2c9cd646acd2d16f4e06078f258e1 (diff)
downloadrust-e171cdaada135ef2ecc64eeff86110de6c7f9370.tar.gz
rust-e171cdaada135ef2ecc64eeff86110de6c7f9370.zip
Do not show DefId in diagnostics
Diffstat (limited to 'src')
-rw-r--r--src/librustc_middle/ty/print/pretty.rs8
-rw-r--r--src/test/ui/async-await/issues/issue-67893.rs2
-rw-r--r--src/test/ui/async-await/issues/issue-67893.stderr24
3 files changed, 26 insertions, 8 deletions
diff --git a/src/librustc_middle/ty/print/pretty.rs b/src/librustc_middle/ty/print/pretty.rs
index 2aa849f89c4..cff4719cc8c 100644
--- a/src/librustc_middle/ty/print/pretty.rs
+++ b/src/librustc_middle/ty/print/pretty.rs
@@ -639,9 +639,7 @@ pub trait PrettyPrinter<'tcx>:
                         }
                     }
                 } else {
-                    // Cross-crate closure types should only be
-                    // visible in codegen bug reports, I imagine.
-                    p!(write("@{:?}", did));
+                    p!(write("@{}", self.tcx().def_path_str(did)));
 
                     if substs.as_generator().is_valid() {
                         let upvar_tys = substs.as_generator().upvar_tys();
@@ -689,9 +687,7 @@ pub trait PrettyPrinter<'tcx>:
                         }
                     }
                 } else {
-                    // Cross-crate closure types should only be
-                    // visible in codegen bug reports, I imagine.
-                    p!(write("@{:?}", did));
+                    p!(write("@{}", self.tcx().def_path_str(did)));
 
                     if substs.as_closure().is_valid() {
                         let upvar_tys = substs.as_closure().upvar_tys();
diff --git a/src/test/ui/async-await/issues/issue-67893.rs b/src/test/ui/async-await/issues/issue-67893.rs
index d52303ac1ce..9679e3807b6 100644
--- a/src/test/ui/async-await/issues/issue-67893.rs
+++ b/src/test/ui/async-await/issues/issue-67893.rs
@@ -1,7 +1,5 @@
 // aux-build: issue_67893.rs
 // edition:2018
-// dont-check-compiler-stderr
-// FIXME(#71222): Add above flag because of the difference of stderrs on some env.
 
 extern crate issue_67893;
 
diff --git a/src/test/ui/async-await/issues/issue-67893.stderr b/src/test/ui/async-await/issues/issue-67893.stderr
new file mode 100644
index 00000000000..343a35a1663
--- /dev/null
+++ b/src/test/ui/async-await/issues/issue-67893.stderr
@@ -0,0 +1,24 @@
+error[E0277]: `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely
+  --> $DIR/issue-67893.rs:9:5
+   |
+LL | fn g(_: impl Send) {}
+   |              ---- required by this bound in `g`
+...
+LL |     g(issue_67893::run())
+   |     ^ `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely
+   | 
+  ::: $DIR/auxiliary/issue_67893.rs:7:20
+   |
+LL | pub async fn run() {
+   |                    - within this `impl std::future::Future`
+   |
+   = help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::sync::MutexGuard<'_, ()>`
+   = note: required because it appears within the type `for<'r, 's, 't0, 't1, 't2, 't3> {std::future::ResumeTy, std::sync::Arc<std::sync::Mutex<()>>, &'r std::sync::Mutex<()>, std::result::Result<std::sync::MutexGuard<'s, ()>, std::sync::PoisonError<std::sync::MutexGuard<'t0, ()>>>, &'t1 std::sync::MutexGuard<'t2, ()>, std::sync::MutexGuard<'t3, ()>, (), impl std::future::Future}`
+   = note: required because it appears within the type `[static generator@issue_67893::run::{{closure}}#0 for<'r, 's, 't0, 't1, 't2, 't3> {std::future::ResumeTy, std::sync::Arc<std::sync::Mutex<()>>, &'r std::sync::Mutex<()>, std::result::Result<std::sync::MutexGuard<'s, ()>, std::sync::PoisonError<std::sync::MutexGuard<'t0, ()>>>, &'t1 std::sync::MutexGuard<'t2, ()>, std::sync::MutexGuard<'t3, ()>, (), impl std::future::Future}]`
+   = note: required because it appears within the type `std::future::from_generator::GenFuture<[static generator@issue_67893::run::{{closure}}#0 for<'r, 's, 't0, 't1, 't2, 't3> {std::future::ResumeTy, std::sync::Arc<std::sync::Mutex<()>>, &'r std::sync::Mutex<()>, std::result::Result<std::sync::MutexGuard<'s, ()>, std::sync::PoisonError<std::sync::MutexGuard<'t0, ()>>>, &'t1 std::sync::MutexGuard<'t2, ()>, std::sync::MutexGuard<'t3, ()>, (), impl std::future::Future}]>`
+   = note: required because it appears within the type `impl std::future::Future`
+   = note: required because it appears within the type `impl std::future::Future`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.