diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-02-27 17:11:14 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-03-02 10:48:52 +0100 |
| commit | b74e97cf42e647d87d67a03c134a0494b6aaa811 (patch) | |
| tree | a66e948a4d31dd9681cb6984a3b1fb774bebae4a /src/libsyntax_ext | |
| parent | 878f5b05147480182ea4d8a855acc55bfeb16c22 (diff) | |
| download | rust-b74e97cf42e647d87d67a03c134a0494b6aaa811.tar.gz rust-b74e97cf42e647d87d67a03c134a0494b6aaa811.zip | |
Replace Rc with Lrc for shared data
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/Cargo.toml | 1 | ||||
| -rw-r--r-- | src/libsyntax_ext/deriving/mod.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax_ext/lib.rs | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/libsyntax_ext/Cargo.toml b/src/libsyntax_ext/Cargo.toml index 1c470240288..d8eeb5ed255 100644 --- a/src/libsyntax_ext/Cargo.toml +++ b/src/libsyntax_ext/Cargo.toml @@ -14,3 +14,4 @@ proc_macro = { path = "../libproc_macro" } rustc_errors = { path = "../librustc_errors" } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } +rustc_data_structures = { path = "../librustc_data_structures" } \ No newline at end of file diff --git a/src/libsyntax_ext/deriving/mod.rs b/src/libsyntax_ext/deriving/mod.rs index 8159893e784..6bc4ee0b399 100644 --- a/src/libsyntax_ext/deriving/mod.rs +++ b/src/libsyntax_ext/deriving/mod.rs @@ -10,7 +10,7 @@ //! The compiler code necessary to implement the `#[derive]` extensions. -use std::rc::Rc; +use rustc_data_structures::sync::Lrc; use syntax::ast; use syntax::ext::base::{Annotatable, ExtCtxt, SyntaxExtension, Resolver}; use syntax::ext::build::AstBuilder; @@ -65,7 +65,7 @@ macro_rules! derive_traits { $( resolver.add_builtin( ast::Ident::with_empty_ctxt(Symbol::intern($name)), - Rc::new(SyntaxExtension::BuiltinDerive($func)) + Lrc::new(SyntaxExtension::BuiltinDerive($func)) ); )* } diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index 82d6ee5afa0..772dec72ab9 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -23,6 +23,7 @@ extern crate fmt_macros; extern crate syntax; extern crate syntax_pos; extern crate proc_macro; +extern crate rustc_data_structures; extern crate rustc_errors as errors; mod asm; @@ -44,7 +45,7 @@ pub mod deriving; pub mod proc_macro_impl; -use std::rc::Rc; +use rustc_data_structures::sync::Lrc; use syntax::ast; use syntax::ext::base::{MacroExpanderFn, NormalTT, NamedSyntaxExtension}; use syntax::symbol::Symbol; @@ -55,7 +56,7 @@ pub fn register_builtins(resolver: &mut syntax::ext::base::Resolver, deriving::register_builtin_derives(resolver); let mut register = |name, ext| { - resolver.add_builtin(ast::Ident::with_empty_ctxt(name), Rc::new(ext)); + resolver.add_builtin(ast::Ident::with_empty_ctxt(name), Lrc::new(ext)); }; macro_rules! register { |
