Skip to content

Commit 1e26358

Browse files
committed
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.
1 parent 7953910 commit 1e26358

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Diff for: compiler/rustc_typeck/src/astconv/generics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
8282
if param_type.is_suggestable() {
8383
err.span_suggestion(
8484
tcx.def_span(src_def_id),
85-
"consider changing this type paramater to a `const`-generic",
85+
"consider changing this type parameter to be a `const` generic",
8686
format!("const {}: {}", param_name, param_type),
8787
Applicability::MaybeIncorrect,
8888
);

Diff for: src/test/ui/const-generics/diagnostics.stderr

+6-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ error[E0747]: type provided when a constant was expected
3131
--> $DIR/diagnostics.rs:12:19
3232
|
3333
LL | impl<N> Foo for B<N> {}
34-
| - ^
35-
| |
36-
| help: consider changing this type paramater to a `const`-generic: `const N: u8`
34+
| ^
35+
|
36+
help: consider changing this type parameter to be a `const` generic
37+
|
38+
LL | impl<const N: u8> Foo for B<N> {}
39+
| ^^^^^^^^^^^
3740

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

0 commit comments

Comments
 (0)