From 85dbc6570a304d7e61fc41d1a121d0b01619fb45 Mon Sep 17 00:00:00 2001 From: mandeep Date: Wed, 22 Mar 2017 21:16:37 -0500 Subject: [PATCH 1/2] Changed error message for ObjectSafetyViolation::SupertraitSelf --- src/librustc/traits/object_safety.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/traits/object_safety.rs b/src/librustc/traits/object_safety.rs index 2ebe0d459fab1..7cd0b26940d91 100644 --- a/src/librustc/traits/object_safety.rs +++ b/src/librustc/traits/object_safety.rs @@ -46,7 +46,7 @@ impl ObjectSafetyViolation { "the trait cannot require that `Self : Sized`".into(), ObjectSafetyViolation::SupertraitSelf => "the trait cannot use `Self` as a type parameter \ - in the supertrait listing".into(), + in the supertraits or where-clauses".into(), ObjectSafetyViolation::Method(name, MethodViolationCode::StaticMethod) => format!("method `{}` has no receiver", name).into(), ObjectSafetyViolation::Method(name, MethodViolationCode::ReferencesSelf) => From 7d302d25826ee41703e10d6acd6d3114930e1dd2 Mon Sep 17 00:00:00 2001 From: mandeep Date: Wed, 22 Mar 2017 23:06:56 -0500 Subject: [PATCH 2/2] Changed E0038 error message in test to comply with new message --- src/test/compile-fail/object-safety-supertrait-mentions-Self.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/compile-fail/object-safety-supertrait-mentions-Self.rs b/src/test/compile-fail/object-safety-supertrait-mentions-Self.rs index 74d1ad62f14c3..a93c056c410c6 100644 --- a/src/test/compile-fail/object-safety-supertrait-mentions-Self.rs +++ b/src/test/compile-fail/object-safety-supertrait-mentions-Self.rs @@ -24,7 +24,7 @@ fn make_bar>(t: &T) -> &Bar { fn make_baz(t: &T) -> &Baz { //~^ ERROR E0038 - //~| NOTE the trait cannot use `Self` as a type parameter in the supertrait listing + //~| NOTE the trait cannot use `Self` as a type parameter in the supertraits or where-clauses //~| NOTE the trait `Baz` cannot be made into an object t }