diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index 350a10ce4832a..ee6bc0b4fa88b 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -15,7 +15,14 @@ extern crate test; extern crate getopts; -#[phase(plugin, link)] extern crate log; + +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; extern crate regex; diff --git a/src/grammar/verify.rs b/src/grammar/verify.rs index db26ca6ffa5d5..ad271d230904e 100644 --- a/src/grammar/verify.rs +++ b/src/grammar/verify.rs @@ -8,15 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(globs, phase, macro_rules)] +#![feature(globs, plugin, macro_rules)] extern crate syntax; extern crate rustc; -#[phase(link)] extern crate regex; -#[phase(link, plugin)] +#[macro_use] extern crate log; use std::collections::HashMap; diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index d040f8ff86390..001e02f9c0dd5 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -68,14 +68,33 @@ #![feature(lang_items, phase, unsafe_destructor, default_type_params, old_orphan_check)] #![feature(associated_types)] +#[cfg(stage0)] #[phase(plugin, link)] extern crate core; + +#[cfg(not(stage0))] +#[macro_use] +extern crate core; + extern crate libc; // Allow testing this library -#[cfg(test)] #[phase(plugin, link)] extern crate std; -#[cfg(test)] #[phase(plugin, link)] extern crate log; +#[cfg(all(test, stage0))] +#[phase(plugin, link)] +extern crate std; + +#[cfg(all(test, not(stage0)))] +#[macro_use] +extern crate std; + +#[cfg(all(test, stage0))] +#[phase(plugin, link)] +extern crate log; + +#[cfg(all(test, not(stage0)))] +#[macro_use] +extern crate log; // Heaps provided for low-level allocation strategies diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 142ac6f34e02f..7352c71e6797e 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -29,15 +29,34 @@ #![feature(associated_types)] #![no_std] -#[phase(plugin, link)] extern crate core; +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate core; + +#[cfg(not(stage0))] +#[macro_use] +extern crate core; + extern crate unicode; extern crate alloc; #[cfg(test)] extern crate test; -#[cfg(test)] #[phase(plugin, link)] extern crate std; -#[cfg(test)] #[phase(plugin, link)] extern crate log; +#[cfg(all(test, stage0))] +#[phase(plugin, link)] +extern crate std; + +#[cfg(all(test, not(stage0)))] +#[macro_use] +extern crate std; + +#[cfg(all(test, stage0))] +#[phase(plugin, link)] +extern crate log; +#[cfg(all(test, not(stage0)))] +#[macro_use] +extern crate log; pub use binary_heap::BinaryHeap; pub use bitv::Bitv; diff --git a/src/libflate/lib.rs b/src/libflate/lib.rs index aa1550ae5b874..744606d80553c 100644 --- a/src/libflate/lib.rs +++ b/src/libflate/lib.rs @@ -21,9 +21,9 @@ #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/")] -#![feature(phase, unboxed_closures)] +#![feature(unboxed_closures)] -#[cfg(test)] #[phase(plugin, link)] extern crate log; +#[cfg(test)] #[macro_use] extern crate log; extern crate libc; diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index 2063654077f15..18077795e245f 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -85,11 +85,11 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/", html_playground_url = "http://play.rust-lang.org/")] -#![feature(globs, phase, slicing_syntax)] +#![feature(globs, slicing_syntax)] #![feature(unboxed_closures)] #![deny(missing_docs)] -#[cfg(test)] #[phase(plugin, link)] extern crate log; +#[cfg(test)] #[macro_use] extern crate log; use self::Name::*; use self::HasArg::*; diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index c210873563c5d..df85e89efd17c 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -13,8 +13,7 @@ //! # Examples //! //! ``` -//! #![feature(phase)] -//! #[phase(plugin, link)] extern crate log; +//! #[macro_use] extern crate log; //! //! fn main() { //! debug!("this is a debug {}", "message"); diff --git a/src/liblog/macros.rs b/src/liblog/macros.rs index 66682dba7b6df..5249e971439cd 100644 --- a/src/liblog/macros.rs +++ b/src/liblog/macros.rs @@ -19,8 +19,7 @@ /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// fn main() { /// log!(log::WARN, "this is a warning {}", "message"); @@ -68,8 +67,7 @@ macro_rules! log { /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// fn main() { /// let error = 3u; @@ -94,8 +92,7 @@ macro_rules! error { /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// fn main() { /// let code = 3u; @@ -119,8 +116,7 @@ macro_rules! warn { /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// fn main() { /// let ret = 3i; @@ -146,8 +142,7 @@ macro_rules! info { /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// fn main() { /// debug!("x = {x}, y = {y}", x=10i, y=20i); @@ -170,8 +165,7 @@ macro_rules! debug { /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// struct Point { x: int, y: int } /// fn some_expensive_computation() -> Point { Point { x: 1, y: 2 } } diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 0f8dbc78cde32..4017d8d57c075 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -29,11 +29,29 @@ #![no_std] #![experimental] +#[cfg(stage0)] #[phase(plugin, link)] extern crate core; -#[cfg(test)] #[phase(plugin, link)] extern crate std; -#[cfg(test)] #[phase(plugin, link)] extern crate log; +#[cfg(not(stage0))] +#[macro_use] +extern crate core; + +#[cfg(all(test, stage0))] +#[phase(plugin, link)] +extern crate std; + +#[cfg(all(test, not(stage0)))] +#[macro_use] +extern crate std; + +#[cfg(all(test, stage0))] +#[phase(plugin, link)] +extern crate log; + +#[cfg(all(test, not(stage0)))] +#[macro_use] +extern crate log; use core::prelude::*; diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs index 3acedac111d60..e57542a6d14de 100644 --- a/src/librbml/lib.rs +++ b/src/librbml/lib.rs @@ -30,7 +30,14 @@ extern crate serialize; -#[phase(plugin, link)] extern crate log; +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; + #[cfg(test)] extern crate test; pub use self::EbmlEncoderTag::*; diff --git a/src/libregex/lib.rs b/src/libregex/lib.rs index b3807d313145d..0084be49b5619 100644 --- a/src/libregex/lib.rs +++ b/src/libregex/lib.rs @@ -24,7 +24,7 @@ html_playground_url = "http://play.rust-lang.org/")] #![allow(unknown_features)] -#![feature(macro_rules, phase, slicing_syntax, globs)] +#![feature(macro_rules, slicing_syntax, globs)] #![feature(unboxed_closures)] #![feature(associated_types)] #![deny(missing_docs)] diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 122171e469108..3ed712b15dfdc 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -40,8 +40,22 @@ extern crate rustc_back; extern crate serialize; extern crate rbml; extern crate collections; -#[phase(plugin, link)] extern crate log; -#[phase(plugin, link)] extern crate syntax; + +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; + +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate syntax; + +#[cfg(not(stage0))] +#[macro_use] +extern crate syntax; extern crate "serialize" as rustc_serialize; // used by deriving diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 34e7200806612..c7a8457c6d24a 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -89,12 +89,7 @@ fn warn_if_multiple_versions(diag: &SpanHandler, cstore: &CStore) { } fn should_link(i: &ast::ViewItem) -> bool { - i.attrs.iter().all(|attr| { - attr.name().get() != "phase" || - attr.meta_item_list().map_or(false, |phases| { - attr::contains_name(phases[], "link") - }) - }) + !attr::contains_name(i.attrs[], "no_link") } struct CrateInfo { diff --git a/src/librustc/plugin/load.rs b/src/librustc/plugin/load.rs index 78730defc7fd6..d17ef199aa1bd 100644 --- a/src/librustc/plugin/load.rs +++ b/src/librustc/plugin/load.rs @@ -84,26 +84,36 @@ impl<'a, 'v> Visitor<'v> for PluginLoader<'a> { _ => return, } - let mut plugin_phase = false; - for attr in vi.attrs.iter().filter(|a| a.check_name("phase")) { - let phases = attr.meta_item_list().unwrap_or(&[]); - if attr::contains_name(phases, "plugin") { - plugin_phase = true; + // Parse the attributes relating to macro / plugin loading. + let mut load_macros = false; + let mut load_registrar = false; + for attr in vi.attrs.iter() { + let mut used = true; + match attr.name().get() { + "phase" => { + self.sess.span_err(attr.span, "#[phase] is deprecated; use \ + #[macro_use], #[plugin], and/or #[no_link]"); + } + "plugin" => load_registrar = true, + "macro_use" => load_macros = true, + _ => used = false, } - if attr::contains_name(phases, "syntax") { - plugin_phase = true; - self.sess.span_warn(attr.span, - "phase(syntax) is a deprecated synonym for phase(plugin)"); + if used { + attr::mark_used(attr); } } let mut macros = vec![]; let mut registrar = None; - if plugin_phase { + if load_macros || load_registrar { let pmd = self.reader.read_plugin_metadata(vi); - macros = pmd.exported_macros(); - registrar = pmd.plugin_registrar(); + if load_macros { + macros = pmd.exported_macros(); + } + if load_registrar { + registrar = pmd.plugin_registrar(); + } } self.plugins.macros.extend(macros.into_iter()); diff --git a/src/librustc/plugin/mod.rs b/src/librustc/plugin/mod.rs index 8dd60880cdd56..fd8873454b4d9 100644 --- a/src/librustc/plugin/mod.rs +++ b/src/librustc/plugin/mod.rs @@ -43,14 +43,14 @@ //! To use a plugin while compiling another crate: //! //! ```rust -//! #![feature(phase)] +//! #![feature(plugin)] //! -//! #[phase(plugin)] +//! #[plugin] //! extern crate myplugin; //! ``` //! -//! If you also need the plugin crate available at runtime, use -//! `phase(plugin, link)`. +//! If you don't need the plugin crate available at runtime, use +//! `#[no_link]` as well. //! //! See [the compiler plugin guide](../../guide-plugin.html) //! for more examples. diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index 2bb99a7141f70..238c84e88a9e0 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -34,8 +34,14 @@ #![feature(unboxed_closures)] #![feature(old_orphan_check)] +#[cfg(stage0)] #[phase(plugin, link)] extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; + extern crate syntax; extern crate serialize; diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index b886883c73ad2..0600ddba01897 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -24,8 +24,21 @@ #![feature(old_orphan_check)] #![allow(non_camel_case_types)] -#[phase(plugin, link)] extern crate log; -#[phase(plugin, link)] extern crate syntax; +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; + +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate syntax; + +#[cfg(not(stage0))] +#[macro_use] +extern crate syntax; // for "clarity", rename the graphviz crate to dot; graphviz within `borrowck` // refers to the borrowck-specific graphviz adapter traits. diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 983188c709000..a43ee3e6d338d 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -39,11 +39,25 @@ extern crate rustc_borrowck; extern crate rustc_resolve; extern crate rustc_trans; extern crate rustc_typeck; -#[phase(plugin, link)] extern crate log; -#[phase(plugin, link)] extern crate syntax; extern crate serialize; extern crate "rustc_llvm" as llvm; +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; + +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate syntax; + +#[cfg(not(stage0))] +#[macro_use] +extern crate syntax; + pub use syntax::diagnostic; use rustc_trans::back::link; diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 2c2678c8dc68e..2237ec53ea177 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -20,8 +20,21 @@ #![feature(rustc_diagnostic_macros)] #![feature(associated_types)] -#[phase(plugin, link)] extern crate log; -#[phase(plugin, link)] extern crate syntax; +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; + +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate syntax; + +#[cfg(not(stage0))] +#[macro_use] +extern crate syntax; extern crate rustc; diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 9dbff66aba286..705fecf4d198e 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -37,11 +37,25 @@ extern crate graphviz; extern crate libc; extern crate rustc; extern crate rustc_back; -#[phase(plugin, link)] extern crate log; -#[phase(plugin, link)] extern crate syntax; extern crate serialize; extern crate "rustc_llvm" as llvm; +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; + +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate syntax; + +#[cfg(not(stage0))] +#[macro_use] +extern crate syntax; + pub use rustc::session; pub use rustc::metadata; pub use rustc::middle; diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 48f9b12971971..7206a71001be2 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -77,8 +77,21 @@ This API is completely unstable and subject to change. #![feature(unboxed_closures)] #![allow(non_camel_case_types)] -#[phase(plugin, link)] extern crate log; -#[phase(plugin, link)] extern crate syntax; +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; + +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate syntax; + +#[cfg(not(stage0))] +#[macro_use] +extern crate syntax; extern crate arena; extern crate rustc; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 319eee8731772..6e42c50f974c5 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -32,7 +32,14 @@ extern crate rustc_driver; extern crate serialize; extern crate syntax; extern crate "test" as testing; -#[phase(plugin, link)] extern crate log; + +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; extern crate "serialize" as rustc_serialize; // used by deriving diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 8ad2013f9368f..8fe15f00ded73 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -31,8 +31,14 @@ Core encoding and decoding interfaces. #[cfg(test)] extern crate test; +#[cfg(stage0)] #[phase(plugin, link)] extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; + extern crate unicode; extern crate collections; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index abe968849c2b8..3eda6d3374ed9 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -120,12 +120,30 @@ #![macro_reexport(assert, assert_eq, debug_assert, debug_assert_eq, unreachable, unimplemented, write, writeln, vec)] -#[cfg(test)] #[phase(plugin, link)] extern crate log; +#[cfg(all(test, stage0))] +#[phase(plugin, link)] +extern crate log; + +#[cfg(all(test, not(stage0)))] +#[macro_use] +extern crate log; +#[cfg(stage0)] #[phase(plugin, link)] extern crate core; + +#[cfg(not(stage0))] +#[macro_use] +extern crate core; + +#[cfg(stage0)] #[phase(plugin, link)] extern crate "collections" as core_collections; + +#[cfg(not(stage0))] +#[macro_use] +extern crate "collections" as core_collections; + extern crate "rand" as core_rand; extern crate alloc; extern crate unicode; diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index f8ac34cfe2920..e41fef4e77870 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -44,7 +44,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[ ("non_ascii_idents", Active), ("thread_local", Active), ("link_args", Active), - ("phase", Active), + ("phase", Active), // NOTE(stage0): switch to Removed after next snapshot ("plugin_registrar", Active), ("log_syntax", Active), ("trace_macros", Active), @@ -74,6 +74,8 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[ ("if_let", Accepted), ("while_let", Accepted), + ("plugin", Active), + // A temporary feature gate used to enable parser extensions needed // to bootstrap fix for #5723. ("issue_5723_bootstrap", Accepted), @@ -163,22 +165,6 @@ struct MacroVisitor<'a> { } impl<'a, 'v> Visitor<'v> for MacroVisitor<'a> { - fn visit_view_item(&mut self, i: &ast::ViewItem) { - match i.node { - ast::ViewItemExternCrate(..) => { - for attr in i.attrs.iter() { - if attr.name().get() == "phase"{ - self.context.gate_feature("phase", attr.span, - "compile time crate loading is \ - experimental and possibly buggy"); - } - } - }, - _ => { } - } - visit::walk_view_item(self, i) - } - fn visit_mac(&mut self, macro: &ast::Mac) { let ast::MacInvocTT(ref path, _, _) = macro.node; let id = path.segments.last().unwrap().identifier; @@ -241,10 +227,10 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { } ast::ViewItemExternCrate(..) => { for attr in i.attrs.iter() { - if attr.name().get() == "phase"{ - self.gate_feature("phase", attr.span, - "compile time crate loading is \ - experimental and possibly buggy"); + if attr.check_name("plugin") { + self.gate_feature("plugin", attr.span, + "compiler plugins are experimental \ + and possibly buggy"); } } } diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 0503d88cca201..774a9f61cf9af 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -31,11 +31,18 @@ extern crate arena; extern crate fmt_macros; -#[phase(plugin, link)] extern crate log; extern crate serialize; extern crate term; extern crate libc; +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; + extern crate "serialize" as rustc_serialize; // used by deriving pub mod util { diff --git a/src/libsyntax/std_inject.rs b/src/libsyntax/std_inject.rs index 5a4d0cc3bd896..4ef7eb97a2189 100644 --- a/src/libsyntax/std_inject.rs +++ b/src/libsyntax/std_inject.rs @@ -65,12 +65,8 @@ impl<'a> fold::Folder for StandardLibraryInjector<'a> { Some((actual_crate_name, ast::CookedStr)), ast::DUMMY_NODE_ID), attrs: vec!( - attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_list_item( - InternedString::new("phase"), - vec!( - attr::mk_word_item(InternedString::new("plugin")), - attr::mk_word_item(InternedString::new("link") - ))))), + attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item( + InternedString::new("macro_use")))), vis: ast::Inherited, span: DUMMY_SP }); @@ -82,16 +78,6 @@ impl<'a> fold::Folder for StandardLibraryInjector<'a> { // don't add #![no_std] here, that will block the prelude injection later. // Add it during the prelude injection instead. - // Add #![feature(phase)] here, because we use #[phase] on extern crate std. - let feat_phase_attr = attr::mk_attr_inner(attr::mk_attr_id(), - attr::mk_list_item( - InternedString::new("feature"), - vec![attr::mk_word_item(InternedString::new("phase"))], - )); - // std_inject runs after feature checking so manually mark this attr - attr::mark_used(&feat_phase_attr); - krate.attrs.push(feat_phase_attr); - krate } } diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index 3a442080077f3..dd42bede13ac3 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -52,7 +52,13 @@ #![deny(missing_docs)] -#[phase(plugin, link)] extern crate log; +#[cfg(stage0)] +#[phase(plugin, link)] +extern crate log; + +#[cfg(not(stage0))] +#[macro_use] +extern crate log; pub use terminfo::TerminfoTerminal; #[cfg(windows)] diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 3fb2211eff23a..18c253bcf01a8 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -32,7 +32,7 @@ html_root_url = "http://doc.rust-lang.org/nightly/")] #![allow(unknown_features)] -#![feature(asm, macro_rules, phase, globs, slicing_syntax)] +#![feature(asm, macro_rules, globs, slicing_syntax)] #![feature(unboxed_closures, default_type_params)] #![feature(old_orphan_check)] diff --git a/src/test/auxiliary/issue-13560-3.rs b/src/test/auxiliary/issue-13560-3.rs index c80a7643e01ac..5510d3e2e0df1 100644 --- a/src/test/auxiliary/issue-13560-3.rs +++ b/src/test/auxiliary/issue-13560-3.rs @@ -11,8 +11,7 @@ // no-prefer-dynamic #![crate_type = "rlib"] -#![feature(phase)] -#[phase(plugin)] extern crate "issue-13560-1" as t1; -#[phase(plugin, link)] extern crate "issue-13560-2" as t2; +#[macro_use] #[no_link] extern crate "issue-13560-1" as t1; +#[macro_use] extern crate "issue-13560-2" as t2; diff --git a/src/test/auxiliary/lint_group_plugin_test.rs b/src/test/auxiliary/lint_group_plugin_test.rs index add54ed01e00e..097a5827fc4be 100644 --- a/src/test/auxiliary/lint_group_plugin_test.rs +++ b/src/test/auxiliary/lint_group_plugin_test.rs @@ -10,12 +10,12 @@ // force-host -#![feature(phase, plugin_registrar)] +#![feature(plugin_registrar)] extern crate syntax; // Load rustc as a plugin to get macros -#[phase(plugin, link)] +#[macro_use] extern crate rustc; use syntax::ast; diff --git a/src/test/auxiliary/lint_plugin_test.rs b/src/test/auxiliary/lint_plugin_test.rs index 6c78cdce28ac4..01ef08c475234 100644 --- a/src/test/auxiliary/lint_plugin_test.rs +++ b/src/test/auxiliary/lint_plugin_test.rs @@ -10,12 +10,12 @@ // force-host -#![feature(phase, plugin_registrar)] +#![feature(plugin_registrar)] extern crate syntax; // Load rustc as a plugin to get macros -#[phase(plugin, link)] +#[macro_use] extern crate rustc; use syntax::ast; diff --git a/src/test/auxiliary/logging_right_crate.rs b/src/test/auxiliary/logging_right_crate.rs index fad70a917980d..bf4ab975cedd8 100644 --- a/src/test/auxiliary/logging_right_crate.rs +++ b/src/test/auxiliary/logging_right_crate.rs @@ -8,8 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(phase)] -#[phase(plugin, link)] extern crate log; +#[macro_use] extern crate log; pub fn foo() { fn death() -> int { panic!() } diff --git a/src/test/auxiliary/macro_reexport_2.rs b/src/test/auxiliary/macro_reexport_2.rs index 3b68d47c55861..f54e5e5c4e122 100644 --- a/src/test/auxiliary/macro_reexport_2.rs +++ b/src/test/auxiliary/macro_reexport_2.rs @@ -9,9 +9,8 @@ // except according to those terms. #![crate_type = "dylib"] -#![feature(phase)] #![macro_reexport(reexported)] -#[phase(plugin)] +#[macro_use] #[no_link] extern crate macro_reexport_1; diff --git a/src/test/auxiliary/weak-lang-items.rs b/src/test/auxiliary/weak-lang-items.rs index 6a1f8588b60d7..39462fdc1e528 100644 --- a/src/test/auxiliary/weak-lang-items.rs +++ b/src/test/auxiliary/weak-lang-items.rs @@ -14,10 +14,9 @@ // it hasn't been defined just yet. Make sure we don't explode. #![no_std] -#![feature(phase)] #![crate_type = "rlib"] -#[phase(plugin, link)] +#[macro_use] extern crate core; struct A; diff --git a/src/test/bench/shootout-regex-dna.rs b/src/test/bench/shootout-regex-dna.rs index 4f87171f5d3fa..0a6c197f5ed31 100644 --- a/src/test/bench/shootout-regex-dna.rs +++ b/src/test/bench/shootout-regex-dna.rs @@ -41,7 +41,7 @@ // ignore-stage1 // ignore-cross-compile #12102 -#![feature(macro_rules, phase, slicing_syntax)] +#![feature(macro_rules, plugin, slicing_syntax)] extern crate regex; diff --git a/src/test/compile-fail-fulldeps/gated-phase.rs b/src/test/compile-fail-fulldeps/gated-plugin.rs similarity index 86% rename from src/test/compile-fail-fulldeps/gated-phase.rs rename to src/test/compile-fail-fulldeps/gated-plugin.rs index 1f384b856334c..89090d5f38abe 100644 --- a/src/test/compile-fail-fulldeps/gated-phase.rs +++ b/src/test/compile-fail-fulldeps/gated-plugin.rs @@ -11,8 +11,8 @@ // aux-build:macro_crate_test.rs // ignore-stage1 -#[phase(plugin)] -//~^ ERROR compile time crate loading is experimental and possibly buggy +#[plugin] #[no_link] +//~^ ERROR compiler plugins are experimental and possibly buggy extern crate macro_crate_test; fn main() {} diff --git a/src/test/compile-fail-fulldeps/lint-group-plugin-deny-cmdline.rs b/src/test/compile-fail-fulldeps/lint-group-plugin-deny-cmdline.rs index 5edaa78eeea38..11ae556395962 100644 --- a/src/test/compile-fail-fulldeps/lint-group-plugin-deny-cmdline.rs +++ b/src/test/compile-fail-fulldeps/lint-group-plugin-deny-cmdline.rs @@ -12,9 +12,9 @@ // ignore-stage1 // compile-flags: -D lint-me -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate lint_group_plugin_test; fn lintme() { } //~ ERROR item is named 'lintme' diff --git a/src/test/compile-fail-fulldeps/lint-plugin-deny-attr.rs b/src/test/compile-fail-fulldeps/lint-plugin-deny-attr.rs index 9eb39a9178c02..62007d6575a8d 100644 --- a/src/test/compile-fail-fulldeps/lint-plugin-deny-attr.rs +++ b/src/test/compile-fail-fulldeps/lint-plugin-deny-attr.rs @@ -11,10 +11,10 @@ // aux-build:lint_plugin_test.rs // ignore-stage1 -#![feature(phase)] +#![feature(plugin)] #![deny(test_lint)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate lint_plugin_test; fn lintme() { } //~ ERROR item is named 'lintme' diff --git a/src/test/compile-fail-fulldeps/lint-plugin-deny-cmdline.rs b/src/test/compile-fail-fulldeps/lint-plugin-deny-cmdline.rs index 46aa4b6b5b741..da51c047f57e1 100644 --- a/src/test/compile-fail-fulldeps/lint-plugin-deny-cmdline.rs +++ b/src/test/compile-fail-fulldeps/lint-plugin-deny-cmdline.rs @@ -12,9 +12,9 @@ // ignore-stage1 // compile-flags: -D test-lint -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate lint_plugin_test; fn lintme() { } //~ ERROR item is named 'lintme' diff --git a/src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs b/src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs index 329d3e86c052e..cf51958b53d8b 100644 --- a/src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs +++ b/src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs @@ -11,10 +11,10 @@ // aux-build:lint_plugin_test.rs // ignore-stage1 -#![feature(phase)] +#![feature(plugin)] #![forbid(test_lint)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate lint_plugin_test; fn lintme() { } //~ ERROR item is named 'lintme' diff --git a/src/test/compile-fail-fulldeps/lint-plugin-forbid-cmdline.rs b/src/test/compile-fail-fulldeps/lint-plugin-forbid-cmdline.rs index 601faa22d77a0..9a36143f65c6a 100644 --- a/src/test/compile-fail-fulldeps/lint-plugin-forbid-cmdline.rs +++ b/src/test/compile-fail-fulldeps/lint-plugin-forbid-cmdline.rs @@ -12,9 +12,9 @@ // ignore-stage1 // compile-flags: -F test-lint -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate lint_plugin_test; fn lintme() { } //~ ERROR item is named 'lintme' diff --git a/src/test/compile-fail-fulldeps/macro-crate-cannot-read-embedded-ident.rs b/src/test/compile-fail-fulldeps/macro-crate-cannot-read-embedded-ident.rs index fc7664c480fdb..46eb4d4b2eff1 100644 --- a/src/test/compile-fail-fulldeps/macro-crate-cannot-read-embedded-ident.rs +++ b/src/test/compile-fail-fulldeps/macro-crate-cannot-read-embedded-ident.rs @@ -20,9 +20,9 @@ // editors, so instead he made a macro that expands into the embedded // ident form. -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate macro_crate_test; fn main() { diff --git a/src/test/compile-fail-fulldeps/phase-syntax-doesnt-resolve.rs b/src/test/compile-fail-fulldeps/macro-crate-doesnt-resolve.rs similarity index 95% rename from src/test/compile-fail-fulldeps/phase-syntax-doesnt-resolve.rs rename to src/test/compile-fail-fulldeps/macro-crate-doesnt-resolve.rs index 00aeb1c1bae8f..adcdba04cc782 100644 --- a/src/test/compile-fail-fulldeps/phase-syntax-doesnt-resolve.rs +++ b/src/test/compile-fail-fulldeps/macro-crate-doesnt-resolve.rs @@ -12,9 +12,7 @@ // ignore-stage1 // ignore-android -#![feature(phase)] - -#[phase(plugin)] +#[macro_use] #[no_link] extern crate macro_crate_test; fn main() { diff --git a/src/test/compile-fail-fulldeps/macro-crate-rlib.rs b/src/test/compile-fail-fulldeps/macro-crate-rlib.rs index d4f286f20e8f7..1f44ac7cf9cae 100644 --- a/src/test/compile-fail-fulldeps/macro-crate-rlib.rs +++ b/src/test/compile-fail-fulldeps/macro-crate-rlib.rs @@ -14,8 +14,8 @@ // ignore-android // ignore-cross-compile gives a different error message -#![feature(phase)] -#[phase(plugin)] extern crate rlib_crate_test; +#![feature(plugin)] +#[plugin] #[no_link] extern crate rlib_crate_test; //~^ ERROR: plugin crate `rlib_crate_test` only found in rlib format, but must be available in dylib format fn main() {} diff --git a/src/test/compile-fail-fulldeps/macro-crate-unexported-macro.rs b/src/test/compile-fail-fulldeps/macro-crate-unexported-macro.rs index 6a3b0b91ffe29..b5ff8b7155632 100644 --- a/src/test/compile-fail-fulldeps/macro-crate-unexported-macro.rs +++ b/src/test/compile-fail-fulldeps/macro-crate-unexported-macro.rs @@ -12,9 +12,7 @@ // ignore-stage1 // ignore-android -#![feature(phase)] - -#[phase(plugin)] +#[macro_use] #[no_link] extern crate macro_crate_test; fn main() { diff --git a/src/test/compile-fail-fulldeps/macro-crate-unknown-crate.rs b/src/test/compile-fail-fulldeps/macro-crate-unknown-crate.rs index 7a7eac7b70925..65657eea1efb0 100644 --- a/src/test/compile-fail-fulldeps/macro-crate-unknown-crate.rs +++ b/src/test/compile-fail-fulldeps/macro-crate-unknown-crate.rs @@ -8,9 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(phase)] - -#[phase(plugin)] +#[macro_use] #[no_link] extern crate doesnt_exist; //~ ERROR can't find crate fn main() {} diff --git a/src/test/compile-fail-fulldeps/plugin-MacroRulesTT.rs b/src/test/compile-fail-fulldeps/plugin-MacroRulesTT.rs index 302a64c5ed34b..cff2e5eaf8786 100644 --- a/src/test/compile-fail-fulldeps/plugin-MacroRulesTT.rs +++ b/src/test/compile-fail-fulldeps/plugin-MacroRulesTT.rs @@ -13,9 +13,9 @@ // ignore-android // error-pattern: plugin tried to register a new MacroRulesTT -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate macro_crate_MacroRulesTT; fn main() { } diff --git a/src/test/run-pass/phase-use-ignored.rs b/src/test/compile-fail/deprecated-phase.rs similarity index 87% rename from src/test/run-pass/phase-use-ignored.rs rename to src/test/compile-fail/deprecated-phase.rs index 5015e43fa3f34..1401494d987a2 100644 --- a/src/test/run-pass/phase-use-ignored.rs +++ b/src/test/compile-fail/deprecated-phase.rs @@ -8,11 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(phase)] - -#[phase(plugin)] -use std::mem; +#[phase(blah)] +//~^ ERROR #[phase] is deprecated +extern crate foo; fn main() {} - diff --git a/src/test/compile-fail/fail-no-dead-code-core.rs b/src/test/compile-fail/fail-no-dead-code-core.rs index 49a927b9879e4..6f75181c31cbc 100644 --- a/src/test/compile-fail/fail-no-dead-code-core.rs +++ b/src/test/compile-fail/fail-no-dead-code-core.rs @@ -8,11 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(phase)] #![deny(dead_code)] #![allow(unreachable_code)] -#[phase(link, plugin)] extern crate core; +#[macro_use] extern crate core; fn foo() { //~ ERROR function is never used diff --git a/src/test/compile-fail/lint-stability.rs b/src/test/compile-fail/lint-stability.rs index 8e1723ddab24c..87bdb15f6edf7 100644 --- a/src/test/compile-fail/lint-stability.rs +++ b/src/test/compile-fail/lint-stability.rs @@ -13,7 +13,7 @@ // aux-build:stability_cfg1.rs // aux-build:stability_cfg2.rs -#![feature(globs, phase)] +#![feature(globs)] #![deny(unstable)] #![deny(deprecated)] #![deny(experimental)] @@ -23,7 +23,7 @@ mod cross_crate { extern crate stability_cfg1; extern crate stability_cfg2; //~ ERROR: use of experimental item - #[phase(plugin, link)] + #[macro_use] extern crate lint_stability; //~ ERROR: use of unmarked item use self::lint_stability::*; diff --git a/src/test/run-pass/deprecated-phase-syntax.rs b/src/test/compile-fail/no-link.rs similarity index 62% rename from src/test/run-pass/deprecated-phase-syntax.rs rename to src/test/compile-fail/no-link.rs index df835dab4d4e0..a9c2b6a942c65 100644 --- a/src/test/run-pass/deprecated-phase-syntax.rs +++ b/src/test/compile-fail/no-link.rs @@ -1,4 +1,4 @@ -// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT +// 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. // @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(phase)] - -//~ WARNING phase(syntax) is a deprecated synonym for phase(plugin) -#[phase(syntax, link)] -extern crate log; +#[no_link] +extern crate libc; fn main() { - debug!("foo"); + unsafe { + libc::abs(0); //~ ERROR Use of undeclared type or module `libc` + //~^ ERROR unresolved name `libc::abs` + } } diff --git a/src/test/pretty/issue-4264.pp b/src/test/pretty/issue-4264.pp index 35bd22880cef7..500305f597075 100644 --- a/src/test/pretty/issue-4264.pp +++ b/src/test/pretty/issue-4264.pp @@ -1,7 +1,6 @@ -#![feature(phase)] #![no_std] #![feature(globs)] -#[phase(plugin, link)] +#[macro_use] extern crate "std" as std; #[prelude_import] use std::prelude::v1::*; diff --git a/src/test/run-fail/rt-set-exit-status-panic.rs b/src/test/run-fail/rt-set-exit-status-panic.rs index e524a2432ac4e..fd7c3f8cc0e4b 100644 --- a/src/test/run-fail/rt-set-exit-status-panic.rs +++ b/src/test/run-fail/rt-set-exit-status-panic.rs @@ -10,8 +10,7 @@ // error-pattern:whatever -#![feature(phase)] -#[phase(plugin, link)] extern crate log; +#[macro_use] extern crate log; use std::os; fn main() { diff --git a/src/test/run-fail/rt-set-exit-status-panic2.rs b/src/test/run-fail/rt-set-exit-status-panic2.rs index 972c85e376e51..446ef6f97e297 100644 --- a/src/test/run-fail/rt-set-exit-status-panic2.rs +++ b/src/test/run-fail/rt-set-exit-status-panic2.rs @@ -10,8 +10,7 @@ // error-pattern:whatever -#![feature(phase)] -#[phase(plugin, link)] extern crate log; +#[macro_use] extern crate log; use std::os; use std::thread::Thread; diff --git a/src/test/run-fail/rt-set-exit-status.rs b/src/test/run-fail/rt-set-exit-status.rs index bddf9b5a7ea59..39ece8a464a6f 100644 --- a/src/test/run-fail/rt-set-exit-status.rs +++ b/src/test/run-fail/rt-set-exit-status.rs @@ -10,8 +10,7 @@ // error-pattern:whatever -#![feature(phase)] -#[phase(plugin, link)] extern crate log; +#[macro_use] extern crate log; use std::os; fn main() { diff --git a/src/test/run-make/extern-diff-internal-name/test.rs b/src/test/run-make/extern-diff-internal-name/test.rs index ab1cf96999dce..11e042c8c4a06 100644 --- a/src/test/run-make/extern-diff-internal-name/test.rs +++ b/src/test/run-make/extern-diff-internal-name/test.rs @@ -8,9 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(phase)] - -#[phase(plugin, link)] +#[macro_use] extern crate foo; fn main() { diff --git a/src/test/run-make/lto-syntax-extension/main.rs b/src/test/run-make/lto-syntax-extension/main.rs index 2028710cbd2bc..a38b2cfb96287 100644 --- a/src/test/run-make/lto-syntax-extension/main.rs +++ b/src/test/run-make/lto-syntax-extension/main.rs @@ -8,9 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(phase)] - extern crate lib; -#[phase(plugin, link)] extern crate log; +#[macro_use] extern crate log; fn main() {} diff --git a/src/test/run-pass-fulldeps/issue_16723_multiple_items_syntax_ext.rs b/src/test/run-pass-fulldeps/issue_16723_multiple_items_syntax_ext.rs index 08c9f8b4aa7d5..11e7da770291a 100644 --- a/src/test/run-pass-fulldeps/issue_16723_multiple_items_syntax_ext.rs +++ b/src/test/run-pass-fulldeps/issue_16723_multiple_items_syntax_ext.rs @@ -11,9 +11,9 @@ // ignore-stage1 // ignore-android // aux-build:issue_16723_multiple_items_syntax_ext.rs -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] extern crate issue_16723_multiple_items_syntax_ext; +#[plugin] #[no_link] extern crate issue_16723_multiple_items_syntax_ext; multiple_items!(); diff --git a/src/test/run-pass-fulldeps/lint-group-plugin.rs b/src/test/run-pass-fulldeps/lint-group-plugin.rs index 726670b5d7f93..7615b25f9e40c 100644 --- a/src/test/run-pass-fulldeps/lint-group-plugin.rs +++ b/src/test/run-pass-fulldeps/lint-group-plugin.rs @@ -12,9 +12,9 @@ // ignore-stage1 // ignore-pretty -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate lint_group_plugin_test; fn lintme() { } //~ WARNING item is named 'lintme' diff --git a/src/test/run-pass-fulldeps/lint-plugin-cmdline.rs b/src/test/run-pass-fulldeps/lint-plugin-cmdline.rs index d3d1f1ea565a3..7144d2b0f1e71 100644 --- a/src/test/run-pass-fulldeps/lint-plugin-cmdline.rs +++ b/src/test/run-pass-fulldeps/lint-plugin-cmdline.rs @@ -12,9 +12,9 @@ // ignore-stage1 // compile-flags: -A test-lint -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate lint_plugin_test; fn lintme() { } diff --git a/src/test/run-pass-fulldeps/lint-plugin.rs b/src/test/run-pass-fulldeps/lint-plugin.rs index 8c5269e227410..d11242f4fe643 100644 --- a/src/test/run-pass-fulldeps/lint-plugin.rs +++ b/src/test/run-pass-fulldeps/lint-plugin.rs @@ -12,9 +12,9 @@ // ignore-stage1 // ignore-pretty -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate lint_plugin_test; fn lintme() { } //~ WARNING item is named 'lintme' diff --git a/src/test/run-pass-fulldeps/macro-crate-does-hygiene-work.rs b/src/test/run-pass-fulldeps/macro-crate-does-hygiene-work.rs index 0afd76e1659c4..a8762234ad996 100644 --- a/src/test/run-pass-fulldeps/macro-crate-does-hygiene-work.rs +++ b/src/test/run-pass-fulldeps/macro-crate-does-hygiene-work.rs @@ -14,9 +14,9 @@ // Issue #15750: a macro that internally parses its input and then // uses `quote_expr!` to rearrange it should be hygiene-preserving. -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate macro_crate_test; fn main() { diff --git a/src/test/run-pass-fulldeps/macro-crate-outlive-expansion-phase.rs b/src/test/run-pass-fulldeps/macro-crate-outlive-expansion-phase.rs index dd585ea979408..d943cf0457b4f 100644 --- a/src/test/run-pass-fulldeps/macro-crate-outlive-expansion-phase.rs +++ b/src/test/run-pass-fulldeps/macro-crate-outlive-expansion-phase.rs @@ -11,9 +11,9 @@ // aux-build:plugin_crate_outlive_expansion_phase.rs // ignore-stage1 -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate plugin_crate_outlive_expansion_phase; pub fn main() {} diff --git a/src/test/run-pass-fulldeps/macro-crate.rs b/src/test/run-pass-fulldeps/macro-crate.rs index 0f5e2cb3b6b46..4ffb8a3f74d4f 100644 --- a/src/test/run-pass-fulldeps/macro-crate.rs +++ b/src/test/run-pass-fulldeps/macro-crate.rs @@ -11,9 +11,9 @@ // aux-build:macro_crate_test.rs // ignore-stage1 -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[macro_use] #[plugin] #[no_link] extern crate macro_crate_test; #[into_foo] diff --git a/src/test/run-pass-fulldeps/phase-syntax-link-does-resolve.rs b/src/test/run-pass-fulldeps/plugin-link-does-resolve.rs similarity index 94% rename from src/test/run-pass-fulldeps/phase-syntax-link-does-resolve.rs rename to src/test/run-pass-fulldeps/plugin-link-does-resolve.rs index 47ff7d31df5f3..518d02e3d75bb 100644 --- a/src/test/run-pass-fulldeps/phase-syntax-link-does-resolve.rs +++ b/src/test/run-pass-fulldeps/plugin-link-does-resolve.rs @@ -15,9 +15,9 @@ // macro_crate_test will not compile on a cross-compiled target because // libsyntax is not compiled for it. -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin, link)] +#[plugin] extern crate macro_crate_test; fn main() { diff --git a/src/test/run-pass-fulldeps/roman-numerals-macro.rs b/src/test/run-pass-fulldeps/roman-numerals-macro.rs index 73a4a51f31c4e..d76766094ed77 100644 --- a/src/test/run-pass-fulldeps/roman-numerals-macro.rs +++ b/src/test/run-pass-fulldeps/roman-numerals-macro.rs @@ -11,9 +11,9 @@ // aux-build:roman_numerals.rs // ignore-stage1 -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate roman_numerals; pub fn main() { diff --git a/src/test/run-pass-fulldeps/syntax-extension-with-dll-deps.rs b/src/test/run-pass-fulldeps/syntax-extension-with-dll-deps.rs index b3fae671c5266..1c74c8ad08eec 100644 --- a/src/test/run-pass-fulldeps/syntax-extension-with-dll-deps.rs +++ b/src/test/run-pass-fulldeps/syntax-extension-with-dll-deps.rs @@ -12,9 +12,9 @@ // aux-build:syntax-extension-with-dll-deps-2.rs // ignore-stage1 -#![feature(phase)] +#![feature(plugin)] -#[phase(plugin)] +#[plugin] #[no_link] extern crate "syntax-extension-with-dll-deps-2" as extension; fn main() { diff --git a/src/test/run-pass/capturing-logging.rs b/src/test/run-pass/capturing-logging.rs index 3f6d6a02c7926..e3e0041050762 100644 --- a/src/test/run-pass/capturing-logging.rs +++ b/src/test/run-pass/capturing-logging.rs @@ -11,9 +11,7 @@ // ignore-android (FIXME #11419) // exec-env:RUST_LOG=info -#![feature(phase)] - -#[phase(plugin, link)] +#[macro_use] extern crate log; use log::{set_logger, Logger, LogRecord}; diff --git a/src/test/run-pass/conditional-debug-macro-off.rs b/src/test/run-pass/conditional-debug-macro-off.rs index f87d92dc16f7f..e3bdbeb169295 100644 --- a/src/test/run-pass/conditional-debug-macro-off.rs +++ b/src/test/run-pass/conditional-debug-macro-off.rs @@ -11,8 +11,7 @@ // compile-flags: --cfg ndebug // exec-env:RUST_LOG=conditional-debug-macro-off=4 -#![feature(phase)] -#[phase(plugin, link)] +#[macro_use] extern crate log; pub fn main() { diff --git a/src/test/run-pass/issue-14330.rs b/src/test/run-pass/issue-14330.rs index bac846dfa203b..f983f233ee356 100644 --- a/src/test/run-pass/issue-14330.rs +++ b/src/test/run-pass/issue-14330.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(phase)] - -#[phase(plugin, link)] extern crate "std" as std2; +#[macro_use] extern crate "std" as std2; fn main() {} diff --git a/src/test/run-pass/logging-enabled-debug.rs b/src/test/run-pass/logging-enabled-debug.rs index 4b97d274fbae4..262d9b21eb48b 100644 --- a/src/test/run-pass/logging-enabled-debug.rs +++ b/src/test/run-pass/logging-enabled-debug.rs @@ -11,8 +11,7 @@ // compile-flags:--cfg ndebug // exec-env:RUST_LOG=logging-enabled-debug=debug -#![feature(phase)] -#[phase(plugin, link)] +#[macro_use] extern crate log; pub fn main() { diff --git a/src/test/run-pass/logging-enabled.rs b/src/test/run-pass/logging-enabled.rs index c4f7b1492ab57..372cdc401b549 100644 --- a/src/test/run-pass/logging-enabled.rs +++ b/src/test/run-pass/logging-enabled.rs @@ -10,8 +10,7 @@ // exec-env:RUST_LOG=logging-enabled=info -#![feature(phase)] -#[phase(plugin, link)] +#[macro_use] extern crate log; pub fn main() { diff --git a/src/test/run-pass/logging-separate-lines.rs b/src/test/run-pass/logging-separate-lines.rs index ebbe7fa65cdf8..0f13df644a1f7 100644 --- a/src/test/run-pass/logging-separate-lines.rs +++ b/src/test/run-pass/logging-separate-lines.rs @@ -12,9 +12,7 @@ // ignore-windows // exec-env:RUST_LOG=debug -#![feature(phase)] - -#[phase(plugin, link)] +#[macro_use] extern crate log; use std::io::Command; diff --git a/src/test/run-pass/macro-crate-def-only.rs b/src/test/run-pass/macro-crate-def-only.rs index 70080fcc3c91d..7505fa6e6841a 100644 --- a/src/test/run-pass/macro-crate-def-only.rs +++ b/src/test/run-pass/macro-crate-def-only.rs @@ -10,9 +10,7 @@ // aux-build:macro_crate_def_only.rs -#![feature(phase)] - -#[phase(plugin)] +#[macro_use] #[no_link] extern crate macro_crate_def_only; pub fn main() { diff --git a/src/test/run-pass/macro-crate-nonterminal-renamed.rs b/src/test/run-pass/macro-crate-nonterminal-renamed.rs index cf9a53f27be5d..cb919297b0406 100644 --- a/src/test/run-pass/macro-crate-nonterminal-renamed.rs +++ b/src/test/run-pass/macro-crate-nonterminal-renamed.rs @@ -11,9 +11,7 @@ // aux-build:macro_crate_nonterminal.rs // ignore-stage1 -#![feature(phase)] - -#[phase(plugin, link)] +#[macro_use] extern crate "macro_crate_nonterminal" as new_name; pub fn main() { diff --git a/src/test/run-pass/macro-crate-nonterminal.rs b/src/test/run-pass/macro-crate-nonterminal.rs index 8abf534ab1249..9882f806a9eea 100644 --- a/src/test/run-pass/macro-crate-nonterminal.rs +++ b/src/test/run-pass/macro-crate-nonterminal.rs @@ -11,9 +11,7 @@ // aux-build:macro_crate_nonterminal.rs // ignore-stage1 -#![feature(phase)] - -#[phase(plugin, link)] +#[macro_use] extern crate macro_crate_nonterminal; pub fn main() { diff --git a/src/test/run-pass/macro-export-inner-module.rs b/src/test/run-pass/macro-export-inner-module.rs index 88ca466b4afdf..ef22410751c0c 100644 --- a/src/test/run-pass/macro-export-inner-module.rs +++ b/src/test/run-pass/macro-export-inner-module.rs @@ -11,9 +11,7 @@ //aux-build:macro_export_inner_module.rs //ignore-stage1 -#![feature(phase)] - -#[phase(plugin)] +#[macro_use] #[no_link] extern crate macro_export_inner_module; pub fn main() { diff --git a/src/test/run-pass/macro-reexport.rs b/src/test/run-pass/macro-reexport.rs index bc3632e76ba49..9701610cbd964 100644 --- a/src/test/run-pass/macro-reexport.rs +++ b/src/test/run-pass/macro-reexport.rs @@ -12,9 +12,7 @@ // aux-build:macro_reexport_2.rs // ignore-stage1 -#![feature(phase)] - -#[phase(plugin)] +#[macro_use] #[no_link] extern crate macro_reexport_2; fn main() { diff --git a/src/test/run-pass/rust-log-filter.rs b/src/test/run-pass/rust-log-filter.rs index 2612483ded486..95f90ebbf8edf 100644 --- a/src/test/run-pass/rust-log-filter.rs +++ b/src/test/run-pass/rust-log-filter.rs @@ -10,8 +10,7 @@ // exec-env:RUST_LOG=rust-log-filter/f.o -#![feature(phase)] -#[phase(plugin,link)] +#[macro_use] extern crate log; use std::sync::mpsc::{channel, Sender, Receiver}; diff --git a/src/test/run-pass/tcp-stress.rs b/src/test/run-pass/tcp-stress.rs index 62b61c153c707..7d226aa942032 100644 --- a/src/test/run-pass/tcp-stress.rs +++ b/src/test/run-pass/tcp-stress.rs @@ -12,8 +12,7 @@ // ignore-android needs extra network permissions // exec-env:RUST_LOG=debug -#![feature(phase)] -#[phase(plugin, link)] +#[macro_use] extern crate log; extern crate libc; diff --git a/src/test/run-pass/vec-macro-no-std.rs b/src/test/run-pass/vec-macro-no-std.rs index b01cad43603a9..c04afffb12037 100644 --- a/src/test/run-pass/vec-macro-no-std.rs +++ b/src/test/run-pass/vec-macro-no-std.rs @@ -8,14 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(phase, lang_items)] +#![feature(lang_items)] #![no_std] -#[phase(plugin, link)] +#[macro_use] extern crate core; extern crate libc; -#[phase(plugin, link)] +#[macro_use] extern crate collections; use core::option::Option::Some;