Skip to content

Commit bbcf9b1

Browse files
committed
Add the full issue reference to equality constraints in where clauses
1 parent 26286c7 commit bbcf9b1

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/librustc_passes/ast_validation.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,14 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
737737
for predicate in &generics.where_clause.predicates {
738738
if let WherePredicate::EqPredicate(ref predicate) = *predicate {
739739
self.err_handler()
740-
.span_err(predicate.span, "equality constraints are not yet \
741-
supported in where clauses (see #20041)");
740+
.struct_span_err(
741+
predicate.span,
742+
"equality constraints are not yet supported in `where` clauses",
743+
)
744+
.note(
745+
"for more information, see https://github.com/rust-lang/rust/issues/20041",
746+
)
747+
.emit();
742748
}
743749
}
744750

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn f() where u8 = u16 {}
2-
//~^ ERROR equality constraints are not yet supported in where clauses
2+
//~^ ERROR equality constraints are not yet supported in `where` clauses
33
fn g() where for<'a> &'static (u8,) == u16, {}
4-
//~^ ERROR equality constraints are not yet supported in where clauses
4+
//~^ ERROR equality constraints are not yet supported in `where` clauses
55

66
fn main() {}
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
error: equality constraints are not yet supported in where clauses (see #20041)
1+
error: equality constraints are not yet supported in `where` clauses
22
--> $DIR/where-equality-constraints.rs:1:14
33
|
44
LL | fn f() where u8 = u16 {}
55
| ^^^^^^^^
6+
|
7+
= note: for more information, see https://github.com/rust-lang/rust/issues/20041
68

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

1317
error: aborting due to 2 previous errors
1418

0 commit comments

Comments
 (0)