// sub_span starts at span.lo, so we need to adjust the positions etc.
// If sub_span is None, we don't need to adjust.
sub_span starts at span.lo, so we need to adjust the positions etc.
If sub_span is None, we don't need to adjust.
sub_span starts at span . lo so we need to adjust the positions etc . If sub_span is None we don ' t need to adjust .
pub fn make_sub_span(&self, span: Span, sub_span: Option<Span>) -> Option<Span> {
        match sub_span {
            None => None,
            Some(sub) => {
                let FileMapAndBytePos {fm, pos} = self.sess.codemap().lookup_byte_offset(span.lo);
                let base = pos + fm.start_pos;
                Some(Span {
                    lo: base + self.sess.codemap().lookup_byte_offset(sub.lo).pos,
                    hi: base + self.sess.codemap().lookup_byte_offset(sub.hi).pos,
                    expn_id: span.expn_id,
                })
            }
        }
    }
pub fn make_sub_span ( & self , span : Span , sub_span : Option < Span > ) -> Option < Span > { match sub_span { None => None , Some ( sub ) => { let FileMapAndBytePos { fm , pos } = self . sess . codemap ( ) . lookup_byte_offset ( span . lo ) ; let base = pos + fm . start_pos ; Some ( Span { lo : base + self . sess . codemap ( ) . lookup_byte_offset ( sub . lo ) . pos , hi : base + self . sess . codemap ( ) . lookup_byte_offset ( sub . hi ) . pos , expn_id : span . expn_id , } ) } } }
sub_span starts at span.lo, so we need to adjust the positions etc.
sub_span starts at span . lo so we need to adjust the positions etc .
&self
span
Span
sub_span
Option<Span>