fn hash_span(&mut self, span: Span) {
        debug!("hash_span: st={:?}", self.st);

        // If this is not an empty or invalid span, we want to hash the last
        // position that belongs to it, as opposed to hashing the first
        // position past it.
        let span_hi = if span.hi > span.lo {
            // We might end up in the middle of a multibyte character here,
            // but that's OK, since we are not trying to decode anything at
            // this position.
            span.hi - BytePos(1)
        } else {
            span.hi
        };

        let expn_kind = match span.expn_id {
            NO_EXPANSION => SawSpanExpnKind::NoExpansion,
            COMMAND_LINE_EXPN => SawSpanExpnKind::CommandLine,
            _ => SawSpanExpnKind::SomeExpansion,
        };

        let loc1 = self.codemap.byte_pos_to_line_and_col(span.lo);
        let loc1 = loc1.as_ref()
                       .map(|&(ref fm, line, col)| (&fm.name[..], line, col))
                       .unwrap_or(("???", 0, BytePos(0)));

        let loc2 = self.codemap.byte_pos_to_line_and_col(span_hi);
        let loc2 = loc2.as_ref()
                       .map(|&(ref fm, line, col)| (&fm.name[..], line, col))
                       .unwrap_or(("???", 0, BytePos(0)));

        let saw = if loc1.0 == loc2.0 {
            SawSpan(loc1.0,
                    loc1.1, loc1.2,
                    loc2.1, loc2.2,
                    expn_kind)
        } else {
            SawSpanTwoFiles(loc1.0, loc1.1, loc1.2,
                            loc2.0, loc2.1, loc2.2,
                            expn_kind)
        };
        saw.hash(self.st);

        if expn_kind == SawSpanExpnKind::SomeExpansion {
            let call_site = self.codemap.codemap().source_callsite(span);
            self.hash_span(call_site);
        }
    }
// Hash a span in a stable way. We can't directly hash the span's BytePos
// fields (that would be similar to hashing pointers, since those are just
// offsets into the CodeMap). Instead, we hash the (file name, line, column)
// triple, which stays the same even if the containing FileMap has moved
// within the CodeMap.
// Also note that we are hashing byte offsets for the column, not unicode
// codepoint offsets. For the purpose of the hash that's sufficient.
// Also, hashing filenames is expensive so we avoid doing it twice when the
// span starts and ends in the same file, which is almost always the case.
Hash a span in a stable way. We can't directly hash the span's BytePos
fields (that would be similar to hashing pointers, since those are just
offsets into the CodeMap). Instead, we hash the (file name, line, column)
triple, which stays the same even if the containing FileMap has moved
within the CodeMap.
Also note that we are hashing byte offsets for the column, not unicode
codepoint offsets. For the purpose of the hash that's sufficient.
Also, hashing filenames is expensive so we avoid doing it twice when the
span starts and ends in the same file, which is almost always the case.
Hash a span in a stable way . We can ' t directly hash the span ' s BytePos fields ( that would be similar to hashing pointers since those are just offsets into the CodeMap ) . Instead we hash the ( file name line column ) triple which stays the same even if the containing FileMap has moved within the CodeMap . Also note that we are hashing byte offsets for the column not unicode codepoint offsets . For the purpose of the hash that ' s sufficient . Also hashing filenames is expensive so we avoid doing it twice when the span starts and ends in the same file which is almost always the case .
fn hash_span(&mut self, span: Span) {
        debug!("hash_span: st={:?}", self.st);
        // If this is not an empty or invalid span, we want to hash the last
        // position that belongs to it, as opposed to hashing the first
        // position past it.
        let span_hi = if span.hi > span.lo {
            // We might end up in the middle of a multibyte character here,
            // but that's OK, since we are not trying to decode anything at
            // this position.
            span.hi - BytePos(1)
        } else {
            span.hi
        };
        let expn_kind = match span.expn_id {
            NO_EXPANSION => SawSpanExpnKind::NoExpansion,
            COMMAND_LINE_EXPN => SawSpanExpnKind::CommandLine,
            _ => SawSpanExpnKind::SomeExpansion,
        };
        let loc1 = self.codemap.byte_pos_to_line_and_col(span.lo);
        let loc1 = loc1.as_ref()
                       .map(|&(ref fm, line, col)| (&fm.name[..], line, col))
                       .unwrap_or(("???", 0, BytePos(0)));
        let loc2 = self.codemap.byte_pos_to_line_and_col(span_hi);
        let loc2 = loc2.as_ref()
                       .map(|&(ref fm, line, col)| (&fm.name[..], line, col))
                       .unwrap_or(("???", 0, BytePos(0)));
        let saw = if loc1.0 == loc2.0 {
            SawSpan(loc1.0,
                    loc1.1, loc1.2,
                    loc2.1, loc2.2,
                    expn_kind)
        } else {
            SawSpanTwoFiles(loc1.0, loc1.1, loc1.2,
                            loc2.0, loc2.1, loc2.2,
                            expn_kind)
        };
        saw.hash(self.st);
        if expn_kind == SawSpanExpnKind::SomeExpansion {
            let call_site = self.codemap.codemap().source_callsite(span);
            self.hash_span(call_site);
        }
    }
fn hash_span ( & mut self , span : Span ) { debug ! ( " " self st ) ; // If this is not an empty or invalid span, we want to hash the last // position that belongs to it, as opposed to hashing the first // position past it. let span_hi = if span . hi > span . lo { // We might end up in the middle of a multibyte character here, // but that's OK, since we are not trying to decode anything at // this position. span . hi - BytePos ( 1 ) } else { span . hi } ; let expn_kind = match span . expn_id { NO_EXPANSION => SawSpanExpnKind :: NoExpansion , COMMAND_LINE_EXPN => SawSpanExpnKind :: CommandLine , _ => SawSpanExpnKind :: SomeExpansion , } ; let loc1 = self . codemap . byte_pos_to_line_and_col ( span . lo ) ; let loc1 = loc1 . as_ref ( ) . map ( | & ( ref fm , line , col ) | ( & fm . name [ .. ] , line , col ) ) . unwrap_or ( ( " " , 0 , BytePos ( 0 ) ) ) ; let loc2 = self . codemap . byte_pos_to_line_and_col ( span_hi ) ; let loc2 = loc2 . as_ref ( ) . map ( | & ( ref fm , line , col ) | ( & fm . name [ .. ] , line , col ) ) . unwrap_or ( ( " " , 0 , BytePos ( 0 ) ) ) ; let saw = if loc1 . 0 == loc2 . 0 { SawSpan ( loc1 . 0 , loc1 . 1 , loc1 . 2 , loc2 . 1 , loc2 . 2 , expn_kind ) } else { SawSpanTwoFiles ( loc1 . 0 , loc1 . 1 , loc1 . 2 , loc2 . 0 , loc2 . 1 , loc2 . 2 , expn_kind ) } ; saw . hash ( self . st ) ; if expn_kind == SawSpanExpnKind :: SomeExpansion { let call_site = self . codemap . codemap ( ) . source_callsite ( span ) ; self . hash_span ( call_site ) ; } }
Hash a span in a stable way.
Hash a span in a stable way .
&mut self
span
Span