about summary refs log tree commit diff
path: root/src/libproc_macro
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-02-27 17:11:14 +0100
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-03-02 10:48:52 +0100
commitb74e97cf42e647d87d67a03c134a0494b6aaa811 (patch)
treea66e948a4d31dd9681cb6984a3b1fb774bebae4a /src/libproc_macro
parent878f5b05147480182ea4d8a855acc55bfeb16c22 (diff)
downloadrust-b74e97cf42e647d87d67a03c134a0494b6aaa811.tar.gz
rust-b74e97cf42e647d87d67a03c134a0494b6aaa811.zip
Replace Rc with Lrc for shared data
Diffstat (limited to 'src/libproc_macro')
-rw-r--r--src/libproc_macro/Cargo.toml1
-rw-r--r--src/libproc_macro/lib.rs7
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libproc_macro/Cargo.toml b/src/libproc_macro/Cargo.toml
index cfd83e348a8..c1b2622520b 100644
--- a/src/libproc_macro/Cargo.toml
+++ b/src/libproc_macro/Cargo.toml
@@ -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" }
diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs
index b18bb5a24b6..cf1d4024373 100644
--- a/src/libproc_macro/lib.rs
+++ b/src/libproc_macro/lib.rs
@@ -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)
     }
 }