Replace Rc with Lrc for shared data

This commit is contained in:
John Kåre Alsaker
2018-02-27 17:11:14 +01:00
parent 878f5b0514
commit b74e97cf42
86 changed files with 435 additions and 413 deletions

View File

@@ -11,3 +11,4 @@ crate-type = ["dylib"]
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
rustc_errors = { path = "../librustc_errors" }
rustc_data_structures = { path = "../librustc_data_structures" }

View File

@@ -43,6 +43,7 @@
extern crate syntax;
extern crate syntax_pos;
extern crate rustc_errors;
extern crate rustc_data_structures;
mod diagnostic;
@@ -50,7 +51,7 @@ mod diagnostic;
pub use diagnostic::{Diagnostic, Level};
use std::{ascii, fmt, iter};
use std::rc::Rc;
use rustc_data_structures::sync::Lrc;
use std::str::FromStr;
use syntax::ast;
@@ -306,7 +307,7 @@ pub struct LineColumn {
#[unstable(feature = "proc_macro", issue = "38356")]
#[derive(Clone)]
pub struct SourceFile {
filemap: Rc<FileMap>,
filemap: Lrc<FileMap>,
}
impl SourceFile {
@@ -356,7 +357,7 @@ impl fmt::Debug for SourceFile {
#[unstable(feature = "proc_macro", issue = "38356")]
impl PartialEq for SourceFile {
fn eq(&self, other: &Self) -> bool {
Rc::ptr_eq(&self.filemap, &other.filemap)
Lrc::ptr_eq(&self.filemap, &other.filemap)
}
}