Change:
Follow-up of Consider this example: It emits the stderr on my local (x86_64-unknown-linux-gnu): But on some other environment on CI, e.g. or , it emits it with a tiny difference: It's ideal to have the same diagnostics on all the environment. See also:
s shouldn't be leaked in user output.
Yeah, other places look like: Perhaps we emit accidentally in somewhere.
that makes me think that we probably have some instead of somewhere.
The relevant code is: I don't find any difference between here and similar places yet. thoughts?
the place to look at is: CC The same applies to closures, but we are likely not displaying them this way anywhere (or we've just gotten lucky).

Discussion:
} } } else { <del> // Cross-crate closure types should only be // visible in codegen bug reports, I imagine. p!(write("@{:?}", did)); </del> <ins> p!(write("@{}", self.tcx().def_path_str(did))); </ins> if substs.as_generator().is_valid() { let upvar_tys = substs.as_generator().upvar_tys();

} } } else { <del> // Cross-crate closure types should only be // visible in codegen bug reports, I imagine. p!(write("@{:?}", did)); </del> <ins> p!(write("@{}", self.tcx().def_path_str(did))); </ins> if substs.as_closure().is_valid() { let upvar_tys = substs.as_closure().upvar_tys();

// aux-build: issue_67893.rs // edition:2018 <del> // dont-check-compiler-stderr // FIXME(#71222): Add above flag because of the difference of stderrs on some env. </del> extern crate issue_67893;

<ins> 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`. </ins>