Skip to content

Commit ab44c77

Browse files
authored
Rollup merge of #71310 - JohnTitor:dont-did, r=estebank
Do not show DefId in diagnostics Fixes #71222 r? @estebank cc @eddyb
2 parents 9c5da9a + e171cda commit ab44c77

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

src/librustc_middle/ty/print/pretty.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,7 @@ pub trait PrettyPrinter<'tcx>:
639639
}
640640
}
641641
} else {
642-
// Cross-crate closure types should only be
643-
// visible in codegen bug reports, I imagine.
644-
p!(write("@{:?}", did));
642+
p!(write("@{}", self.tcx().def_path_str(did)));
645643

646644
if substs.as_generator().is_valid() {
647645
let upvar_tys = substs.as_generator().upvar_tys();
@@ -689,9 +687,7 @@ pub trait PrettyPrinter<'tcx>:
689687
}
690688
}
691689
} else {
692-
// Cross-crate closure types should only be
693-
// visible in codegen bug reports, I imagine.
694-
p!(write("@{:?}", did));
690+
p!(write("@{}", self.tcx().def_path_str(did)));
695691

696692
if substs.as_closure().is_valid() {
697693
let upvar_tys = substs.as_closure().upvar_tys();

src/test/ui/async-await/issues/issue-67893.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// aux-build: issue_67893.rs
22
// edition:2018
3-
// dont-check-compiler-stderr
4-
// FIXME(#71222): Add above flag because of the difference of stderrs on some env.
53

64
extern crate issue_67893;
75

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
error[E0277]: `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely
2+
--> $DIR/issue-67893.rs:9:5
3+
|
4+
LL | fn g(_: impl Send) {}
5+
| ---- required by this bound in `g`
6+
...
7+
LL | g(issue_67893::run())
8+
| ^ `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely
9+
|
10+
::: $DIR/auxiliary/issue_67893.rs:7:20
11+
|
12+
LL | pub async fn run() {
13+
| - within this `impl std::future::Future`
14+
|
15+
= help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::sync::MutexGuard<'_, ()>`
16+
= 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}`
17+
= 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}]`
18+
= 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}]>`
19+
= note: required because it appears within the type `impl std::future::Future`
20+
= note: required because it appears within the type `impl std::future::Future`
21+
22+
error: aborting due to previous error
23+
24+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)