@@ -457,7 +457,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
457
457
}
458
458
459
459
/// 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 > ) {
461
461
use hir:: def_id:: CrateNum ;
462
462
use rustc_hir:: definitions:: DisambiguatedDefPathData ;
463
463
use ty:: print:: Printer ;
@@ -561,7 +561,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
561
561
}
562
562
}
563
563
} ;
564
- match * terr {
564
+ match terr {
565
565
TypeError :: Sorts ( ref exp_found) => {
566
566
// if they are both "path types", there's a chance of ambiguity
567
567
// due to different versions of the same crate
@@ -583,7 +583,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
583
583
err : & mut Diagnostic ,
584
584
cause : & ObligationCause < ' tcx > ,
585
585
exp_found : Option < ty:: error:: ExpectedFound < Ty < ' tcx > > > ,
586
- terr : & TypeError < ' tcx > ,
586
+ terr : TypeError < ' tcx > ,
587
587
) {
588
588
match * cause. code ( ) {
589
589
ObligationCauseCode :: Pattern { origin_expr : true , span : Some ( span) , root_ty } => {
@@ -1432,7 +1432,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1432
1432
cause : & ObligationCause < ' tcx > ,
1433
1433
secondary_span : Option < ( Span , String ) > ,
1434
1434
mut values : Option < ValuePairs < ' tcx > > ,
1435
- terr : & TypeError < ' tcx > ,
1435
+ terr : TypeError < ' tcx > ,
1436
1436
swap_secondary_and_primary : bool ,
1437
1437
prefer_label : bool ,
1438
1438
) {
@@ -1713,7 +1713,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1713
1713
ty:: error:: TypeError :: Sorts ( terr)
1714
1714
if exp_found. map_or ( false , |ef| terr. found == ef. found ) =>
1715
1715
{
1716
- Some ( * terr)
1716
+ Some ( terr)
1717
1717
}
1718
1718
_ => exp_found,
1719
1719
} ;
@@ -2091,7 +2091,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
2091
2091
pub fn report_and_explain_type_error (
2092
2092
& self ,
2093
2093
trace : TypeTrace < ' tcx > ,
2094
- terr : & TypeError < ' tcx > ,
2094
+ terr : TypeError < ' tcx > ,
2095
2095
) -> DiagnosticBuilder < ' tcx , ErrorGuaranteed > {
2096
2096
use crate :: traits:: ObligationCauseCode :: MatchExpressionArm ;
2097
2097
@@ -2781,12 +2781,12 @@ pub enum FailureCode {
2781
2781
}
2782
2782
2783
2783
pub trait ObligationCauseExt < ' tcx > {
2784
- fn as_failure_code ( & self , terr : & TypeError < ' tcx > ) -> FailureCode ;
2784
+ fn as_failure_code ( & self , terr : TypeError < ' tcx > ) -> FailureCode ;
2785
2785
fn as_requirement_str ( & self ) -> & ' static str ;
2786
2786
}
2787
2787
2788
2788
impl < ' 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 {
2790
2790
use self :: FailureCode :: * ;
2791
2791
use crate :: traits:: ObligationCauseCode :: * ;
2792
2792
match self . code ( ) {
@@ -2823,7 +2823,7 @@ impl<'tcx> ObligationCauseExt<'tcx> for ObligationCause<'tcx> {
2823
2823
TypeError :: IntrinsicCast => {
2824
2824
Error0308 ( "cannot coerce intrinsics to function pointers" )
2825
2825
}
2826
- TypeError :: ObjectUnsafeCoercion ( did) => Error0038 ( * did) ,
2826
+ TypeError :: ObjectUnsafeCoercion ( did) => Error0038 ( did) ,
2827
2827
_ => Error0308 ( "mismatched types" ) ,
2828
2828
} ,
2829
2829
}
0 commit comments