From 1430a3500076ad504a0b30be77fd2ad4468ea769 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Sun, 22 Nov 2015 22:14:09 +0200 Subject: [PATCH] move librustc/plugin to librustc_plugin this is a [breaking-change] to all plugin authors - sorry --- mk/crates.mk | 6 +++-- src/doc/book/compiler-plugins.md | 12 ++++++---- src/librustc/diagnostics.rs | 1 - src/librustc/lib.rs | 5 +--- src/librustc_driver/driver.rs | 4 ++-- src/librustc_driver/lib.rs | 1 + src/librustc_lint/lib.rs | 2 +- .../plugin => librustc_plugin}/build.rs | 0 src/librustc_plugin/diagnostics.rs | 19 +++++++++++++++ .../plugin/mod.rs => librustc_plugin/lib.rs} | 23 +++++++++++++++++++ .../plugin => librustc_plugin}/load.rs | 8 +++---- .../plugin => librustc_plugin}/registry.rs | 4 ++-- src/test/auxiliary/attr_plugin_test.rs | 3 ++- src/test/auxiliary/custom_derive_plugin.rs | 3 ++- .../auxiliary/custom_derive_plugin_attr.rs | 3 ++- .../issue_16723_multiple_items_syntax_ext.rs | 3 ++- src/test/auxiliary/lint_for_crate.rs | 3 ++- src/test/auxiliary/lint_group_plugin_test.rs | 3 ++- src/test/auxiliary/lint_plugin_test.rs | 3 ++- src/test/auxiliary/llvm_pass_plugin.rs | 3 ++- .../auxiliary/lto-syntax-extension-plugin.rs | 3 ++- .../auxiliary/macro_crate_MacroRulesTT.rs | 3 ++- src/test/auxiliary/macro_crate_test.rs | 3 ++- src/test/auxiliary/plugin_args.rs | 3 ++- .../plugin_crate_outlive_expansion_phase.rs | 3 ++- src/test/auxiliary/plugin_with_plugin_lib.rs | 3 ++- src/test/auxiliary/procedural_mbe_matching.rs | 3 ++- src/test/auxiliary/rlib_crate_test.rs | 3 ++- src/test/auxiliary/roman_numerals.rs | 3 ++- .../syntax_extension_with_dll_deps_2.rs | 3 ++- 30 files changed, 100 insertions(+), 39 deletions(-) rename src/{librustc/plugin => librustc_plugin}/build.rs (100%) create mode 100644 src/librustc_plugin/diagnostics.rs rename src/{librustc/plugin/mod.rs => librustc_plugin/lib.rs} (69%) rename src/{librustc/plugin => librustc_plugin}/load.rs (97%) rename src/{librustc/plugin => librustc_plugin}/registry.rs (98%) diff --git a/mk/crates.mk b/mk/crates.mk index 89a836eb7cb..89769b850e3 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -56,7 +56,8 @@ TARGET_CRATES := libc std flate arena term \ alloc_system RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \ rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \ - rustc_data_structures rustc_front rustc_platform_intrinsics + rustc_data_structures rustc_front rustc_platform_intrinsics \ + rustc_plugin HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros TOOLS := compiletest rustdoc rustc rustbook error-index-generator @@ -94,7 +95,7 @@ DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax DEPS_rustc_data_structures := std log serialize DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \ rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \ - rustc_trans rustc_privacy rustc_lint rustc_front + rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin DEPS_rustc_front := std syntax log serialize DEPS_rustc_lint := rustc log syntax @@ -102,6 +103,7 @@ DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags DEPS_rustc_mir := rustc rustc_front syntax DEPS_rustc_resolve := rustc rustc_front log syntax DEPS_rustc_platform_intrinsics := rustc rustc_llvm +DEPS_rustc_plugin := rustc syntax DEPS_rustc_privacy := rustc rustc_front log syntax DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \ log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics diff --git a/src/doc/book/compiler-plugins.md b/src/doc/book/compiler-plugins.md index 2cb62cdfca5..800be13a243 100644 --- a/src/doc/book/compiler-plugins.md +++ b/src/doc/book/compiler-plugins.md @@ -8,12 +8,12 @@ extend the compiler's behavior with new syntax extensions, lint checks, etc. A plugin is a dynamic library crate with a designated *registrar* function that registers extensions with `rustc`. Other crates can load these extensions using the crate attribute `#![plugin(...)]`. See the -[`rustc::plugin`](../rustc/plugin/index.html) documentation for more about the +[`rustc_plugin`](../rustc_plugin/index.html) documentation for more about the mechanics of defining and loading a plugin. If present, arguments passed as `#![plugin(foo(... args ...))]` are not interpreted by rustc itself. They are provided to the plugin through the -`Registry`'s [`args` method](../rustc/plugin/registry/struct.Registry.html#method.args). +`Registry`'s [`args` method](../rustc_plugin/registry/struct.Registry.html#method.args). In the vast majority of cases, a plugin should *only* be used through `#![plugin]` and not through an `extern crate` item. Linking a plugin would @@ -43,13 +43,14 @@ that implements Roman numeral integer literals. extern crate syntax; extern crate rustc; +extern crate rustc_plugin; use syntax::codemap::Span; use syntax::parse::token; use syntax::ast::TokenTree; use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager}; use syntax::ext::build::AstBuilder; // trait for expr_usize -use rustc::plugin::Registry; +use rustc_plugin::Registry; fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree]) -> Box { @@ -120,7 +121,7 @@ The advantages over a simple `fn(&str) -> u32` are: In addition to procedural macros, you can define new [`derive`](../reference.html#derive)-like attributes and other kinds of extensions. See -[`Registry::register_syntax_extension`](../rustc/plugin/registry/struct.Registry.html#method.register_syntax_extension) +[`Registry::register_syntax_extension`](../rustc_plugin/registry/struct.Registry.html#method.register_syntax_extension) and the [`SyntaxExtension` enum](https://doc.rust-lang.org/syntax/ext/base/enum.SyntaxExtension.html). For a more involved macro example, see @@ -189,10 +190,11 @@ extern crate syntax; // Load rustc as a plugin to get macros #[macro_use] extern crate rustc; +extern crate rustc_plugin; use rustc::lint::{EarlyContext, LintContext, LintPass, EarlyLintPass, EarlyLintPassObject, LintArray}; -use rustc::plugin::Registry; +use rustc_plugin::Registry; use syntax::ast; declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'"); diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index f4d7a318691..a088567b419 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -2181,6 +2181,5 @@ register_diagnostics! { E0491, // in type `..`, reference has a longer lifetime than the data it... E0492, // cannot borrow a constant which contains interior mutability E0495, // cannot infer an appropriate lifetime due to conflicting requirements - E0498, // malformed plugin attribute E0514, // metadata version mismatch } diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index a81ecd38638..62646f6bc56 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -33,7 +33,6 @@ #![feature(const_fn)] #![feature(core)] #![feature(duration_span)] -#![feature(dynamic_lib)] #![feature(enumset)] #![feature(hashmap_hasher)] #![feature(into_cow)] @@ -100,8 +99,8 @@ pub mod front { } pub mod middle { - pub mod expr_use_visitor; // STAGE0: increase glitch immunity pub mod astconv_util; + pub mod expr_use_visitor; // STAGE0: increase glitch immunity pub mod astencode; pub mod cfg; pub mod check_const; @@ -142,8 +141,6 @@ pub mod metadata; pub mod session; -pub mod plugin; - pub mod lint; pub mod util { diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 8d7e97440dd..d00b08538d2 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -22,8 +22,6 @@ use rustc::metadata::cstore::CStore; use rustc::middle::{stability, ty, reachable}; use rustc::middle::dependency_format; use rustc::middle; -use rustc::plugin::registry::Registry; -use rustc::plugin; use rustc::util::nodemap::NodeMap; use rustc::util::common::time; use rustc_borrowck as borrowck; @@ -33,6 +31,8 @@ use rustc_trans::back::write; use rustc_trans::trans; use rustc_typeck as typeck; use rustc_privacy; +use rustc_plugin::registry::Registry; +use rustc_plugin as plugin; use rustc_front::hir; use rustc_front::lowering::{lower_crate, LoweringContext}; use super::Compilation; diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index d28bd5b511d..fdbb093eab0 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -45,6 +45,7 @@ extern crate rustc_back; extern crate rustc_borrowck; extern crate rustc_front; extern crate rustc_lint; +extern crate rustc_plugin; extern crate rustc_privacy; extern crate rustc_mir; extern crate rustc_resolve; diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 06e54141d7a..d48dbdc5f51 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -13,7 +13,7 @@ //! This currently only contains the definitions and implementations //! of most of the lints that `rustc` supports directly, it does not //! contain the infrastructure for defining/registering lints. That is -//! available in `rustc::lint` and `rustc::plugin` respectively. +//! available in `rustc::lint` and `rustc_plugin` respectively. //! //! # Note //! diff --git a/src/librustc/plugin/build.rs b/src/librustc_plugin/build.rs similarity index 100% rename from src/librustc/plugin/build.rs rename to src/librustc_plugin/build.rs diff --git a/src/librustc_plugin/diagnostics.rs b/src/librustc_plugin/diagnostics.rs new file mode 100644 index 00000000000..100c1db1439 --- /dev/null +++ b/src/librustc_plugin/diagnostics.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(non_snake_case)] + +register_long_diagnostics! { + +} + +register_diagnostics! { + E0498 // malformed plugin attribute +} diff --git a/src/librustc/plugin/mod.rs b/src/librustc_plugin/lib.rs similarity index 69% rename from src/librustc/plugin/mod.rs rename to src/librustc_plugin/lib.rs index 4a85e1893f0..33d63d833c7 100644 --- a/src/librustc/plugin/mod.rs +++ b/src/librustc_plugin/lib.rs @@ -50,8 +50,31 @@ //! See the [Plugins Chapter](../../book/compiler-plugins.html) of the book //! for more examples. +#![cfg_attr(stage0, feature(custom_attribute))] +#![crate_name = "rustc_plugin"] +#![unstable(feature = "rustc_private", issue = "27812")] +#![cfg_attr(stage0, staged_api)] +#![crate_type = "dylib"] +#![crate_type = "rlib"] +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", + html_favicon_url = "https://doc.rust-lang.org/favicon.ico", + html_root_url = "https://doc.rust-lang.org/nightly/")] + +#![feature(dynamic_lib)] +#![feature(staged_api)] +#![feature(rustc_diagnostic_macros)] +#![feature(rustc_private)] + +#[macro_use] extern crate log; +#[macro_use] extern crate syntax; +#[macro_use] #[no_link] extern crate rustc_bitflags; + +extern crate rustc; +extern crate rustc_front; + pub use self::registry::Registry; +pub mod diagnostics; pub mod registry; pub mod load; pub mod build; diff --git a/src/librustc/plugin/load.rs b/src/librustc_plugin/load.rs similarity index 97% rename from src/librustc/plugin/load.rs rename to src/librustc_plugin/load.rs index ed721b6dab0..d121a306c61 100644 --- a/src/librustc/plugin/load.rs +++ b/src/librustc_plugin/load.rs @@ -10,10 +10,10 @@ //! Used by `rustc` when loading a plugin. -use session::Session; -use metadata::creader::CrateReader; -use metadata::cstore::CStore; -use plugin::registry::Registry; +use rustc::session::Session; +use rustc::metadata::creader::CrateReader; +use rustc::metadata::cstore::CStore; +use registry::Registry; use std::borrow::ToOwned; use std::env; diff --git a/src/librustc/plugin/registry.rs b/src/librustc_plugin/registry.rs similarity index 98% rename from src/librustc/plugin/registry.rs rename to src/librustc_plugin/registry.rs index 50ca092dfe6..3138d7fa1db 100644 --- a/src/librustc/plugin/registry.rs +++ b/src/librustc_plugin/registry.rs @@ -10,8 +10,8 @@ //! Used by plugin crates to tell `rustc` about the plugins they provide. -use lint::{EarlyLintPassObject, LateLintPassObject, LintId, Lint}; -use session::Session; +use rustc::lint::{EarlyLintPassObject, LateLintPassObject, LintId, Lint}; +use rustc::session::Session; use syntax::ext::base::{SyntaxExtension, NamedSyntaxExtension, NormalTT}; use syntax::ext::base::{IdentTT, MultiModifier, MultiDecorator}; diff --git a/src/test/auxiliary/attr_plugin_test.rs b/src/test/auxiliary/attr_plugin_test.rs index a6cae743ceb..bab3721a313 100644 --- a/src/test/auxiliary/attr_plugin_test.rs +++ b/src/test/auxiliary/attr_plugin_test.rs @@ -16,9 +16,10 @@ extern crate syntax; extern crate rustc; +extern crate rustc_plugin; use syntax::feature_gate::AttributeType; -use rustc::plugin::Registry; +use rustc_plugin::Registry; diff --git a/src/test/auxiliary/custom_derive_plugin.rs b/src/test/auxiliary/custom_derive_plugin.rs index 44ab4cc89a0..542b10fd1c6 100644 --- a/src/test/auxiliary/custom_derive_plugin.rs +++ b/src/test/auxiliary/custom_derive_plugin.rs @@ -16,6 +16,7 @@ extern crate syntax; extern crate rustc; +extern crate rustc_plugin; use syntax::ast; use syntax::codemap::Span; @@ -25,7 +26,7 @@ use syntax::ext::deriving::generic::{cs_fold, TraitDef, MethodDef, combine_subst use syntax::ext::deriving::generic::ty::{Literal, LifetimeBounds, Path, borrowed_explicit_self}; use syntax::parse::token; use syntax::ptr::P; -use rustc::plugin::Registry; +use rustc_plugin::Registry; #[plugin_registrar] pub fn plugin_registrar(reg: &mut Registry) { diff --git a/src/test/auxiliary/custom_derive_plugin_attr.rs b/src/test/auxiliary/custom_derive_plugin_attr.rs index 82d0edfb163..f44e77d563a 100644 --- a/src/test/auxiliary/custom_derive_plugin_attr.rs +++ b/src/test/auxiliary/custom_derive_plugin_attr.rs @@ -16,6 +16,7 @@ extern crate syntax; extern crate rustc; +extern crate rustc_plugin; use syntax::ast; use syntax::attr::AttrMetaMethods; @@ -27,7 +28,7 @@ use syntax::ext::deriving::generic::{Substructure, Struct, EnumMatching}; use syntax::ext::deriving::generic::ty::{Literal, LifetimeBounds, Path, borrowed_explicit_self}; use syntax::parse::token; use syntax::ptr::P; -use rustc::plugin::Registry; +use rustc_plugin::Registry; #[plugin_registrar] pub fn plugin_registrar(reg: &mut Registry) { diff --git a/src/test/auxiliary/issue_16723_multiple_items_syntax_ext.rs b/src/test/auxiliary/issue_16723_multiple_items_syntax_ext.rs index 7be5c3cf47c..25a75c2d295 100644 --- a/src/test/auxiliary/issue_16723_multiple_items_syntax_ext.rs +++ b/src/test/auxiliary/issue_16723_multiple_items_syntax_ext.rs @@ -15,12 +15,13 @@ extern crate syntax; extern crate rustc; +extern crate rustc_plugin; use syntax::ast; use syntax::codemap; use syntax::ext::base::{ExtCtxt, MacResult, MacEager}; use syntax::util::small_vector::SmallVector; -use rustc::plugin::Registry; +use rustc_plugin::Registry; #[plugin_registrar] pub fn plugin_registrar(reg: &mut Registry) { diff --git a/src/test/auxiliary/lint_for_crate.rs b/src/test/auxiliary/lint_for_crate.rs index 7ae161a86a3..1933188ccbf 100644 --- a/src/test/auxiliary/lint_for_crate.rs +++ b/src/test/auxiliary/lint_for_crate.rs @@ -15,10 +15,11 @@ #[macro_use] extern crate rustc; extern crate rustc_front; +extern crate rustc_plugin; extern crate syntax; use rustc::lint::{LateContext, LintContext, LintPass, LateLintPass, LateLintPassObject, LintArray}; -use rustc::plugin::Registry; +use rustc_plugin::Registry; use rustc_front::hir; use syntax::attr; diff --git a/src/test/auxiliary/lint_group_plugin_test.rs b/src/test/auxiliary/lint_group_plugin_test.rs index 81bd76211c3..98ed86bb390 100644 --- a/src/test/auxiliary/lint_group_plugin_test.rs +++ b/src/test/auxiliary/lint_group_plugin_test.rs @@ -18,10 +18,11 @@ extern crate rustc_front; // Load rustc as a plugin to get macros #[macro_use] extern crate rustc; +extern crate rustc_plugin; use rustc_front::hir; use rustc::lint::{LateContext, LintContext, LintPass, LateLintPass, LateLintPassObject, LintArray}; -use rustc::plugin::Registry; +use rustc_plugin::Registry; declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'"); diff --git a/src/test/auxiliary/lint_plugin_test.rs b/src/test/auxiliary/lint_plugin_test.rs index a0036745d90..8ea131da338 100644 --- a/src/test/auxiliary/lint_plugin_test.rs +++ b/src/test/auxiliary/lint_plugin_test.rs @@ -18,10 +18,11 @@ extern crate syntax; // Load rustc as a plugin to get macros #[macro_use] extern crate rustc; +extern crate rustc_plugin; use rustc::lint::{EarlyContext, LintContext, LintPass, EarlyLintPass, EarlyLintPassObject, LintArray}; -use rustc::plugin::Registry; +use rustc_plugin::Registry; use syntax::ast; declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'"); diff --git a/src/test/auxiliary/llvm_pass_plugin.rs b/src/test/auxiliary/llvm_pass_plugin.rs index bacc1acd3c4..59cfdd1e04a 100644 --- a/src/test/auxiliary/llvm_pass_plugin.rs +++ b/src/test/auxiliary/llvm_pass_plugin.rs @@ -14,8 +14,9 @@ #![feature(rustc_private)] extern crate rustc; +extern crate rustc_plugin; -use rustc::plugin::Registry; +use rustc_plugin::Registry; #[plugin_registrar] pub fn plugin_registrar(reg: &mut Registry) { diff --git a/src/test/auxiliary/lto-syntax-extension-plugin.rs b/src/test/auxiliary/lto-syntax-extension-plugin.rs index c3778326a4d..9cf0d756f40 100644 --- a/src/test/auxiliary/lto-syntax-extension-plugin.rs +++ b/src/test/auxiliary/lto-syntax-extension-plugin.rs @@ -14,8 +14,9 @@ #![feature(rustc_private)] extern crate rustc; +extern crate rustc_plugin; -use rustc::plugin::Registry; +use rustc_plugin::Registry; #[plugin_registrar] pub fn plugin_registrar(_reg: &mut Registry) {} diff --git a/src/test/auxiliary/macro_crate_MacroRulesTT.rs b/src/test/auxiliary/macro_crate_MacroRulesTT.rs index 03cd70d9494..9e693fcc564 100644 --- a/src/test/auxiliary/macro_crate_MacroRulesTT.rs +++ b/src/test/auxiliary/macro_crate_MacroRulesTT.rs @@ -14,10 +14,11 @@ extern crate syntax; extern crate rustc; +extern crate rustc_plugin; use syntax::parse::token; use syntax::ext::base::MacroRulesTT; -use rustc::plugin::Registry; +use rustc_plugin::Registry; #[plugin_registrar] pub fn plugin_registrar(reg: &mut Registry) { diff --git a/src/test/auxiliary/macro_crate_test.rs b/src/test/auxiliary/macro_crate_test.rs index 7ce80a5647c..fe61c80b4c3 100644 --- a/src/test/auxiliary/macro_crate_test.rs +++ b/src/test/auxiliary/macro_crate_test.rs @@ -14,13 +14,14 @@ extern crate syntax; extern crate rustc; +extern crate rustc_plugin; use syntax::ast::{self, TokenTree, Item, MetaItem, ImplItem, TraitItem}; use syntax::codemap::Span; use syntax::ext::base::*; use syntax::parse::{self, token}; use syntax::ptr::P; -use rustc::plugin::Registry; +use rustc_plugin::Registry; #[macro_export] macro_rules! exported_macro { () => (2) } diff --git a/src/test/auxiliary/plugin_args.rs b/src/test/auxiliary/plugin_args.rs index 1920185d4e5..f6e80266a15 100644 --- a/src/test/auxiliary/plugin_args.rs +++ b/src/test/auxiliary/plugin_args.rs @@ -15,6 +15,7 @@ extern crate syntax; extern crate rustc; +extern crate rustc_plugin; use std::borrow::ToOwned; use syntax::ast; @@ -24,7 +25,7 @@ use syntax::ext::base::{TTMacroExpander, ExtCtxt, MacResult, MacEager, NormalTT} use syntax::parse::token; use syntax::print::pprust; use syntax::ptr::P; -use rustc::plugin::Registry; +use rustc_plugin::Registry; struct Expander { args: Vec>, diff --git a/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs b/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs index 5d93c131cad..f56983c14b1 100644 --- a/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs +++ b/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs @@ -14,10 +14,11 @@ #![feature(box_syntax, rustc_private)] extern crate rustc; +extern crate rustc_plugin; use std::any::Any; use std::cell::RefCell; -use rustc::plugin::Registry; +use rustc_plugin::Registry; struct Foo { foo: isize diff --git a/src/test/auxiliary/plugin_with_plugin_lib.rs b/src/test/auxiliary/plugin_with_plugin_lib.rs index 75f404c96cd..8b5ff7cf07c 100644 --- a/src/test/auxiliary/plugin_with_plugin_lib.rs +++ b/src/test/auxiliary/plugin_with_plugin_lib.rs @@ -15,8 +15,9 @@ extern crate macro_crate_test; extern crate rustc; +extern crate rustc_plugin; -use rustc::plugin::Registry; +use rustc_plugin::Registry; #[plugin_registrar] pub fn plugin_registrar(_: &mut Registry) { } diff --git a/src/test/auxiliary/procedural_mbe_matching.rs b/src/test/auxiliary/procedural_mbe_matching.rs index a92361b8106..713a7d1e811 100644 --- a/src/test/auxiliary/procedural_mbe_matching.rs +++ b/src/test/auxiliary/procedural_mbe_matching.rs @@ -15,6 +15,7 @@ extern crate syntax; extern crate rustc; +extern crate rustc_plugin; use syntax::codemap::Span; use syntax::parse::token::{self, str_to_ident, NtExpr, NtPat}; @@ -24,7 +25,7 @@ use syntax::ext::build::AstBuilder; use syntax::ext::tt::macro_parser::{MatchedSeq, MatchedNonterminal}; use syntax::ext::tt::macro_parser::{Success, Failure, Error}; use syntax::ptr::P; -use rustc::plugin::Registry; +use rustc_plugin::Registry; fn expand_mbe_matches(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree]) -> Box { diff --git a/src/test/auxiliary/rlib_crate_test.rs b/src/test/auxiliary/rlib_crate_test.rs index 86ce3df9ba6..ae1568b2f88 100644 --- a/src/test/auxiliary/rlib_crate_test.rs +++ b/src/test/auxiliary/rlib_crate_test.rs @@ -14,8 +14,9 @@ #![feature(plugin_registrar, rustc_private)] extern crate rustc; +extern crate rustc_plugin; -use rustc::plugin::Registry; +use rustc_plugin::Registry; #[plugin_registrar] pub fn plugin_registrar(_: &mut Registry) {} diff --git a/src/test/auxiliary/roman_numerals.rs b/src/test/auxiliary/roman_numerals.rs index c9249fb3357..c262b0dba25 100644 --- a/src/test/auxiliary/roman_numerals.rs +++ b/src/test/auxiliary/roman_numerals.rs @@ -16,13 +16,14 @@ extern crate syntax; extern crate rustc; +extern crate rustc_plugin; use syntax::codemap::Span; use syntax::ast::TokenTree; use syntax::parse::token; use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager}; use syntax::ext::build::AstBuilder; // trait for expr_usize -use rustc::plugin::Registry; +use rustc_plugin::Registry; // WARNING WARNING WARNING WARNING WARNING // ======================================= diff --git a/src/test/auxiliary/syntax_extension_with_dll_deps_2.rs b/src/test/auxiliary/syntax_extension_with_dll_deps_2.rs index 4980eb8b913..7281698a7fb 100644 --- a/src/test/auxiliary/syntax_extension_with_dll_deps_2.rs +++ b/src/test/auxiliary/syntax_extension_with_dll_deps_2.rs @@ -16,11 +16,12 @@ extern crate syntax_extension_with_dll_deps_1 as other; extern crate syntax; extern crate rustc; +extern crate rustc_plugin; use syntax::ast::{TokenTree, Item, MetaItem}; use syntax::codemap::Span; use syntax::ext::base::*; -use rustc::plugin::Registry; +use rustc_plugin::Registry; #[plugin_registrar] pub fn plugin_registrar(reg: &mut Registry) {