@@ -299,11 +299,12 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
299
299
err. note ( "The type information given here is insufficient to check whether \
300
300
the pointer cast is valid") ;
301
301
if unknown_cast_to {
302
- err. span_suggestion_short_with_applicability ( self . cast_span ,
303
- "consider giving more type information" ,
304
- String :: new ( ) ,
305
- Applicability :: Unspecified ,
306
- ) ;
302
+ err. span_suggestion_short_with_applicability (
303
+ self . cast_span ,
304
+ "consider giving more type information" ,
305
+ String :: new ( ) ,
306
+ Applicability :: Unspecified ,
307
+ ) ;
307
308
}
308
309
err. emit ( ) ;
309
310
}
@@ -329,11 +330,12 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
329
330
if self . cast_ty . is_trait ( ) {
330
331
match fcx. tcx . sess . source_map ( ) . span_to_snippet ( self . cast_span ) {
331
332
Ok ( s) => {
332
- err. span_suggestion_with_applicability ( self . cast_span ,
333
- "try casting to a reference instead" ,
334
- format ! ( "&{}{}" , mtstr, s) ,
335
- Applicability :: MachineApplicable ,
336
- ) ;
333
+ err. span_suggestion_with_applicability (
334
+ self . cast_span ,
335
+ "try casting to a reference instead" ,
336
+ format ! ( "&{}{}" , mtstr, s) ,
337
+ Applicability :: MachineApplicable ,
338
+ ) ;
337
339
}
338
340
Err ( _) => {
339
341
span_help ! ( err, self . cast_span, "did you mean `&{}{}`?" , mtstr, tstr)
@@ -350,11 +352,12 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
350
352
ty:: Adt ( def, ..) if def. is_box ( ) => {
351
353
match fcx. tcx . sess . source_map ( ) . span_to_snippet ( self . cast_span ) {
352
354
Ok ( s) => {
353
- err. span_suggestion_with_applicability ( self . cast_span ,
354
- "try casting to a `Box` instead" ,
355
- format ! ( "Box<{}>" , s) ,
356
- Applicability :: MachineApplicable ,
357
- ) ;
355
+ err. span_suggestion_with_applicability (
356
+ self . cast_span ,
357
+ "try casting to a `Box` instead" ,
358
+ format ! ( "Box<{}>" , s) ,
359
+ Applicability :: MachineApplicable ,
360
+ ) ;
358
361
}
359
362
Err ( _) => span_help ! ( err, self . cast_span, "did you mean `Box<{}>`?" , tstr) ,
360
363
}
0 commit comments