@@ -341,11 +341,12 @@ impl HirDisplay for Ty {
341
341
write ! ( f, ")" ) ?;
342
342
}
343
343
}
344
- & Ty :: FnPtr { is_varargs, ref substs, .. } => {
345
- let sig = FnSig :: from_fn_ptr_substs ( & substs, is_varargs) ;
344
+ Ty :: FnPtr { is_varargs, substs, .. } => {
345
+ let sig = FnSig :: from_fn_ptr_substs ( & substs, * is_varargs) ;
346
346
sig. hir_fmt ( f) ?;
347
347
}
348
- & Ty :: FnDef ( def, ref parameters) => {
348
+ Ty :: FnDef ( def, parameters) => {
349
+ let def = * def;
349
350
let sig = f. db . callable_item_signature ( def) . subst ( parameters) ;
350
351
match def {
351
352
CallableDefId :: FunctionId ( ff) => {
@@ -383,10 +384,10 @@ impl HirDisplay for Ty {
383
384
write ! ( f, " -> {}" , ret_display) ?;
384
385
}
385
386
}
386
- & Ty :: Adt ( def_id, ref parameters) => {
387
+ Ty :: Adt ( def_id, parameters) => {
387
388
match f. display_target {
388
389
DisplayTarget :: Diagnostics | DisplayTarget :: Test => {
389
- let name = match def_id {
390
+ let name = match * def_id {
390
391
AdtId :: StructId ( it) => f. db . struct_data ( it) . name . clone ( ) ,
391
392
AdtId :: UnionId ( it) => f. db . union_data ( it) . name . clone ( ) ,
392
393
AdtId :: EnumId ( it) => f. db . enum_data ( it) . name . clone ( ) ,
@@ -396,7 +397,7 @@ impl HirDisplay for Ty {
396
397
DisplayTarget :: SourceCode { module_id } => {
397
398
if let Some ( path) = find_path:: find_path (
398
399
f. db . upcast ( ) ,
399
- ItemInNs :: Types ( def_id. into ( ) ) ,
400
+ ItemInNs :: Types ( ( * def_id) . into ( ) ) ,
400
401
module_id,
401
402
) {
402
403
write ! ( f, "{}" , path) ?;
@@ -447,13 +448,13 @@ impl HirDisplay for Ty {
447
448
}
448
449
}
449
450
}
450
- & Ty :: AssociatedType ( type_alias, ref parameters) => {
451
+ Ty :: AssociatedType ( type_alias, parameters) => {
451
452
let trait_ = match type_alias. lookup ( f. db . upcast ( ) ) . container {
452
453
AssocContainerId :: TraitId ( it) => it,
453
454
_ => panic ! ( "not an associated type" ) ,
454
455
} ;
455
456
let trait_ = f. db . trait_data ( trait_) ;
456
- let type_alias_data = f. db . type_alias_data ( type_alias) ;
457
+ let type_alias_data = f. db . type_alias_data ( * type_alias) ;
457
458
458
459
// Use placeholder associated types when the target is test (https://rust-lang.github.io/chalk/book/clauses/type_equality.html#placeholder-associated-types)
459
460
if f. display_target . is_test ( ) {
@@ -465,23 +466,23 @@ impl HirDisplay for Ty {
465
466
}
466
467
} else {
467
468
let projection_ty =
468
- ProjectionTy { associated_ty : type_alias, parameters : parameters. clone ( ) } ;
469
+ ProjectionTy { associated_ty : * type_alias, parameters : parameters. clone ( ) } ;
469
470
470
471
projection_ty. hir_fmt ( f) ?;
471
472
}
472
473
}
473
- & Ty :: ForeignType ( type_alias, ref parameters) => {
474
- let type_alias = f. db . type_alias_data ( type_alias) ;
474
+ Ty :: ForeignType ( type_alias, parameters) => {
475
+ let type_alias = f. db . type_alias_data ( * type_alias) ;
475
476
write ! ( f, "{}" , type_alias. name) ?;
476
477
if parameters. len ( ) > 0 {
477
478
write ! ( f, "<" ) ?;
478
479
f. write_joined ( & * parameters. 0 , ", " ) ?;
479
480
write ! ( f, ">" ) ?;
480
481
}
481
482
}
482
- & Ty :: OpaqueType ( opaque_ty_id, ref parameters) => {
483
+ Ty :: OpaqueType ( opaque_ty_id, parameters) => {
483
484
match opaque_ty_id {
484
- OpaqueTyId :: ReturnTypeImplTrait ( func, idx) => {
485
+ & OpaqueTyId :: ReturnTypeImplTrait ( func, idx) => {
485
486
let datas =
486
487
f. db . return_type_impl_traits ( func) . expect ( "impl trait id without data" ) ;
487
488
let data = ( * datas)
0 commit comments