File tree Expand file tree Collapse file tree 3 files changed +22
-10
lines changed
compiler/rustc_hir_analysis/src/hir_ty_lowering Expand file tree Collapse file tree 3 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ fn generic_arg_mismatch_err(
7373 let param_name = tcx. hir_ty_param_name ( param_local_id) ;
7474 let param_type = tcx. type_of ( param. def_id ) . instantiate_identity ( ) ;
7575 if param_type. is_suggestable ( tcx, false ) {
76- err. span_suggestion (
76+ err. span_suggestion_verbose (
7777 tcx. def_span ( src_def_id) ,
7878 "consider changing this type parameter to a const parameter" ,
7979 format ! ( "const {param_name}: {param_type}" ) ,
Original file line number Diff line number Diff line change @@ -51,9 +51,13 @@ error[E0747]: type provided when a constant was expected
5151 --> $DIR/invalid-const-arguments.rs:10:19
5252 |
5353LL | impl<N> Foo for B<N> {}
54- | - ^
55- | |
56- | help: consider changing this type parameter to a const parameter: `const N: u8`
54+ | ^
55+ |
56+ help: consider changing this type parameter to a const parameter
57+ |
58+ LL - impl<N> Foo for B<N> {}
59+ LL + impl<const N: u8> Foo for B<N> {}
60+ |
5761
5862error[E0747]: unresolved item provided when a constant was expected
5963 --> $DIR/invalid-const-arguments.rs:14:32
Original file line number Diff line number Diff line change @@ -2,17 +2,25 @@ error[E0747]: type provided when a constant was expected
22 --> $DIR/kind_mismatch.rs:11:38
33 |
44LL | impl<K> ContainsKey<K> for KeyHolder<K> {}
5- | - ^
6- | |
7- | help: consider changing this type parameter to a const parameter: `const K: u8`
5+ | ^
6+ |
7+ help: consider changing this type parameter to a const parameter
8+ |
9+ LL - impl<K> ContainsKey<K> for KeyHolder<K> {}
10+ LL + impl<const K: u8> ContainsKey<K> for KeyHolder<K> {}
11+ |
812
913error[E0747]: type provided when a constant was expected
1014 --> $DIR/kind_mismatch.rs:11:21
1115 |
1216LL | impl<K> ContainsKey<K> for KeyHolder<K> {}
13- | - ^
14- | |
15- | help: consider changing this type parameter to a const parameter: `const K: u8`
17+ | ^
18+ |
19+ help: consider changing this type parameter to a const parameter
20+ |
21+ LL - impl<K> ContainsKey<K> for KeyHolder<K> {}
22+ LL + impl<const K: u8> ContainsKey<K> for KeyHolder<K> {}
23+ |
1624
1725error: aborting due to 2 previous errors
1826
You can’t perform that action at this time.
0 commit comments