Skip to content

Commit

Permalink
Add the full issue reference to equality constraints in where clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Dec 23, 2019
1 parent a916ac2 commit a5991c5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/librustc_passes/ast_validation.rs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -737,8 +737,14 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
for predicate in &generics.where_clause.predicates { for predicate in &generics.where_clause.predicates {
if let WherePredicate::EqPredicate(ref predicate) = *predicate { if let WherePredicate::EqPredicate(ref predicate) = *predicate {
self.err_handler() self.err_handler()
.span_err(predicate.span, "equality constraints are not yet \ .struct_span_err(
supported in where clauses (see #20041)"); predicate.span,
"equality constraints are not yet supported in `where` clauses",
)
.note(
"for more information, see https://github.com/rust-lang/rust/issues/20041",
)
.emit();
} }
} }


Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/where-clauses/where-equality-constraints.rs
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
fn f() where u8 = u16 {} fn f() where u8 = u16 {}
//~^ ERROR equality constraints are not yet supported in where clauses //~^ ERROR equality constraints are not yet supported in `where` clauses
fn g() where for<'a> &'static (u8,) == u16, {} fn g() where for<'a> &'static (u8,) == u16, {}
//~^ ERROR equality constraints are not yet supported in where clauses //~^ ERROR equality constraints are not yet supported in `where` clauses


fn main() {} fn main() {}
8 changes: 6 additions & 2 deletions src/test/ui/where-clauses/where-equality-constraints.stderr
Original file line number Original file line Diff line number Diff line change
@@ -1,14 +1,18 @@
error: equality constraints are not yet supported in where clauses (see #20041) error: equality constraints are not yet supported in `where` clauses
--> $DIR/where-equality-constraints.rs:1:14 --> $DIR/where-equality-constraints.rs:1:14
| |
LL | fn f() where u8 = u16 {} LL | fn f() where u8 = u16 {}
| ^^^^^^^^ | ^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/20041


error: equality constraints are not yet supported in where clauses (see #20041) error: equality constraints are not yet supported in `where` clauses
--> $DIR/where-equality-constraints.rs:3:14 --> $DIR/where-equality-constraints.rs:3:14
| |
LL | fn g() where for<'a> &'static (u8,) == u16, {} LL | fn g() where for<'a> &'static (u8,) == u16, {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/20041


error: aborting due to 2 previous errors error: aborting due to 2 previous errors


0 comments on commit a5991c5

Please sign in to comment.