@@ -457,7 +457,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
457457 }
458458
459459 /// Adds a note if the types come from similarly named crates
460- fn check_and_note_conflicting_crates ( & self , err : & mut Diagnostic , terr : & TypeError < ' tcx > ) {
460+ fn check_and_note_conflicting_crates ( & self , err : & mut Diagnostic , terr : TypeError < ' tcx > ) {
461461 use hir:: def_id:: CrateNum ;
462462 use rustc_hir:: definitions:: DisambiguatedDefPathData ;
463463 use ty:: print:: Printer ;
@@ -561,7 +561,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
561561 }
562562 }
563563 } ;
564- match * terr {
564+ match terr {
565565 TypeError :: Sorts ( ref exp_found) => {
566566 // if they are both "path types", there's a chance of ambiguity
567567 // due to different versions of the same crate
@@ -583,7 +583,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
583583 err : & mut Diagnostic ,
584584 cause : & ObligationCause < ' tcx > ,
585585 exp_found : Option < ty:: error:: ExpectedFound < Ty < ' tcx > > > ,
586- terr : & TypeError < ' tcx > ,
586+ terr : TypeError < ' tcx > ,
587587 ) {
588588 match * cause. code ( ) {
589589 ObligationCauseCode :: Pattern { origin_expr : true , span : Some ( span) , root_ty } => {
@@ -1432,7 +1432,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
14321432 cause : & ObligationCause < ' tcx > ,
14331433 secondary_span : Option < ( Span , String ) > ,
14341434 mut values : Option < ValuePairs < ' tcx > > ,
1435- terr : & TypeError < ' tcx > ,
1435+ terr : TypeError < ' tcx > ,
14361436 swap_secondary_and_primary : bool ,
14371437 prefer_label : bool ,
14381438 ) {
@@ -1713,7 +1713,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
17131713 ty:: error:: TypeError :: Sorts ( terr)
17141714 if exp_found. map_or ( false , |ef| terr. found == ef. found ) =>
17151715 {
1716- Some ( * terr)
1716+ Some ( terr)
17171717 }
17181718 _ => exp_found,
17191719 } ;
@@ -2091,7 +2091,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
20912091 pub fn report_and_explain_type_error (
20922092 & self ,
20932093 trace : TypeTrace < ' tcx > ,
2094- terr : & TypeError < ' tcx > ,
2094+ terr : TypeError < ' tcx > ,
20952095 ) -> DiagnosticBuilder < ' tcx , ErrorGuaranteed > {
20962096 use crate :: traits:: ObligationCauseCode :: MatchExpressionArm ;
20972097
@@ -2781,12 +2781,12 @@ pub enum FailureCode {
27812781}
27822782
27832783pub trait ObligationCauseExt < ' tcx > {
2784- fn as_failure_code ( & self , terr : & TypeError < ' tcx > ) -> FailureCode ;
2784+ fn as_failure_code ( & self , terr : TypeError < ' tcx > ) -> FailureCode ;
27852785 fn as_requirement_str ( & self ) -> & ' static str ;
27862786}
27872787
27882788impl < ' tcx > ObligationCauseExt < ' tcx > for ObligationCause < ' tcx > {
2789- fn as_failure_code ( & self , terr : & TypeError < ' tcx > ) -> FailureCode {
2789+ fn as_failure_code ( & self , terr : TypeError < ' tcx > ) -> FailureCode {
27902790 use self :: FailureCode :: * ;
27912791 use crate :: traits:: ObligationCauseCode :: * ;
27922792 match self . code ( ) {
@@ -2823,7 +2823,7 @@ impl<'tcx> ObligationCauseExt<'tcx> for ObligationCause<'tcx> {
28232823 TypeError :: IntrinsicCast => {
28242824 Error0308 ( "cannot coerce intrinsics to function pointers" )
28252825 }
2826- TypeError :: ObjectUnsafeCoercion ( did) => Error0038 ( * did) ,
2826+ TypeError :: ObjectUnsafeCoercion ( did) => Error0038 ( did) ,
28272827 _ => Error0308 ( "mismatched types" ) ,
28282828 } ,
28292829 }
0 commit comments