From d1b65fb691b49aecc567593a14d5c6690d3fd90c Mon Sep 17 00:00:00 2001 From: varkor <github@varkor.com> Date: Tue, 8 Jan 2019 23:50:51 +0000 Subject: [PATCH 1/2] Add issue reference to E0202 message --- src/librustc_typeck/collect.rs | 2 +- src/test/ui/assoc-inherent.rs | 4 ++-- src/test/ui/assoc-inherent.stderr | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 9fc2f11b19738..03945912cb4c1 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -1107,7 +1107,7 @@ fn report_assoc_ty_on_inherent_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, span: tcx.sess, span, E0202, - "associated types are not allowed in inherent impls" + "associated types are not yet supported in inherent impls (see #8995)" ); } diff --git a/src/test/ui/assoc-inherent.rs b/src/test/ui/assoc-inherent.rs index fe34be3731736..05329a2714257 100644 --- a/src/test/ui/assoc-inherent.rs +++ b/src/test/ui/assoc-inherent.rs @@ -1,9 +1,9 @@ -// Test associated types are forbidden in inherent impls. +// Test associated types are, until #8995 is implemented, forbidden in inherent impls. struct Foo; impl Foo { - type Bar = isize; //~ERROR associated types are not allowed in inherent impls + type Bar = isize; //~ERROR associated types are not yet supported in inherent impls (see #8995) } fn main() {} diff --git a/src/test/ui/assoc-inherent.stderr b/src/test/ui/assoc-inherent.stderr index 1a555bd53ac83..f438ac8df4a09 100644 --- a/src/test/ui/assoc-inherent.stderr +++ b/src/test/ui/assoc-inherent.stderr @@ -1,7 +1,7 @@ -error[E0202]: associated types are not allowed in inherent impls +error[E0202]: associated types are not yet supported in inherent impls (see #8995) --> $DIR/assoc-inherent.rs:6:5 | -LL | type Bar = isize; //~ERROR associated types are not allowed in inherent impls +LL | type Bar = isize; //~ERROR associated types are not yet supported in inherent impls (see #8995) | ^^^^^^^^^^^^^^^^^ error: aborting due to previous error From ac4a4547ba674b6d9d0e3b3e018be94d32766faa Mon Sep 17 00:00:00 2001 From: varkor <github@varkor.com> Date: Tue, 8 Jan 2019 23:53:43 +0000 Subject: [PATCH 2/2] Consolidate equality constraints error message --- src/librustc_passes/ast_validation.rs | 5 +++-- src/test/ui/where-clauses/where-equality-constraints.stderr | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/librustc_passes/ast_validation.rs b/src/librustc_passes/ast_validation.rs index 584f0ba0449e1..3d0e46d998622 100644 --- a/src/librustc_passes/ast_validation.rs +++ b/src/librustc_passes/ast_validation.rs @@ -438,8 +438,9 @@ impl<'a> Visitor<'a> for AstValidator<'a> { } for predicate in &generics.where_clause.predicates { if let WherePredicate::EqPredicate(ref predicate) = *predicate { - self.err_handler().span_err(predicate.span, "equality constraints are not yet \ - supported in where clauses (#20041)"); + self.err_handler() + .span_err(predicate.span, "equality constraints are not yet \ + supported in where clauses (see #20041)"); } } visit::walk_generics(self, generics) diff --git a/src/test/ui/where-clauses/where-equality-constraints.stderr b/src/test/ui/where-clauses/where-equality-constraints.stderr index 56caaaeee401e..220447079c629 100644 --- a/src/test/ui/where-clauses/where-equality-constraints.stderr +++ b/src/test/ui/where-clauses/where-equality-constraints.stderr @@ -1,10 +1,10 @@ -error: equality constraints are not yet supported in where clauses (#20041) +error: equality constraints are not yet supported in where clauses (see #20041) --> $DIR/where-equality-constraints.rs:1:14 | LL | fn f() where u8 = u16 {} | ^^^^^^^^ -error: equality constraints are not yet supported in where clauses (#20041) +error: equality constraints are not yet supported in where clauses (see #20041) --> $DIR/where-equality-constraints.rs:3:14 | LL | fn g() where for<'a> &'static (u8,) == u16, {}