From e13d659c128be05d918fefa4270577e810bfe734 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 26 Aug 2015 12:50:31 +0200 Subject: [PATCH 1/2] Add span_help for E0044 --- src/librustc_typeck/check/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index cf08490d720c9..a7335f8fa84c3 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -729,6 +729,9 @@ pub fn check_item_type<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx ast::Item) { if !pty.generics.types.is_empty() { span_err!(ccx.tcx.sess, item.span, E0044, "foreign items may not have type parameters"); + span_help!(ccx.tcx.sess, item.span, + "consider using specialization instead of \ + type parameter"); } if let ast::ForeignItemFn(ref fn_decl, _) = item.node { From b874660c6428de6fb20947a618cc44d20bf1871f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 26 Aug 2015 12:56:23 +0200 Subject: [PATCH 2/2] Fix typo --- src/librustc_typeck/check/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index a7335f8fa84c3..b21f683b16995 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -731,7 +731,7 @@ pub fn check_item_type<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx ast::Item) { "foreign items may not have type parameters"); span_help!(ccx.tcx.sess, item.span, "consider using specialization instead of \ - type parameter"); + type parameters"); } if let ast::ForeignItemFn(ref fn_decl, _) = item.node {