@@ -612,7 +612,7 @@ impl Span {
612612
613613 #[ inline]
614614 /// Returns `true` if `hi == lo`.
615- pub fn is_empty ( & self ) -> bool {
615+ pub fn is_empty ( self ) -> bool {
616616 let span = self . data_untracked ( ) ;
617617 span. hi == span. lo
618618 }
@@ -640,7 +640,7 @@ impl Span {
640640 ///
641641 /// Use this instead of `==` when either span could be generated code,
642642 /// and you only care that they point to the same bytes of source text.
643- pub fn source_equal ( & self , other : & Span ) -> bool {
643+ pub fn source_equal ( self , other : Span ) -> bool {
644644 let span = self . data ( ) ;
645645 let other = other. data ( ) ;
646646 span. lo == other. lo && span. hi == other. hi
@@ -681,17 +681,17 @@ impl Span {
681681 }
682682
683683 #[ inline]
684- pub fn rust_2015 ( & self ) -> bool {
684+ pub fn rust_2015 ( self ) -> bool {
685685 self . edition ( ) == edition:: Edition :: Edition2015
686686 }
687687
688688 #[ inline]
689- pub fn rust_2018 ( & self ) -> bool {
689+ pub fn rust_2018 ( self ) -> bool {
690690 self . edition ( ) >= edition:: Edition :: Edition2018
691691 }
692692
693693 #[ inline]
694- pub fn rust_2021 ( & self ) -> bool {
694+ pub fn rust_2021 ( self ) -> bool {
695695 self . edition ( ) >= edition:: Edition :: Edition2021
696696 }
697697
@@ -712,15 +712,15 @@ impl Span {
712712 /// Checks if a span is "internal" to a macro in which `#[unstable]`
713713 /// items can be used (that is, a macro marked with
714714 /// `#[allow_internal_unstable]`).
715- pub fn allows_unstable ( & self , feature : Symbol ) -> bool {
715+ pub fn allows_unstable ( self , feature : Symbol ) -> bool {
716716 self . ctxt ( )
717717 . outer_expn_data ( )
718718 . allow_internal_unstable
719719 . map_or ( false , |features| features. iter ( ) . any ( |& f| f == feature) )
720720 }
721721
722722 /// Checks if this span arises from a compiler desugaring of kind `kind`.
723- pub fn is_desugaring ( & self , kind : DesugaringKind ) -> bool {
723+ pub fn is_desugaring ( self , kind : DesugaringKind ) -> bool {
724724 match self . ctxt ( ) . outer_expn_data ( ) . kind {
725725 ExpnKind :: Desugaring ( k) => k == kind,
726726 _ => false ,
@@ -729,7 +729,7 @@ impl Span {
729729
730730 /// Returns the compiler desugaring that created this span, or `None`
731731 /// if this span is not from a desugaring.
732- pub fn desugaring_kind ( & self ) -> Option < DesugaringKind > {
732+ pub fn desugaring_kind ( self ) -> Option < DesugaringKind > {
733733 match self . ctxt ( ) . outer_expn_data ( ) . kind {
734734 ExpnKind :: Desugaring ( k) => Some ( k) ,
735735 _ => None ,
@@ -739,7 +739,7 @@ impl Span {
739739 /// Checks if a span is "internal" to a macro in which `unsafe`
740740 /// can be used without triggering the `unsafe_code` lint.
741741 // (that is, a macro marked with `#[allow_internal_unsafe]`).
742- pub fn allows_unsafe ( & self ) -> bool {
742+ pub fn allows_unsafe ( self ) -> bool {
743743 self . ctxt ( ) . outer_expn_data ( ) . allow_internal_unsafe
744744 }
745745
@@ -752,7 +752,7 @@ impl Span {
752752 return None ;
753753 }
754754
755- let is_recursive = expn_data. call_site . source_equal ( & prev_span) ;
755+ let is_recursive = expn_data. call_site . source_equal ( prev_span) ;
756756
757757 prev_span = self ;
758758 self = expn_data. call_site ;
@@ -866,13 +866,13 @@ impl Span {
866866
867867 /// Equivalent of `Span::call_site` from the proc macro API,
868868 /// except that the location is taken from the `self` span.
869- pub fn with_call_site_ctxt ( & self , expn_id : ExpnId ) -> Span {
869+ pub fn with_call_site_ctxt ( self , expn_id : ExpnId ) -> Span {
870870 self . with_ctxt_from_mark ( expn_id, Transparency :: Transparent )
871871 }
872872
873873 /// Equivalent of `Span::mixed_site` from the proc macro API,
874874 /// except that the location is taken from the `self` span.
875- pub fn with_mixed_site_ctxt ( & self , expn_id : ExpnId ) -> Span {
875+ pub fn with_mixed_site_ctxt ( self , expn_id : ExpnId ) -> Span {
876876 self . with_ctxt_from_mark ( expn_id, Transparency :: SemiTransparent )
877877 }
878878
0 commit comments