Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not show DefId in diagnostics #71310

Merged
merged 1 commit into from
Apr 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/librustc_middle/ty/print/pretty.rs
Original file line number Diff line number Diff line change
@@ -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)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see above that p!(write("@"), print_def_path(did, substs)); is the right way to do this (used in the local case with span_free_formats).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, overlooked this comment, sorry! Will address it soonish.


if substs.as_closure().is_valid() {
let upvar_tys = substs.as_closure().upvar_tys();
2 changes: 0 additions & 2 deletions src/test/ui/async-await/issues/issue-67893.rs
Original file line number Diff line number Diff line change
@@ -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;

24 changes: 24 additions & 0 deletions src/test/ui/async-await/issues/issue-67893.stderr
Original file line number Diff line number Diff line change
@@ -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`.