Skip to content

Commit 6a30ce6

Browse files
committed
Add type parameter name to type mismatch error messages
Part of #47319. This just adds type parameter name to type mismatch error message, so e.g. the following: ``` expected enum `std::option::Option`, found type parameter ``` becomes ``` expected enum `std::option::Option`, found type parameter `T` ```
1 parent 87cbf0a commit 6a30ce6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc/ty/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl<'tcx> ty::TyS<'tcx> {
241241
ty::Infer(ty::FreshFloatTy(_)) => "fresh floating-point type".into(),
242242
ty::Projection(_) => "associated type".into(),
243243
ty::UnnormalizedProjection(_) => "non-normalized associated type".into(),
244-
ty::Param(_) => "type parameter".into(),
244+
ty::Param(p) => format!("type parameter `{}`", p).into(),
245245
ty::Opaque(..) => "opaque type".into(),
246246
ty::Error => "type error".into(),
247247
}

0 commit comments

Comments
 (0)