@@ -213,7 +213,7 @@ impl<'ll, 'tcx> ArgAbiExt<'ll, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
213213 OperandValue :: Ref ( val, None , self . layout . align . abi ) . store ( bx, dst)
214214 } else if self . is_unsized_indirect ( ) {
215215 bug ! ( "unsized `ArgAbi` must be handled through `store_fn_arg`" ) ;
216- } else if let PassMode :: Cast ( cast) = self . mode {
216+ } else if let PassMode :: Cast ( cast) = & self . mode {
217217 // FIXME(eddyb): Figure out when the simpler Store is safe, clang
218218 // uses it for i16 -> {i8, i8}, but not for i24 -> {i8, i8, i8}.
219219 let can_store_through_cast_ptr = false ;
@@ -335,7 +335,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
335335 if let PassMode :: Indirect { .. } = self . ret . mode { 1 } else { 0 } + args_capacity,
336336 ) ;
337337
338- let llreturn_ty = match self . ret . mode {
338+ let llreturn_ty = match & self . ret . mode {
339339 PassMode :: Ignore => cx. type_void ( ) ,
340340 PassMode :: Direct ( _) | PassMode :: Pair ( ..) => self . ret . layout . immediate_llvm_type ( cx) ,
341341 PassMode :: Cast ( cast) => cast. llvm_type ( cx) ,
@@ -351,7 +351,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
351351 llargument_tys. push ( ty. llvm_type ( cx) ) ;
352352 }
353353
354- let llarg_ty = match arg. mode {
354+ let llarg_ty = match & arg. mode {
355355 PassMode :: Ignore => continue ,
356356 PassMode :: Direct ( _) => arg. layout . immediate_llvm_type ( cx) ,
357357 PassMode :: Pair ( ..) => {
@@ -426,11 +426,11 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
426426 i += 1 ;
427427 i - 1
428428 } ;
429- match self . ret . mode {
430- PassMode :: Direct ( ref attrs) => {
429+ match & self . ret . mode {
430+ PassMode :: Direct ( attrs) => {
431431 attrs. apply_attrs_to_llfn ( llvm:: AttributePlace :: ReturnValue , cx, llfn) ;
432432 }
433- PassMode :: Indirect { ref attrs, extra_attrs : _, on_stack } => {
433+ PassMode :: Indirect { attrs, extra_attrs : _, on_stack } => {
434434 assert ! ( !on_stack) ;
435435 let i = apply ( attrs) ;
436436 let sret = llvm:: CreateStructRetAttr ( cx. llcx , self . ret . layout . llvm_type ( cx) ) ;
@@ -445,23 +445,23 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
445445 if arg. pad . is_some ( ) {
446446 apply ( & ArgAttributes :: new ( ) ) ;
447447 }
448- match arg. mode {
448+ match & arg. mode {
449449 PassMode :: Ignore => { }
450- PassMode :: Indirect { ref attrs, extra_attrs : None , on_stack : true } => {
450+ PassMode :: Indirect { attrs, extra_attrs : None , on_stack : true } => {
451451 let i = apply ( attrs) ;
452452 let byval = llvm:: CreateByValAttr ( cx. llcx , arg. layout . llvm_type ( cx) ) ;
453453 attributes:: apply_to_llfn ( llfn, llvm:: AttributePlace :: Argument ( i) , & [ byval] ) ;
454454 }
455- PassMode :: Direct ( ref attrs)
456- | PassMode :: Indirect { ref attrs, extra_attrs : None , on_stack : false } => {
455+ PassMode :: Direct ( attrs)
456+ | PassMode :: Indirect { attrs, extra_attrs : None , on_stack : false } => {
457457 apply ( attrs) ;
458458 }
459- PassMode :: Indirect { ref attrs, extra_attrs : Some ( ref extra_attrs) , on_stack } => {
459+ PassMode :: Indirect { attrs, extra_attrs : Some ( extra_attrs) , on_stack } => {
460460 assert ! ( !on_stack) ;
461461 apply ( attrs) ;
462462 apply ( extra_attrs) ;
463463 }
464- PassMode :: Pair ( ref a , ref b) => {
464+ PassMode :: Pair ( a , b) => {
465465 apply ( a) ;
466466 apply ( b) ;
467467 }
@@ -488,11 +488,11 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
488488 i += 1 ;
489489 i - 1
490490 } ;
491- match self . ret . mode {
492- PassMode :: Direct ( ref attrs) => {
491+ match & self . ret . mode {
492+ PassMode :: Direct ( attrs) => {
493493 attrs. apply_attrs_to_callsite ( llvm:: AttributePlace :: ReturnValue , bx. cx , callsite) ;
494494 }
495- PassMode :: Indirect { ref attrs, extra_attrs : _, on_stack } => {
495+ PassMode :: Indirect { attrs, extra_attrs : _, on_stack } => {
496496 assert ! ( !on_stack) ;
497497 let i = apply ( bx. cx , attrs) ;
498498 let sret = llvm:: CreateStructRetAttr ( bx. cx . llcx , self . ret . layout . llvm_type ( bx) ) ;
@@ -521,9 +521,9 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
521521 if arg. pad . is_some ( ) {
522522 apply ( bx. cx , & ArgAttributes :: new ( ) ) ;
523523 }
524- match arg. mode {
524+ match & arg. mode {
525525 PassMode :: Ignore => { }
526- PassMode :: Indirect { ref attrs, extra_attrs : None , on_stack : true } => {
526+ PassMode :: Indirect { attrs, extra_attrs : None , on_stack : true } => {
527527 let i = apply ( bx. cx , attrs) ;
528528 let byval = llvm:: CreateByValAttr ( bx. cx . llcx , arg. layout . llvm_type ( bx) ) ;
529529 attributes:: apply_to_callsite (
@@ -532,19 +532,15 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
532532 & [ byval] ,
533533 ) ;
534534 }
535- PassMode :: Direct ( ref attrs)
536- | PassMode :: Indirect { ref attrs, extra_attrs : None , on_stack : false } => {
535+ PassMode :: Direct ( attrs)
536+ | PassMode :: Indirect { attrs, extra_attrs : None , on_stack : false } => {
537537 apply ( bx. cx , attrs) ;
538538 }
539- PassMode :: Indirect {
540- ref attrs,
541- extra_attrs : Some ( ref extra_attrs) ,
542- on_stack : _,
543- } => {
539+ PassMode :: Indirect { attrs, extra_attrs : Some ( extra_attrs) , on_stack : _ } => {
544540 apply ( bx. cx , attrs) ;
545541 apply ( bx. cx , extra_attrs) ;
546542 }
547- PassMode :: Pair ( ref a , ref b) => {
543+ PassMode :: Pair ( a , b) => {
548544 apply ( bx. cx , a) ;
549545 apply ( bx. cx , b) ;
550546 }
0 commit comments