From dda924ab6a15ebccfa1be0bff5b88390f4195afd Mon Sep 17 00:00:00 2001 From: Irina-Gabriela Popa Date: Thu, 23 Nov 2017 18:07:18 +0200 Subject: [PATCH] rustc_back: move dynamic_lib to rustc_metadata. --- src/Cargo.lock | 1 - src/librustc_back/lib.rs | 3 --- src/librustc_metadata/creader.rs | 2 +- src/{librustc_back => librustc_metadata}/dynamic_lib.rs | 0 src/librustc_metadata/lib.rs | 3 +++ src/librustc_plugin/Cargo.toml | 1 - src/librustc_plugin/lib.rs | 1 - src/librustc_plugin/load.rs | 2 +- src/librustdoc/plugins.rs | 2 +- src/librustdoc/test.rs | 2 +- src/test/run-make/extern-fn-reachable/main.rs | 4 ++-- src/test/run-pass-fulldeps/auxiliary/linkage-visibility.rs | 4 ++-- 12 files changed, 11 insertions(+), 14 deletions(-) rename src/{librustc_back => librustc_metadata}/dynamic_lib.rs (100%) diff --git a/src/Cargo.lock b/src/Cargo.lock index 87903731f66..0ee46910f7d 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -1889,7 +1889,6 @@ name = "rustc_plugin" version = "0.0.0" dependencies = [ "rustc 0.0.0", - "rustc_back 0.0.0", "rustc_errors 0.0.0", "rustc_metadata 0.0.0", "syntax 0.0.0", diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index 5ed7b7f75bb..e338ee7bd93 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -28,10 +28,8 @@ #![feature(box_syntax)] #![feature(const_fn)] -#![feature(libc)] extern crate syntax; -extern crate libc; extern crate rand; extern crate serialize; #[macro_use] extern crate log; @@ -40,7 +38,6 @@ extern crate serialize as rustc_serialize; // used by deriving pub mod tempdir; pub mod target; -pub mod dynamic_lib; use std::str::FromStr; diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index 155097cdbe2..e1c5cde42ec 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -556,7 +556,7 @@ impl<'a> CrateLoader<'a> { use std::{env, mem}; use proc_macro::TokenStream; use proc_macro::__internal::Registry; - use rustc_back::dynamic_lib::DynamicLibrary; + use dynamic_lib::DynamicLibrary; use syntax_ext::deriving::custom::ProcMacroDerive; use syntax_ext::proc_macro_impl::{AttrProcMacro, BangProcMacro}; diff --git a/src/librustc_back/dynamic_lib.rs b/src/librustc_metadata/dynamic_lib.rs similarity index 100% rename from src/librustc_back/dynamic_lib.rs rename to src/librustc_metadata/dynamic_lib.rs diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs index 20bdfaea0d0..6c1ca362323 100644 --- a/src/librustc_metadata/lib.rs +++ b/src/librustc_metadata/lib.rs @@ -16,12 +16,14 @@ #![feature(box_patterns)] #![feature(conservative_impl_trait)] #![feature(i128_type)] +#![feature(libc)] #![feature(proc_macro_internals)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(specialization)] #![feature(rustc_private)] +extern crate libc; #[macro_use] extern crate log; #[macro_use] @@ -54,6 +56,7 @@ mod link_args; pub mod creader; pub mod cstore; +pub mod dynamic_lib; pub mod locator; __build_diagnostic_array! { librustc_metadata, DIAGNOSTICS } diff --git a/src/librustc_plugin/Cargo.toml b/src/librustc_plugin/Cargo.toml index 7f41d052761..d8fa1da1ce2 100644 --- a/src/librustc_plugin/Cargo.toml +++ b/src/librustc_plugin/Cargo.toml @@ -11,7 +11,6 @@ crate-type = ["dylib"] [dependencies] rustc = { path = "../librustc" } -rustc_back = { path = "../librustc_back" } rustc_metadata = { path = "../librustc_metadata" } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } diff --git a/src/librustc_plugin/lib.rs b/src/librustc_plugin/lib.rs index a2a6d183e9c..3df56c4e728 100644 --- a/src/librustc_plugin/lib.rs +++ b/src/librustc_plugin/lib.rs @@ -71,7 +71,6 @@ #[macro_use] extern crate syntax; extern crate rustc; -extern crate rustc_back; extern crate rustc_metadata; extern crate syntax_pos; extern crate rustc_errors as errors; diff --git a/src/librustc_plugin/load.rs b/src/librustc_plugin/load.rs index aba56788928..8a4ec03b20e 100644 --- a/src/librustc_plugin/load.rs +++ b/src/librustc_plugin/load.rs @@ -115,7 +115,7 @@ impl<'a> PluginLoader<'a> { span: Span, path: PathBuf, symbol: String) -> PluginRegistrarFun { - use rustc_back::dynamic_lib::DynamicLibrary; + use rustc_metadata::dynamic_lib::DynamicLibrary; // Make sure the path contains a / or the linker will search for it. let path = env::current_dir().unwrap().join(&path); diff --git a/src/librustdoc/plugins.rs b/src/librustdoc/plugins.rs index 4fc5159588d..1a1e60a6945 100644 --- a/src/librustdoc/plugins.rs +++ b/src/librustdoc/plugins.rs @@ -16,7 +16,7 @@ use std::mem; use std::string::String; use std::path::PathBuf; -use rustc_back::dynamic_lib as dl; +use rustc_metadata::dynamic_lib as dl; pub type PluginResult = clean::Crate; pub type PluginCallback = fn (clean::Crate) -> PluginResult; diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index ee0d9a7f3e2..98369949c02 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -27,7 +27,7 @@ use rustc::hir::intravisit; use rustc::session::{self, CompileIncomplete, config}; use rustc::session::config::{OutputType, OutputTypes, Externs}; use rustc::session::search_paths::{SearchPaths, PathKind}; -use rustc_back::dynamic_lib::DynamicLibrary; +use rustc_metadata::dynamic_lib::DynamicLibrary; use rustc_back::tempdir::TempDir; use rustc_driver::{self, driver, Compilation}; use rustc_driver::driver::phase_2_configure_and_expand; diff --git a/src/test/run-make/extern-fn-reachable/main.rs b/src/test/run-make/extern-fn-reachable/main.rs index a1bd1041d14..27387332c1c 100644 --- a/src/test/run-make/extern-fn-reachable/main.rs +++ b/src/test/run-make/extern-fn-reachable/main.rs @@ -10,9 +10,9 @@ #![feature(rustc_private)] -extern crate rustc_back; +extern crate rustc_metadata; -use rustc_back::dynamic_lib::DynamicLibrary; +use rustc_metadata::dynamic_lib::DynamicLibrary; use std::path::Path; pub fn main() { diff --git a/src/test/run-pass-fulldeps/auxiliary/linkage-visibility.rs b/src/test/run-pass-fulldeps/auxiliary/linkage-visibility.rs index 09a2e8ecd87..7a15a4cb3a2 100644 --- a/src/test/run-pass-fulldeps/auxiliary/linkage-visibility.rs +++ b/src/test/run-pass-fulldeps/auxiliary/linkage-visibility.rs @@ -14,9 +14,9 @@ // do the runtime check that these functions aren't exported. #![allow(private_no_mangle_fns)] -extern crate rustc_back; +extern crate rustc_metadata; -use rustc_back::dynamic_lib::DynamicLibrary; +use rustc_metadata::dynamic_lib::DynamicLibrary; #[no_mangle] pub fn foo() { bar(); }