diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-01-12 10:55:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-12 10:55:09 +0100 |
| commit | f7da074d2ac5302f3c6af882efca2d73c8ec006c (patch) | |
| tree | 786a8d4274fec8ea4a460d14f87c2c9435439d2d /src | |
| parent | 0b1427eeb8193a47c2194f1478a784864d5a3197 (diff) | |
| parent | ac4a4547ba674b6d9d0e3b3e018be94d32766faa (diff) | |
| download | rust-f7da074d2ac5302f3c6af882efca2d73c8ec006c.tar.gz rust-f7da074d2ac5302f3c6af882efca2d73c8ec006c.zip | |
Rollup merge of #57459 - varkor:E0202-issue-reference, r=petrochenkov
Reference tracking issue for inherent associated types in diagnostic This makes it clearer that associated types in inherent impls are an intended feature, like the diagnostic for equality constraints in where clauses. (This is more helpful, because the lack of associated types is a confusing omission and it lets users more easily track the state of the feature.)
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_passes/ast_validation.rs | 5 | ||||
| -rw-r--r-- | src/librustc_typeck/collect.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/assoc-inherent.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/assoc-inherent.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/where-clauses/where-equality-constraints.stderr | 4 |
5 files changed, 10 insertions, 9 deletions
diff --git a/src/librustc_passes/ast_validation.rs b/src/librustc_passes/ast_validation.rs index 584f0ba0449..3d0e46d9986 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/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 2ac52bcda76..be5f398e31f 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -1108,7 +1108,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 fe34be37317..05329a27142 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 1a555bd53ac..f438ac8df4a 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 diff --git a/src/test/ui/where-clauses/where-equality-constraints.stderr b/src/test/ui/where-clauses/where-equality-constraints.stderr index 56caaaeee40..220447079c6 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, {} |
