@@ -611,7 +611,7 @@ impl Span {
611611
612612 #[ inline]
613613 /// Returns `true` if `hi == lo`.
614- pub fn is_empty ( & self ) -> bool {
614+ pub fn is_empty ( self ) -> bool {
615615 let span = self . data_untracked ( ) ;
616616 span. hi == span. lo
617617 }
@@ -639,7 +639,7 @@ impl Span {
639639 ///
640640 /// Use this instead of `==` when either span could be generated code,
641641 /// and you only care that they point to the same bytes of source text.
642- pub fn source_equal ( & self , other : & Span ) -> bool {
642+ pub fn source_equal ( self , other : Span ) -> bool {
643643 let span = self . data ( ) ;
644644 let other = other. data ( ) ;
645645 span. lo == other. lo && span. hi == other. hi
@@ -680,17 +680,17 @@ impl Span {
680680 }
681681
682682 #[ inline]
683- pub fn rust_2015 ( & self ) -> bool {
683+ pub fn rust_2015 ( self ) -> bool {
684684 self . edition ( ) == edition:: Edition :: Edition2015
685685 }
686686
687687 #[ inline]
688- pub fn rust_2018 ( & self ) -> bool {
688+ pub fn rust_2018 ( self ) -> bool {
689689 self . edition ( ) >= edition:: Edition :: Edition2018
690690 }
691691
692692 #[ inline]
693- pub fn rust_2021 ( & self ) -> bool {
693+ pub fn rust_2021 ( self ) -> bool {
694694 self . edition ( ) >= edition:: Edition :: Edition2021
695695 }
696696
@@ -711,15 +711,15 @@ impl Span {
711711 /// Checks if a span is "internal" to a macro in which `#[unstable]`
712712 /// items can be used (that is, a macro marked with
713713 /// `#[allow_internal_unstable]`).
714- pub fn allows_unstable ( & self , feature : Symbol ) -> bool {
714+ pub fn allows_unstable ( self , feature : Symbol ) -> bool {
715715 self . ctxt ( )
716716 . outer_expn_data ( )
717717 . allow_internal_unstable
718718 . map_or ( false , |features| features. iter ( ) . any ( |& f| f == feature) )
719719 }
720720
721721 /// Checks if this span arises from a compiler desugaring of kind `kind`.
722- pub fn is_desugaring ( & self , kind : DesugaringKind ) -> bool {
722+ pub fn is_desugaring ( self , kind : DesugaringKind ) -> bool {
723723 match self . ctxt ( ) . outer_expn_data ( ) . kind {
724724 ExpnKind :: Desugaring ( k) => k == kind,
725725 _ => false ,
@@ -728,7 +728,7 @@ impl Span {
728728
729729 /// Returns the compiler desugaring that created this span, or `None`
730730 /// if this span is not from a desugaring.
731- pub fn desugaring_kind ( & self ) -> Option < DesugaringKind > {
731+ pub fn desugaring_kind ( self ) -> Option < DesugaringKind > {
732732 match self . ctxt ( ) . outer_expn_data ( ) . kind {
733733 ExpnKind :: Desugaring ( k) => Some ( k) ,
734734 _ => None ,
@@ -738,7 +738,7 @@ impl Span {
738738 /// Checks if a span is "internal" to a macro in which `unsafe`
739739 /// can be used without triggering the `unsafe_code` lint.
740740 // (that is, a macro marked with `#[allow_internal_unsafe]`).
741- pub fn allows_unsafe ( & self ) -> bool {
741+ pub fn allows_unsafe ( self ) -> bool {
742742 self . ctxt ( ) . outer_expn_data ( ) . allow_internal_unsafe
743743 }
744744
@@ -751,7 +751,7 @@ impl Span {
751751 return None ;
752752 }
753753
754- let is_recursive = expn_data. call_site . source_equal ( & prev_span) ;
754+ let is_recursive = expn_data. call_site . source_equal ( prev_span) ;
755755
756756 prev_span = self ;
757757 self = expn_data. call_site ;
@@ -865,13 +865,13 @@ impl Span {
865865
866866 /// Equivalent of `Span::call_site` from the proc macro API,
867867 /// except that the location is taken from the `self` span.
868- pub fn with_call_site_ctxt ( & self , expn_id : ExpnId ) -> Span {
868+ pub fn with_call_site_ctxt ( self , expn_id : ExpnId ) -> Span {
869869 self . with_ctxt_from_mark ( expn_id, Transparency :: Transparent )
870870 }
871871
872872 /// Equivalent of `Span::mixed_site` from the proc macro API,
873873 /// except that the location is taken from the `self` span.
874- pub fn with_mixed_site_ctxt ( & self , expn_id : ExpnId ) -> Span {
874+ pub fn with_mixed_site_ctxt ( self , expn_id : ExpnId ) -> Span {
875875 self . with_ctxt_from_mark ( expn_id, Transparency :: SemiTransparent )
876876 }
877877
0 commit comments