diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-03-23 08:42:49 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-23 08:42:49 -0500 |
| commit | ea76c5ed569b170078d225c70f64bc773de80b81 (patch) | |
| tree | 846d07f6afa6fb7f842dc196c365ce698eb0a25a | |
| parent | 08134cf861c952bb02120aedd5aaa3d1587b7600 (diff) | |
| parent | 7d302d25826ee41703e10d6acd6d3114930e1dd2 (diff) | |
| download | rust-ea76c5ed569b170078d225c70f64bc773de80b81.tar.gz rust-ea76c5ed569b170078d225c70f64bc773de80b81.zip | |
Rollup merge of #40753 - mandeep:change-ObjectSafetyViolation-message, r=brson
Change object safety violation message Hello! This is my first pull request to rust so hopefully all goes well. This PR should fix issue #40670. I changed the error message in object_safety.rs and the corresponding compile-fail test in object-safety-supertrait-mentions-Self.rs. Once the changes were made, I ran ```python x.py test src/tools/tidy``` and ```python x.py test```. Tidy passed and the compile-fail tests passed, however the test suite failed on the tcp tests as my machine has IPv6 disabled. I'm not sure what to do in this case besides letting travis run the suite against my changes. Please let me know if there's anything I can do to help further. Thanks! Mandeep
| -rw-r--r-- | src/librustc/traits/object_safety.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/object-safety-supertrait-mentions-Self.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc/traits/object_safety.rs b/src/librustc/traits/object_safety.rs index 2ebe0d459fa..7cd0b26940d 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) => 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 74d1ad62f14..a93c056c410 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:Bar<u32>>(t: &T) -> &Bar<u32> { fn make_baz<T: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 } |
