1
Fork 0

Refactor away the need for some descr methods.

Instead we use `Display` impls and their `alternate` render scheme to
decide whether we want backticks or not.
This commit is contained in:
Oli Scherer 2023-10-25 16:37:21 +00:00
parent 92b41eeee6
commit c601ade3ad
5 changed files with 32 additions and 38 deletions

View file

@ -2995,11 +2995,11 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
let sp = self.tcx.def_span(def_id);
// Special-case this to say "async block" instead of `[static coroutine]`.
let kind = tcx.coroutine_kind(def_id).unwrap().descr();
let kind = tcx.coroutine_kind(def_id).unwrap();
err.span_note(
sp,
with_forced_trimmed_paths!(format!(
"required because it's used within this {kind}",
"required because it's used within this {kind:#}",
)),
)
}