diff --git a/compiler/rustc_middle/src/ty/error.rs b/compiler/rustc_middle/src/ty/error.rs index d188199773a..bd78705cdb5 100644 --- a/compiler/rustc_middle/src/ty/error.rs +++ b/compiler/rustc_middle/src/ty/error.rs @@ -195,7 +195,7 @@ fn report_maybe_different(expected: &str, found: &str) -> String { ) .into(), ProjectionMismatched(ref values) => format!( - "expected {}, found {}", + "expected `{}`, found `{}`", tcx.def_path_str(values.expected), tcx.def_path_str(values.found) ) diff --git a/tests/ui/generic-associated-types/collections-project-default.stderr b/tests/ui/generic-associated-types/collections-project-default.stderr index 9aa0b239e47..3c3ae24dd47 100644 --- a/tests/ui/generic-associated-types/collections-project-default.stderr +++ b/tests/ui/generic-associated-types/collections-project-default.stderr @@ -5,7 +5,7 @@ LL | fn floatify_sibling(ints: &C) -> >::Sibling | ------------------------------------ expected `>::Sibling` because of return type ... LL | res - | ^^^ expected Collection::Sibling, found CollectionFamily::Member + | ^^^ expected `Collection::Sibling`, found `CollectionFamily::Member` | = note: expected associated type `>::Sibling` found associated type `<>::Family as CollectionFamily>::Member`