format!("{} occurs here, with `{}` maybe used later", await_or_yield, snippet),
);
- span.push_span_label(target_span, format!("has type `{}`", target_ty));
+ if target_ty.is_impl_trait() {
+ // It's not very useful to tell the user the type if it's opaque.
+ span.push_span_label(target_span, "created here".to_string());
+ } else {
+ span.push_span_label(target_span, format!("has type `{}`", target_ty));
+ }
// If available, use the scope span to annotate the drop location.
if let Some(scope_span) = scope_span {
--> $DIR/async-fn-nonsend.rs:24:5
|
LL | let x = non_send();
- | - has type `impl std::fmt::Debug`
+ | - created here
LL | drop(x);
LL | fut().await;
| ^^^^^^^^^^^ await occurs here, with `x` maybe used later
--> $DIR/async-fn-nonsend.rs:33:20
|
LL | match Some(non_send()) {
- | ---------- has type `impl std::fmt::Debug`
+ | ---------- created here
LL | Some(_) => fut().await,
| ^^^^^^^^^^^ await occurs here, with `non_send()` maybe used later
...
--> $DIR/issue-68112.rs:32:9
|
LL | let non_send_fut = make_non_send_future1();
- | ------------ has type `impl std::future::Future`
+ | ------------ created here
LL | let _ = non_send_fut.await;
LL | ready(0).await;
| ^^^^^^^^ await occurs here, with `non_send_fut` maybe used later
--> $DIR/issue-68112.rs:31:9
|
LL | let _non_send_gen = make_non_send_generator();
- | ------------- has type `impl std::ops::Generator`
+ | ------------- created here
LL | yield;
| ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
LL | };