pub fn new_imported_filemap(&self,
                                filename: FileName,
                                abs_path: Option<FileName>,
                                source_len: usize,
                                mut file_local_lines: Vec<BytePos>,
                                mut file_local_multibyte_chars: Vec<MultiByteChar>)
                                -> Rc<FileMap> {
        let start_pos = self.next_start_pos();
        let mut files = self.files.borrow_mut();

        let end_pos = Pos::from_usize(start_pos + source_len);
        let start_pos = Pos::from_usize(start_pos);

        for pos in &mut file_local_lines {
            *pos = *pos + start_pos;
        }

        for mbc in &mut file_local_multibyte_chars {
            mbc.pos = mbc.pos + start_pos;
        }

        let filemap = Rc::new(FileMap {
            name: filename,
            abs_path: abs_path,
            src: None,
            start_pos: start_pos,
            end_pos: end_pos,
            lines: RefCell::new(file_local_lines),
            multibyte_chars: RefCell::new(file_local_multibyte_chars),
        });

        files.push(filemap.clone());

        filemap
    }
/// Allocates a new FileMap representing a source file from an external
/// crate. The source code of such an "imported filemap" is not available,
/// but we still know enough to generate accurate debuginfo location
/// information for things inlined from other crates.
Allocates a new FileMap representing a source file from an external
crate. The source code of such an "imported filemap" is not available,
but we still know enough to generate accurate debuginfo location
information for things inlined from other crates.
Allocates a new FileMap representing a source file from an external crate . The source code of such an " imported filemap " is not available but we still know enough to generate accurate debuginfo location information for things inlined from other crates .
pub fn new_imported_filemap(&self,
                                filename: FileName,
                                abs_path: Option<FileName>,
                                source_len: usize,
                                mut file_local_lines: Vec<BytePos>,
                                mut file_local_multibyte_chars: Vec<MultiByteChar>)
                                -> Rc<FileMap> {
        let start_pos = self.next_start_pos();
        let mut files = self.files.borrow_mut();
        let end_pos = Pos::from_usize(start_pos + source_len);
        let start_pos = Pos::from_usize(start_pos);
        for pos in &mut file_local_lines {
            *pos = *pos + start_pos;
        }
        for mbc in &mut file_local_multibyte_chars {
            mbc.pos = mbc.pos + start_pos;
        }
        let filemap = Rc::new(FileMap {
            name: filename,
            abs_path: abs_path,
            src: None,
            start_pos: start_pos,
            end_pos: end_pos,
            lines: RefCell::new(file_local_lines),
            multibyte_chars: RefCell::new(file_local_multibyte_chars),
        });
        files.push(filemap.clone());
        filemap
    }
pub fn new_imported_filemap ( & self , filename : FileName , abs_path : Option < FileName > , source_len : usize , mut file_local_lines : Vec < BytePos > , mut file_local_multibyte_chars : Vec < MultiByteChar > ) -> Rc < FileMap > { let start_pos = self . next_start_pos ( ) ; let mut files = self . files . borrow_mut ( ) ; let end_pos = Pos :: from_usize ( start_pos + source_len ) ; let start_pos = Pos :: from_usize ( start_pos ) ; for pos in & mut file_local_lines { * pos = * pos + start_pos ; } for mbc in & mut file_local_multibyte_chars { mbc . pos = mbc . pos + start_pos ; } let filemap = Rc :: new ( FileMap { name : filename , abs_path : abs_path , src : None , start_pos : start_pos , end_pos : end_pos , lines : RefCell :: new ( file_local_lines ) , multibyte_chars : RefCell :: new ( file_local_multibyte_chars ) , } ) ; files . push ( filemap . clone ( ) ) ; filemap }
Allocates a new FileMap representing a source file from an external
crate.
Allocates a new FileMap representing a source file from an external crate .
&self
filename
FileName
abs_path
Option<FileName>
source_len
usize
file_local_lines
Vec<BytePos>
file_local_multibyte_chars
Vec<MultiByteChar>
&self
filename
FileName
abs_path
Option<FileName>
source_len
usize
file_local_lines
Vec<BytePos>
file_local_multibyte_chars
Vec<MultiByteChar>