Skip to content

Commit

Permalink
[wip] Add FIXMEs for fmease
Browse files Browse the repository at this point in the history
  • Loading branch information
fmease committed Mar 7, 2024
1 parent 6fa9f51 commit fd3a91f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion compiler/rustc_parse/src/parser/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,19 +704,22 @@ impl<'a> Parser<'a> {
if matches!(self.token.kind, token::Comma | token::Gt) {
err.span_suggestion(
self.psess.source_map().next_point(eq).to(before_next),
// FIXME(fmease, associated_const_equality): Also mention assoc consts here if enabled.
"to constrain the associated type, add a type after `=`",
" TheType",
" /*Type*/",
Applicability::HasPlaceholders,
);
err.span_suggestion(
eq.to(before_next),
// FIXME(fmease): Say "is meant to be a type argument"
format!("remove the `=` if `{ident}` is a type"),
"",
Applicability::MaybeIncorrect,
)
} else {
err.span_label(
self.token.span,
// FIXME(fmease, associated_const_equality): Say "type or const expression" if enabled
format!("expected type, found {}", super::token_descr(&self.token)),
)
};
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/parser/recover/recover-assoc-eq-missing-term.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ LL | bar::<Item = >();
|
help: to constrain the associated type, add a type after `=`
|
LL | bar::<Item = TheType>();
| +++++++
LL | bar::<Item = /*Type*/>();
| ++++++++
help: remove the `=` if `Item` is a type
|
LL - bar::<Item = >();
Expand Down

0 comments on commit fd3a91f

Please sign in to comment.