Skip to content

Commit

Permalink
Rollup merge of #84141 - camelid:fix-typo, r=Dylan-DPC
Browse files Browse the repository at this point in the history
Fix typo in error message

Also tweaked the message a bit by

- removing the hyphen, because in my opinion the hyphen makes the
  message a bit harder to read, especially combined with the backticks;
- adding the word "be", because I think it's a bit clearer that way.
  • Loading branch information
Dylan-DPC committed Apr 13, 2021
2 parents e40d7e6 + 1e26358 commit 91c0828
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/astconv/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
if param_type.is_suggestable() {
err.span_suggestion(
tcx.def_span(src_def_id),
"consider changing this type paramater to a `const`-generic",
"consider changing this type parameter to be a `const` generic",
format!("const {}: {}", param_name, param_type),
Applicability::MaybeIncorrect,
);
Expand Down
9 changes: 6 additions & 3 deletions src/test/ui/const-generics/diagnostics.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ error[E0747]: type provided when a constant was expected
--> $DIR/diagnostics.rs:12:19
|
LL | impl<N> Foo for B<N> {}
| - ^
| |
| help: consider changing this type paramater to a `const`-generic: `const N: u8`
| ^
|
help: consider changing this type parameter to be a `const` generic
|
LL | impl<const N: u8> Foo for B<N> {}
| ^^^^^^^^^^^

error[E0747]: unresolved item provided when a constant was expected
--> $DIR/diagnostics.rs:16:32
Expand Down

0 comments on commit 91c0828

Please sign in to comment.