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.
This commit is contained in:
Camelid 2021-04-12 12:33:52 -07:00
parent 7953910464
commit 1e2635815f
2 changed files with 7 additions and 4 deletions

View File

@ -82,7 +82,7 @@ fn generic_arg_mismatch_err(
if param_type.is_suggestable() { if param_type.is_suggestable() {
err.span_suggestion( err.span_suggestion(
tcx.def_span(src_def_id), 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), format!("const {}: {}", param_name, param_type),
Applicability::MaybeIncorrect, Applicability::MaybeIncorrect,
); );

View File

@ -31,9 +31,12 @@ error[E0747]: type provided when a constant was expected
--> $DIR/diagnostics.rs:12:19 --> $DIR/diagnostics.rs:12:19
| |
LL | impl<N> Foo for B<N> {} 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 error[E0747]: unresolved item provided when a constant was expected
--> $DIR/diagnostics.rs:16:32 --> $DIR/diagnostics.rs:16:32