Skip to content

Commit ee99bb3

Browse files
committed
Apply review comments
1 parent 9342be5 commit ee99bb3

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

compiler/rustc_parse/src/parser/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1959,11 +1959,11 @@ impl<'a> Parser<'a> {
19591959
if token::EqEq == snapshot.token.kind {
19601960
err.span_suggestion(
19611961
snapshot.token.span,
1962-
"replace `==` with `=`",
1962+
"if you meant to use an associated type binding, replace `==` with `=`",
19631963
"=".to_string(),
19641964
Applicability::MaybeIncorrect,
19651965
);
1966-
let value = self.mk_expr_err(expr.span);
1966+
let value = self.mk_expr_err(start.to(expr.span));
19671967
err.emit();
19681968
return Ok(GenericArg::Const(AnonConst { id: ast::DUMMY_NODE_ID, value }));
19691969
} else if token::Comma == self.token.kind || self.token.kind.should_end_const_arg()

src/test/ui/const-generics/issues/issue-87493.stderr

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ error: expected one of `,` or `>`, found `==`
22
--> $DIR/issue-87493.rs:8:22
33
|
44
LL | T: MyTrait<Assoc == S::Assoc>,
5-
| ^^
6-
| |
7-
| expected one of `,` or `>`
8-
| help: replace `==` with `=`: `=`
5+
| ^^ expected one of `,` or `>`
6+
|
7+
help: if you meant to use an associated type binding, replace `==` with `=`
8+
|
9+
LL | T: MyTrait<Assoc = S::Assoc>,
10+
| ~
911

1012
error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
1113
--> $DIR/issue-87493.rs:8:8

0 commit comments

Comments
 (0)