File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ use metadata::csearch;
46
46
use middle;
47
47
use middle:: cast;
48
48
use middle:: check_const;
49
- use middle:: const_eval:: { self , ConstVal } ;
49
+ use middle:: const_eval:: { self , ConstVal , ErrKind } ;
50
50
use middle:: def:: { self , DefMap , ExportMap } ;
51
51
use middle:: dependency_format;
52
52
use middle:: fast_reject;
@@ -6182,11 +6182,13 @@ impl<'tcx> ctxt<'tcx> {
6182
6182
..
6183
6183
} ) if segments. len ( ) == 1 =>
6184
6184
format ! ( "found variable" ) ,
6185
- _ => format ! ( "{}" , err. description( ) ) ,
6185
+ _ => match err. kind {
6186
+ ErrKind :: MiscCatchAll => format ! ( "but found {}" , err. description( ) ) ,
6187
+ _ => format ! ( "but {}" , err. description( ) )
6188
+ }
6186
6189
} ;
6187
6190
span_err ! ( self . sess, count_expr. span, E0307 ,
6188
- "{}, expected constant integer for repeat count" ,
6189
- err_msg) ;
6191
+ "expected constant integer for repeat count, {}" , err_msg) ;
6190
6192
}
6191
6193
}
6192
6194
0
You can’t perform that action at this time.
0 commit comments