File tree Expand file tree Collapse file tree
compiler/rustc_hir_analysis/src/hir_ty_lowering
tests/ui/const-generics/mgca Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2947,7 +2947,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
29472947 ) ;
29482948 if def_id. is_local ( ) {
29492949 let name = tcx. def_path_str ( def_id) ;
2950- err. span_suggestion (
2950+ err. span_suggestion_verbose (
29512951 tcx. def_span ( def_id) . shrink_to_lo ( ) ,
29522952 format ! ( "add `type` before `const` for `{name}`" ) ,
29532953 format ! ( "type " ) ,
Original file line number Diff line number Diff line change 11error: use of `const` in the type system not defined as `type const`
22 --> $DIR/assoc-const-without-type_const.rs:8:35
33 |
4- LL | const SIZE: usize;
5- | - help: add `type` before `const` for `Tr::SIZE`: `type`
6- ...
74LL | fn mk_array<T: Tr>(_x: T) -> [(); T::SIZE] {
85 | ^^^^^^^
6+ |
7+ help: add `type` before `const` for `Tr::SIZE`
8+ |
9+ LL | type const SIZE: usize;
10+ | ++++
911
1012error: use of `const` in the type system not defined as `type const`
1113 --> $DIR/assoc-const-without-type_const.rs:10:10
1214 |
13- LL | const SIZE: usize;
14- | - help: add `type` before `const` for `Tr::SIZE`: `type`
15- ...
1615LL | [(); T::SIZE]
1716 | ^^^^^^^
17+ |
18+ help: add `type` before `const` for `Tr::SIZE`
19+ |
20+ LL | type const SIZE: usize;
21+ | ++++
1822
1923error: aborting due to 2 previous errors
2024
Original file line number Diff line number Diff line change 11error: use of `const` in the type system not defined as `type const`
22 --> $DIR/unmarked-free-const.rs:9:18
33 |
4- LL | const N: usize = 4;
5- | - help: add `type` before `const` for `N`: `type`
6- ...
74LL | let x = [(); N];
85 | ^
6+ |
7+ help: add `type` before `const` for `N`
8+ |
9+ LL | type const N: usize = 4;
10+ | ++++
911
1012error: aborting due to 1 previous error
1113
You can’t perform that action at this time.
0 commit comments