Add "this has type {} which {}" note

This commit is contained in:
Yuki Okushi 2020-10-22 14:15:40 +09:00
parent 66226ca157
commit 2da86a1bfd
3 changed files with 17 additions and 0 deletions

View file

@ -1630,6 +1630,10 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
),
);
err.span_note(scope_span, &format!("{} is later dropped here", snippet));
err.span_note(
interior_span,
&format!("this has type `{}` which {}", target_ty, trait_explanation),
);
} else {
span.push_span_label(
yield_span,