fn imported_source_files(
        &'a self,
        local_source_map: &source_map::SourceMap,
    ) -> &[ImportedSourceFile] {
        self.source_map_import_info.init_locking(|| {
            let external_source_map = self.root.source_map.decode(self);

            external_source_map.map(|source_file_to_import| {
                // We can't reuse an existing SourceFile, so allocate a new one
                // containing the information we need.
                let syntax_pos::SourceFile { name,
                                          name_was_remapped,
                                          src_hash,
                                          start_pos,
                                          end_pos,
                                          mut lines,
                                          mut multibyte_chars,
                                          mut non_narrow_chars,
                                          mut normalized_pos,
                                          name_hash,
                                          .. } = source_file_to_import;

                let source_length = (end_pos - start_pos).to_usize();

                // Translate line-start positions and multibyte character
                // position into frame of reference local to file.
                // `SourceMap::new_imported_source_file()` will then translate those
                // coordinates to their new global frame of reference when the
                // offset of the SourceFile is known.
                for pos in &mut lines {
                    *pos = *pos - start_pos;
                }
                for mbc in &mut multibyte_chars {
                    mbc.pos = mbc.pos - start_pos;
                }
                for swc in &mut non_narrow_chars {
                    *swc = *swc - start_pos;
                }
                for np in &mut normalized_pos {
                    np.pos = np.pos - start_pos;
                }

                let local_version = local_source_map.new_imported_source_file(name,
                                                                       name_was_remapped,
                                                                       self.cnum.as_u32(),
                                                                       src_hash,
                                                                       name_hash,
                                                                       source_length,
                                                                       lines,
                                                                       multibyte_chars,
                                                                       non_narrow_chars,
                                                                       normalized_pos);
                debug!("CrateMetaData::imported_source_files alloc \
                        source_file {:?} original (start_pos {:?} end_pos {:?}) \
                        translated (start_pos {:?} end_pos {:?})",
                       local_version.name, start_pos, end_pos,
                       local_version.start_pos, local_version.end_pos);

                ImportedSourceFile {
                    original_start_pos: start_pos,
                    original_end_pos: end_pos,
                    translated_source_file: local_version,
                }
            }).collect()
        })
    }
/// Imports the source_map from an external crate into the source_map of the crate
/// currently being compiled (the "local crate").
///
/// The import algorithm works analogous to how AST items are inlined from an
/// external crate's metadata:
/// For every SourceFile in the external source_map an 'inline' copy is created in the
/// local source_map. The correspondence relation between external and local
/// SourceFiles is recorded in the `ImportedSourceFile` objects returned from this
/// function. When an item from an external crate is later inlined into this
/// crate, this correspondence information is used to translate the span
/// information of the inlined item so that it refers the correct positions in
/// the local source_map (see `<decoder::DecodeContext as SpecializedDecoder<Span>>`).
///
/// The import algorithm in the function below will reuse SourceFiles already
/// existing in the local source_map. For example, even if the SourceFile of some
/// source file of libstd gets imported many times, there will only ever be
/// one SourceFile object for the corresponding file in the local source_map.
///
/// Note that imported SourceFiles do not actually contain the source code of the
/// file they represent, just information about length, line breaks, and
/// multibyte characters. This information is enough to generate valid debuginfo
/// for items inlined from other crates.
///
/// Proc macro crates don't currently export spans, so this function does not have
/// to work for them.
Imports the source_map from an external crate into the source_map of the crate
currently being compiled (the "local crate").

The import algorithm works analogous to how AST items are inlined from an
external crate's metadata:
For every SourceFile in the external source_map an 'inline' copy is created in the
local source_map. The correspondence relation between external and local
SourceFiles is recorded in the `ImportedSourceFile` objects returned from this
function. When an item from an external crate is later inlined into this
crate, this correspondence information is used to translate the span
information of the inlined item so that it refers the correct positions in
the local source_map .

The import algorithm in the function below will reuse SourceFiles already
existing in the local source_map. For example, even if the SourceFile of some
source file of libstd gets imported many times, there will only ever be
one SourceFile object for the corresponding file in the local source_map.

Note that imported SourceFiles do not actually contain the source code of the
file they represent, just information about length, line breaks, and
multibyte characters. This information is enough to generate valid debuginfo
for items inlined from other crates.

Proc macro crates don't currently export spans, so this function does not have
to work for them.
Imports the source_map from an external crate into the source_map of the crate currently being compiled ( the " local crate " ) . The import algorithm works analogous to how AST items are inlined from an external crate ' s metadata : For every SourceFile in the external source_map an ' inline ' copy is created in the local source_map . The correspondence relation between external and local SourceFiles is recorded in the ` ImportedSourceFile ` objects returned from this function . When an item from an external crate is later inlined into this crate this correspondence information is used to translate the span information of the inlined item so that it refers the correct positions in the local source_map . The import algorithm in the function below will reuse SourceFiles already existing in the local source_map . For example even if the SourceFile of some source file of libstd gets imported many times there will only ever be one SourceFile object for the corresponding file in the local source_map . Note that imported SourceFiles do not actually contain the source code of the file they represent just information about length line breaks and multibyte characters . This information is enough to generate valid debuginfo for items inlined from other crates . Proc macro crates don ' t currently export spans so this function does not have to work for them .
fn imported_source_files(
        &'a self,
        local_source_map: &source_map::SourceMap,
    ) -> &[ImportedSourceFile] {
        self.source_map_import_info.init_locking(|| {
            let external_source_map = self.root.source_map.decode(self);
            external_source_map.map(|source_file_to_import| {
                // We can't reuse an existing SourceFile, so allocate a new one
                // containing the information we need.
                let syntax_pos::SourceFile { name,
                                          name_was_remapped,
                                          src_hash,
                                          start_pos,
                                          end_pos,
                                          mut lines,
                                          mut multibyte_chars,
                                          mut non_narrow_chars,
                                          mut normalized_pos,
                                          name_hash,
                                          .. } = source_file_to_import;
                let source_length = (end_pos - start_pos).to_usize();
                // Translate line-start positions and multibyte character
                // position into frame of reference local to file.
                // `SourceMap::new_imported_source_file()` will then translate those
                // coordinates to their new global frame of reference when the
                // offset of the SourceFile is known.
                for pos in &mut lines {
                    *pos = *pos - start_pos;
                }
                for mbc in &mut multibyte_chars {
                    mbc.pos = mbc.pos - start_pos;
                }
                for swc in &mut non_narrow_chars {
                    *swc = *swc - start_pos;
                }
                for np in &mut normalized_pos {
                    np.pos = np.pos - start_pos;
                }
                let local_version = local_source_map.new_imported_source_file(name,
                                                                       name_was_remapped,
                                                                       self.cnum.as_u32(),
                                                                       src_hash,
                                                                       name_hash,
                                                                       source_length,
                                                                       lines,
                                                                       multibyte_chars,
                                                                       non_narrow_chars,
                                                                       normalized_pos);
                debug!("CrateMetaData::imported_source_files alloc \
                        source_file {:?} original (start_pos {:?} end_pos {:?}) \
                        translated (start_pos {:?} end_pos {:?})",
                       local_version.name, start_pos, end_pos,
                       local_version.start_pos, local_version.end_pos);
                ImportedSourceFile {
                    original_start_pos: start_pos,
                    original_end_pos: end_pos,
                    translated_source_file: local_version,
                }
            }).collect()
        })
    }
fn imported_source_files ( & ' a self , local_source_map : & source_map :: SourceMap , ) -> & [ ImportedSourceFile ] { self . source_map_import_info . init_locking ( | | { let external_source_map = self . root . source_map . decode ( self ) ; external_source_map . map ( | source_file_to_import | { // We can't reuse an existing SourceFile, so allocate a new one // containing the information we need. let syntax_pos :: SourceFile { name , name_was_remapped , src_hash , start_pos , end_pos , mut lines , mut multibyte_chars , mut non_narrow_chars , mut normalized_pos , name_hash , .. } = source_file_to_import ; let source_length = ( end_pos - start_pos ) . to_usize ( ) ; // Translate line-start positions and multibyte character // position into frame of reference local to file. // `SourceMap::new_imported_source_file()` will then translate those // coordinates to their new global frame of reference when the // offset of the SourceFile is known. for pos in & mut lines { * pos = * pos - start_pos ; } for mbc in & mut multibyte_chars { mbc . pos = mbc . pos - start_pos ; } for swc in & mut non_narrow_chars { * swc = * swc - start_pos ; } for np in & mut normalized_pos { np . pos = np . pos - start_pos ; } let local_version = local_source_map . new_imported_source_file ( name , name_was_remapped , self . cnum . as_u32 ( ) , src_hash , name_hash , source_length , lines , multibyte_chars , non_narrow_chars , normalized_pos ) ; debug ! ( " \
 \
 " local_version name start_pos end_pos local_version start_pos local_version end_pos ) ; ImportedSourceFile { original_start_pos : start_pos , original_end_pos : end_pos , translated_source_file : local_version , } } ) . collect ( ) } ) }
Imports the source_map from an external crate into the source_map of the crate
currently being compiled (the "local crate").
Imports the source_map from an external crate into the source_map of the crate currently being compiled ( the " local crate " ) .
&'a self
local_source_map
&source_map::SourceMap