1
Fork 0

Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]

This commit is contained in:
Keegan McAllister 2014-12-31 20:43:46 -08:00
parent f314e2c4ea
commit 60be2f52d2
82 changed files with 363 additions and 236 deletions

View file

@ -15,7 +15,14 @@
extern crate test; extern crate test;
extern crate getopts; 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; extern crate regex;

View file

@ -8,15 +8,14 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(globs, phase, macro_rules)] #![feature(globs, plugin, macro_rules)]
extern crate syntax; extern crate syntax;
extern crate rustc; extern crate rustc;
#[phase(link)]
extern crate regex; extern crate regex;
#[phase(link, plugin)] #[macro_use]
extern crate log; extern crate log;
use std::collections::HashMap; use std::collections::HashMap;

View file

@ -68,14 +68,33 @@
#![feature(lang_items, phase, unsafe_destructor, default_type_params, old_orphan_check)] #![feature(lang_items, phase, unsafe_destructor, default_type_params, old_orphan_check)]
#![feature(associated_types)] #![feature(associated_types)]
#[cfg(stage0)]
#[phase(plugin, link)] #[phase(plugin, link)]
extern crate core; extern crate core;
#[cfg(not(stage0))]
#[macro_use]
extern crate core;
extern crate libc; extern crate libc;
// Allow testing this library // Allow testing this library
#[cfg(test)] #[phase(plugin, link)] extern crate std; #[cfg(all(test, stage0))]
#[cfg(test)] #[phase(plugin, link)] extern crate log; #[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 // Heaps provided for low-level allocation strategies

View file

@ -29,15 +29,34 @@
#![feature(associated_types)] #![feature(associated_types)]
#![no_std] #![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 unicode;
extern crate alloc; extern crate alloc;
#[cfg(test)] extern crate test; #[cfg(test)] extern crate test;
#[cfg(test)] #[phase(plugin, link)] extern crate std; #[cfg(all(test, stage0))]
#[cfg(test)] #[phase(plugin, link)] extern crate log; #[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 binary_heap::BinaryHeap;
pub use bitv::Bitv; pub use bitv::Bitv;

View file

@ -21,9 +21,9 @@
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", #![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_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/")] 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; extern crate libc;

View file

@ -85,11 +85,11 @@
html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/", html_root_url = "http://doc.rust-lang.org/nightly/",
html_playground_url = "http://play.rust-lang.org/")] html_playground_url = "http://play.rust-lang.org/")]
#![feature(globs, phase, slicing_syntax)] #![feature(globs, slicing_syntax)]
#![feature(unboxed_closures)] #![feature(unboxed_closures)]
#![deny(missing_docs)] #![deny(missing_docs)]
#[cfg(test)] #[phase(plugin, link)] extern crate log; #[cfg(test)] #[macro_use] extern crate log;
use self::Name::*; use self::Name::*;
use self::HasArg::*; use self::HasArg::*;

View file

@ -13,8 +13,7 @@
//! # Examples //! # Examples
//! //!
//! ``` //! ```
//! #![feature(phase)] //! #[macro_use] extern crate log;
//! #[phase(plugin, link)] extern crate log;
//! //!
//! fn main() { //! fn main() {
//! debug!("this is a debug {}", "message"); //! debug!("this is a debug {}", "message");

View file

@ -19,8 +19,7 @@
/// # Example /// # Example
/// ///
/// ``` /// ```
/// #![feature(phase)] /// #[macro_use] extern crate log;
/// #[phase(plugin, link)] extern crate log;
/// ///
/// fn main() { /// fn main() {
/// log!(log::WARN, "this is a warning {}", "message"); /// log!(log::WARN, "this is a warning {}", "message");
@ -68,8 +67,7 @@ macro_rules! log {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// #![feature(phase)] /// #[macro_use] extern crate log;
/// #[phase(plugin, link)] extern crate log;
/// ///
/// fn main() { /// fn main() {
/// let error = 3u; /// let error = 3u;
@ -94,8 +92,7 @@ macro_rules! error {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// #![feature(phase)] /// #[macro_use] extern crate log;
/// #[phase(plugin, link)] extern crate log;
/// ///
/// fn main() { /// fn main() {
/// let code = 3u; /// let code = 3u;
@ -119,8 +116,7 @@ macro_rules! warn {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// #![feature(phase)] /// #[macro_use] extern crate log;
/// #[phase(plugin, link)] extern crate log;
/// ///
/// fn main() { /// fn main() {
/// let ret = 3i; /// let ret = 3i;
@ -146,8 +142,7 @@ macro_rules! info {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// #![feature(phase)] /// #[macro_use] extern crate log;
/// #[phase(plugin, link)] extern crate log;
/// ///
/// fn main() { /// fn main() {
/// debug!("x = {x}, y = {y}", x=10i, y=20i); /// debug!("x = {x}, y = {y}", x=10i, y=20i);
@ -170,8 +165,7 @@ macro_rules! debug {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// #![feature(phase)] /// #[macro_use] extern crate log;
/// #[phase(plugin, link)] extern crate log;
/// ///
/// struct Point { x: int, y: int } /// struct Point { x: int, y: int }
/// fn some_expensive_computation() -> Point { Point { x: 1, y: 2 } } /// fn some_expensive_computation() -> Point { Point { x: 1, y: 2 } }

View file

@ -29,11 +29,29 @@
#![no_std] #![no_std]
#![experimental] #![experimental]
#[cfg(stage0)]
#[phase(plugin, link)] #[phase(plugin, link)]
extern crate core; extern crate core;
#[cfg(test)] #[phase(plugin, link)] extern crate std; #[cfg(not(stage0))]
#[cfg(test)] #[phase(plugin, link)] extern crate log; #[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::*; use core::prelude::*;

View file

@ -30,7 +30,14 @@
extern crate serialize; 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; #[cfg(test)] extern crate test;
pub use self::EbmlEncoderTag::*; pub use self::EbmlEncoderTag::*;

View file

@ -24,7 +24,7 @@
html_playground_url = "http://play.rust-lang.org/")] html_playground_url = "http://play.rust-lang.org/")]
#![allow(unknown_features)] #![allow(unknown_features)]
#![feature(macro_rules, phase, slicing_syntax, globs)] #![feature(macro_rules, slicing_syntax, globs)]
#![feature(unboxed_closures)] #![feature(unboxed_closures)]
#![feature(associated_types)] #![feature(associated_types)]
#![deny(missing_docs)] #![deny(missing_docs)]

View file

@ -40,8 +40,22 @@ extern crate rustc_back;
extern crate serialize; extern crate serialize;
extern crate rbml; extern crate rbml;
extern crate collections; 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 extern crate "serialize" as rustc_serialize; // used by deriving

View file

@ -89,12 +89,7 @@ fn warn_if_multiple_versions(diag: &SpanHandler, cstore: &CStore) {
} }
fn should_link(i: &ast::ViewItem) -> bool { fn should_link(i: &ast::ViewItem) -> bool {
i.attrs.iter().all(|attr| { !attr::contains_name(i.attrs[], "no_link")
attr.name().get() != "phase" ||
attr.meta_item_list().map_or(false, |phases| {
attr::contains_name(phases[], "link")
})
})
} }
struct CrateInfo { struct CrateInfo {

View file

@ -84,26 +84,36 @@ impl<'a, 'v> Visitor<'v> for PluginLoader<'a> {
_ => return, _ => return,
} }
let mut plugin_phase = false; // Parse the attributes relating to macro / plugin loading.
for attr in vi.attrs.iter().filter(|a| a.check_name("phase")) { let mut load_macros = false;
let phases = attr.meta_item_list().unwrap_or(&[]); let mut load_registrar = false;
if attr::contains_name(phases, "plugin") { for attr in vi.attrs.iter() {
plugin_phase = true; 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") { if used {
plugin_phase = true; attr::mark_used(attr);
self.sess.span_warn(attr.span,
"phase(syntax) is a deprecated synonym for phase(plugin)");
} }
} }
let mut macros = vec![]; let mut macros = vec![];
let mut registrar = None; let mut registrar = None;
if plugin_phase { if load_macros || load_registrar {
let pmd = self.reader.read_plugin_metadata(vi); let pmd = self.reader.read_plugin_metadata(vi);
macros = pmd.exported_macros(); if load_macros {
registrar = pmd.plugin_registrar(); macros = pmd.exported_macros();
}
if load_registrar {
registrar = pmd.plugin_registrar();
}
} }
self.plugins.macros.extend(macros.into_iter()); self.plugins.macros.extend(macros.into_iter());

View file

@ -43,14 +43,14 @@
//! To use a plugin while compiling another crate: //! To use a plugin while compiling another crate:
//! //!
//! ```rust //! ```rust
//! #![feature(phase)] //! #![feature(plugin)]
//! //!
//! #[phase(plugin)] //! #[plugin]
//! extern crate myplugin; //! extern crate myplugin;
//! ``` //! ```
//! //!
//! If you also need the plugin crate available at runtime, use //! If you don't need the plugin crate available at runtime, use
//! `phase(plugin, link)`. //! `#[no_link]` as well.
//! //!
//! See [the compiler plugin guide](../../guide-plugin.html) //! See [the compiler plugin guide](../../guide-plugin.html)
//! for more examples. //! for more examples.

View file

@ -34,8 +34,14 @@
#![feature(unboxed_closures)] #![feature(unboxed_closures)]
#![feature(old_orphan_check)] #![feature(old_orphan_check)]
#[cfg(stage0)]
#[phase(plugin, link)] #[phase(plugin, link)]
extern crate log; extern crate log;
#[cfg(not(stage0))]
#[macro_use]
extern crate log;
extern crate syntax; extern crate syntax;
extern crate serialize; extern crate serialize;

View file

@ -24,8 +24,21 @@
#![feature(old_orphan_check)] #![feature(old_orphan_check)]
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
#[phase(plugin, link)] extern crate log; #[cfg(stage0)]
#[phase(plugin, link)] extern crate syntax; #[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` // for "clarity", rename the graphviz crate to dot; graphviz within `borrowck`
// refers to the borrowck-specific graphviz adapter traits. // refers to the borrowck-specific graphviz adapter traits.

View file

@ -39,11 +39,25 @@ extern crate rustc_borrowck;
extern crate rustc_resolve; extern crate rustc_resolve;
extern crate rustc_trans; extern crate rustc_trans;
extern crate rustc_typeck; extern crate rustc_typeck;
#[phase(plugin, link)] extern crate log;
#[phase(plugin, link)] extern crate syntax;
extern crate serialize; extern crate serialize;
extern crate "rustc_llvm" as llvm; 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; pub use syntax::diagnostic;
use rustc_trans::back::link; use rustc_trans::back::link;

View file

@ -20,8 +20,21 @@
#![feature(rustc_diagnostic_macros)] #![feature(rustc_diagnostic_macros)]
#![feature(associated_types)] #![feature(associated_types)]
#[phase(plugin, link)] extern crate log; #[cfg(stage0)]
#[phase(plugin, link)] extern crate syntax; #[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; extern crate rustc;

View file

@ -37,11 +37,25 @@ extern crate graphviz;
extern crate libc; extern crate libc;
extern crate rustc; extern crate rustc;
extern crate rustc_back; extern crate rustc_back;
#[phase(plugin, link)] extern crate log;
#[phase(plugin, link)] extern crate syntax;
extern crate serialize; extern crate serialize;
extern crate "rustc_llvm" as llvm; 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::session;
pub use rustc::metadata; pub use rustc::metadata;
pub use rustc::middle; pub use rustc::middle;

View file

@ -77,8 +77,21 @@ This API is completely unstable and subject to change.
#![feature(unboxed_closures)] #![feature(unboxed_closures)]
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
#[phase(plugin, link)] extern crate log; #[cfg(stage0)]
#[phase(plugin, link)] extern crate syntax; #[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 arena;
extern crate rustc; extern crate rustc;

View file

@ -32,7 +32,14 @@ extern crate rustc_driver;
extern crate serialize; extern crate serialize;
extern crate syntax; extern crate syntax;
extern crate "test" as testing; 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 extern crate "serialize" as rustc_serialize; // used by deriving

View file

@ -31,8 +31,14 @@ Core encoding and decoding interfaces.
#[cfg(test)] #[cfg(test)]
extern crate test; extern crate test;
#[cfg(stage0)]
#[phase(plugin, link)] #[phase(plugin, link)]
extern crate log; extern crate log;
#[cfg(not(stage0))]
#[macro_use]
extern crate log;
extern crate unicode; extern crate unicode;
extern crate collections; extern crate collections;

View file

@ -120,12 +120,30 @@
#![macro_reexport(assert, assert_eq, debug_assert, debug_assert_eq, #![macro_reexport(assert, assert_eq, debug_assert, debug_assert_eq,
unreachable, unimplemented, write, writeln, vec)] 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)] #[phase(plugin, link)]
extern crate core; extern crate core;
#[cfg(not(stage0))]
#[macro_use]
extern crate core;
#[cfg(stage0)]
#[phase(plugin, link)] #[phase(plugin, link)]
extern crate "collections" as core_collections; 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 "rand" as core_rand;
extern crate alloc; extern crate alloc;
extern crate unicode; extern crate unicode;

View file

@ -44,7 +44,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
("non_ascii_idents", Active), ("non_ascii_idents", Active),
("thread_local", Active), ("thread_local", Active),
("link_args", Active), ("link_args", Active),
("phase", Active), ("phase", Active), // NOTE(stage0): switch to Removed after next snapshot
("plugin_registrar", Active), ("plugin_registrar", Active),
("log_syntax", Active), ("log_syntax", Active),
("trace_macros", Active), ("trace_macros", Active),
@ -74,6 +74,8 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
("if_let", Accepted), ("if_let", Accepted),
("while_let", Accepted), ("while_let", Accepted),
("plugin", Active),
// A temporary feature gate used to enable parser extensions needed // A temporary feature gate used to enable parser extensions needed
// to bootstrap fix for #5723. // to bootstrap fix for #5723.
("issue_5723_bootstrap", Accepted), ("issue_5723_bootstrap", Accepted),
@ -163,22 +165,6 @@ struct MacroVisitor<'a> {
} }
impl<'a, 'v> Visitor<'v> for 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) { fn visit_mac(&mut self, macro: &ast::Mac) {
let ast::MacInvocTT(ref path, _, _) = macro.node; let ast::MacInvocTT(ref path, _, _) = macro.node;
let id = path.segments.last().unwrap().identifier; let id = path.segments.last().unwrap().identifier;
@ -241,10 +227,10 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
} }
ast::ViewItemExternCrate(..) => { ast::ViewItemExternCrate(..) => {
for attr in i.attrs.iter() { for attr in i.attrs.iter() {
if attr.name().get() == "phase"{ if attr.check_name("plugin") {
self.gate_feature("phase", attr.span, self.gate_feature("plugin", attr.span,
"compile time crate loading is \ "compiler plugins are experimental \
experimental and possibly buggy"); and possibly buggy");
} }
} }
} }

View file

@ -31,11 +31,18 @@
extern crate arena; extern crate arena;
extern crate fmt_macros; extern crate fmt_macros;
#[phase(plugin, link)] extern crate log;
extern crate serialize; extern crate serialize;
extern crate term; extern crate term;
extern crate libc; 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 extern crate "serialize" as rustc_serialize; // used by deriving
pub mod util { pub mod util {

View file

@ -65,12 +65,8 @@ impl<'a> fold::Folder for StandardLibraryInjector<'a> {
Some((actual_crate_name, ast::CookedStr)), Some((actual_crate_name, ast::CookedStr)),
ast::DUMMY_NODE_ID), ast::DUMMY_NODE_ID),
attrs: vec!( attrs: vec!(
attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_list_item( attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(
InternedString::new("phase"), InternedString::new("macro_use")))),
vec!(
attr::mk_word_item(InternedString::new("plugin")),
attr::mk_word_item(InternedString::new("link")
))))),
vis: ast::Inherited, vis: ast::Inherited,
span: DUMMY_SP 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. // don't add #![no_std] here, that will block the prelude injection later.
// Add it during the prelude injection instead. // 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 krate
} }
} }

View file

@ -52,7 +52,13 @@
#![deny(missing_docs)] #![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; pub use terminfo::TerminfoTerminal;
#[cfg(windows)] #[cfg(windows)]

View file

@ -32,7 +32,7 @@
html_root_url = "http://doc.rust-lang.org/nightly/")] html_root_url = "http://doc.rust-lang.org/nightly/")]
#![allow(unknown_features)] #![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(unboxed_closures, default_type_params)]
#![feature(old_orphan_check)] #![feature(old_orphan_check)]

View file

@ -11,8 +11,7 @@
// no-prefer-dynamic // no-prefer-dynamic
#![crate_type = "rlib"] #![crate_type = "rlib"]
#![feature(phase)]
#[phase(plugin)] extern crate "issue-13560-1" as t1; #[macro_use] #[no_link] extern crate "issue-13560-1" as t1;
#[phase(plugin, link)] extern crate "issue-13560-2" as t2; #[macro_use] extern crate "issue-13560-2" as t2;

View file

@ -10,12 +10,12 @@
// force-host // force-host
#![feature(phase, plugin_registrar)] #![feature(plugin_registrar)]
extern crate syntax; extern crate syntax;
// Load rustc as a plugin to get macros // Load rustc as a plugin to get macros
#[phase(plugin, link)] #[macro_use]
extern crate rustc; extern crate rustc;
use syntax::ast; use syntax::ast;

View file

@ -10,12 +10,12 @@
// force-host // force-host
#![feature(phase, plugin_registrar)] #![feature(plugin_registrar)]
extern crate syntax; extern crate syntax;
// Load rustc as a plugin to get macros // Load rustc as a plugin to get macros
#[phase(plugin, link)] #[macro_use]
extern crate rustc; extern crate rustc;
use syntax::ast; use syntax::ast;

View file

@ -8,8 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(phase)] #[macro_use] extern crate log;
#[phase(plugin, link)] extern crate log;
pub fn foo<T>() { pub fn foo<T>() {
fn death() -> int { panic!() } fn death() -> int { panic!() }

View file

@ -9,9 +9,8 @@
// except according to those terms. // except according to those terms.
#![crate_type = "dylib"] #![crate_type = "dylib"]
#![feature(phase)]
#![macro_reexport(reexported)] #![macro_reexport(reexported)]
#[phase(plugin)] #[macro_use] #[no_link]
extern crate macro_reexport_1; extern crate macro_reexport_1;

View file

@ -14,10 +14,9 @@
// it hasn't been defined just yet. Make sure we don't explode. // it hasn't been defined just yet. Make sure we don't explode.
#![no_std] #![no_std]
#![feature(phase)]
#![crate_type = "rlib"] #![crate_type = "rlib"]
#[phase(plugin, link)] #[macro_use]
extern crate core; extern crate core;
struct A; struct A;

View file

@ -41,7 +41,7 @@
// ignore-stage1 // ignore-stage1
// ignore-cross-compile #12102 // ignore-cross-compile #12102
#![feature(macro_rules, phase, slicing_syntax)] #![feature(macro_rules, plugin, slicing_syntax)]
extern crate regex; extern crate regex;

View file

@ -11,8 +11,8 @@
// aux-build:macro_crate_test.rs // aux-build:macro_crate_test.rs
// ignore-stage1 // ignore-stage1
#[phase(plugin)] #[plugin] #[no_link]
//~^ ERROR compile time crate loading is experimental and possibly buggy //~^ ERROR compiler plugins are experimental and possibly buggy
extern crate macro_crate_test; extern crate macro_crate_test;
fn main() {} fn main() {}

View file

@ -12,9 +12,9 @@
// ignore-stage1 // ignore-stage1
// compile-flags: -D lint-me // compile-flags: -D lint-me
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate lint_group_plugin_test; extern crate lint_group_plugin_test;
fn lintme() { } //~ ERROR item is named 'lintme' fn lintme() { } //~ ERROR item is named 'lintme'

View file

@ -11,10 +11,10 @@
// aux-build:lint_plugin_test.rs // aux-build:lint_plugin_test.rs
// ignore-stage1 // ignore-stage1
#![feature(phase)] #![feature(plugin)]
#![deny(test_lint)] #![deny(test_lint)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate lint_plugin_test; extern crate lint_plugin_test;
fn lintme() { } //~ ERROR item is named 'lintme' fn lintme() { } //~ ERROR item is named 'lintme'

View file

@ -12,9 +12,9 @@
// ignore-stage1 // ignore-stage1
// compile-flags: -D test-lint // compile-flags: -D test-lint
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate lint_plugin_test; extern crate lint_plugin_test;
fn lintme() { } //~ ERROR item is named 'lintme' fn lintme() { } //~ ERROR item is named 'lintme'

View file

@ -11,10 +11,10 @@
// aux-build:lint_plugin_test.rs // aux-build:lint_plugin_test.rs
// ignore-stage1 // ignore-stage1
#![feature(phase)] #![feature(plugin)]
#![forbid(test_lint)] #![forbid(test_lint)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate lint_plugin_test; extern crate lint_plugin_test;
fn lintme() { } //~ ERROR item is named 'lintme' fn lintme() { } //~ ERROR item is named 'lintme'

View file

@ -12,9 +12,9 @@
// ignore-stage1 // ignore-stage1
// compile-flags: -F test-lint // compile-flags: -F test-lint
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate lint_plugin_test; extern crate lint_plugin_test;
fn lintme() { } //~ ERROR item is named 'lintme' fn lintme() { } //~ ERROR item is named 'lintme'

View file

@ -20,9 +20,9 @@
// editors, so instead he made a macro that expands into the embedded // editors, so instead he made a macro that expands into the embedded
// ident form. // ident form.
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate macro_crate_test; extern crate macro_crate_test;
fn main() { fn main() {

View file

@ -12,9 +12,7 @@
// ignore-stage1 // ignore-stage1
// ignore-android // ignore-android
#![feature(phase)] #[macro_use] #[no_link]
#[phase(plugin)]
extern crate macro_crate_test; extern crate macro_crate_test;
fn main() { fn main() {

View file

@ -14,8 +14,8 @@
// ignore-android // ignore-android
// ignore-cross-compile gives a different error message // ignore-cross-compile gives a different error message
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] extern crate rlib_crate_test; #[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 //~^ ERROR: plugin crate `rlib_crate_test` only found in rlib format, but must be available in dylib format
fn main() {} fn main() {}

View file

@ -12,9 +12,7 @@
// ignore-stage1 // ignore-stage1
// ignore-android // ignore-android
#![feature(phase)] #[macro_use] #[no_link]
#[phase(plugin)]
extern crate macro_crate_test; extern crate macro_crate_test;
fn main() { fn main() {

View file

@ -8,9 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(phase)] #[macro_use] #[no_link]
#[phase(plugin)]
extern crate doesnt_exist; //~ ERROR can't find crate extern crate doesnt_exist; //~ ERROR can't find crate
fn main() {} fn main() {}

View file

@ -13,9 +13,9 @@
// ignore-android // ignore-android
// error-pattern: plugin tried to register a new MacroRulesTT // error-pattern: plugin tried to register a new MacroRulesTT
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate macro_crate_MacroRulesTT; extern crate macro_crate_MacroRulesTT;
fn main() { } fn main() { }

View file

@ -8,11 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[phase(blah)]
#![feature(phase)] //~^ ERROR #[phase] is deprecated
extern crate foo;
#[phase(plugin)]
use std::mem;
fn main() {} fn main() {}

View file

@ -8,11 +8,10 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(phase)]
#![deny(dead_code)] #![deny(dead_code)]
#![allow(unreachable_code)] #![allow(unreachable_code)]
#[phase(link, plugin)] extern crate core; #[macro_use] extern crate core;
fn foo() { //~ ERROR function is never used fn foo() { //~ ERROR function is never used

View file

@ -13,7 +13,7 @@
// aux-build:stability_cfg1.rs // aux-build:stability_cfg1.rs
// aux-build:stability_cfg2.rs // aux-build:stability_cfg2.rs
#![feature(globs, phase)] #![feature(globs)]
#![deny(unstable)] #![deny(unstable)]
#![deny(deprecated)] #![deny(deprecated)]
#![deny(experimental)] #![deny(experimental)]
@ -23,7 +23,7 @@ mod cross_crate {
extern crate stability_cfg1; extern crate stability_cfg1;
extern crate stability_cfg2; //~ ERROR: use of experimental item extern crate stability_cfg2; //~ ERROR: use of experimental item
#[phase(plugin, link)] #[macro_use]
extern crate lint_stability; //~ ERROR: use of unmarked item extern crate lint_stability; //~ ERROR: use of unmarked item
use self::lint_stability::*; use self::lint_stability::*;

View file

@ -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 // file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT. // http://rust-lang.org/COPYRIGHT.
// //
@ -8,12 +8,12 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(phase)] #[no_link]
extern crate libc;
//~ WARNING phase(syntax) is a deprecated synonym for phase(plugin)
#[phase(syntax, link)]
extern crate log;
fn main() { fn main() {
debug!("foo"); unsafe {
libc::abs(0); //~ ERROR Use of undeclared type or module `libc`
//~^ ERROR unresolved name `libc::abs`
}
} }

View file

@ -1,7 +1,6 @@
#![feature(phase)]
#![no_std] #![no_std]
#![feature(globs)] #![feature(globs)]
#[phase(plugin, link)] #[macro_use]
extern crate "std" as std; extern crate "std" as std;
#[prelude_import] #[prelude_import]
use std::prelude::v1::*; use std::prelude::v1::*;

View file

@ -10,8 +10,7 @@
// error-pattern:whatever // error-pattern:whatever
#![feature(phase)] #[macro_use] extern crate log;
#[phase(plugin, link)] extern crate log;
use std::os; use std::os;
fn main() { fn main() {

View file

@ -10,8 +10,7 @@
// error-pattern:whatever // error-pattern:whatever
#![feature(phase)] #[macro_use] extern crate log;
#[phase(plugin, link)] extern crate log;
use std::os; use std::os;
use std::thread::Thread; use std::thread::Thread;

View file

@ -10,8 +10,7 @@
// error-pattern:whatever // error-pattern:whatever
#![feature(phase)] #[macro_use] extern crate log;
#[phase(plugin, link)] extern crate log;
use std::os; use std::os;
fn main() { fn main() {

View file

@ -8,9 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(phase)] #[macro_use]
#[phase(plugin, link)]
extern crate foo; extern crate foo;
fn main() { fn main() {

View file

@ -8,9 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(phase)]
extern crate lib; extern crate lib;
#[phase(plugin, link)] extern crate log; #[macro_use] extern crate log;
fn main() {} fn main() {}

View file

@ -11,9 +11,9 @@
// ignore-stage1 // ignore-stage1
// ignore-android // ignore-android
// aux-build:issue_16723_multiple_items_syntax_ext.rs // 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!(); multiple_items!();

View file

@ -12,9 +12,9 @@
// ignore-stage1 // ignore-stage1
// ignore-pretty // ignore-pretty
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate lint_group_plugin_test; extern crate lint_group_plugin_test;
fn lintme() { } //~ WARNING item is named 'lintme' fn lintme() { } //~ WARNING item is named 'lintme'

View file

@ -12,9 +12,9 @@
// ignore-stage1 // ignore-stage1
// compile-flags: -A test-lint // compile-flags: -A test-lint
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate lint_plugin_test; extern crate lint_plugin_test;
fn lintme() { } fn lintme() { }

View file

@ -12,9 +12,9 @@
// ignore-stage1 // ignore-stage1
// ignore-pretty // ignore-pretty
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate lint_plugin_test; extern crate lint_plugin_test;
fn lintme() { } //~ WARNING item is named 'lintme' fn lintme() { } //~ WARNING item is named 'lintme'

View file

@ -14,9 +14,9 @@
// Issue #15750: a macro that internally parses its input and then // Issue #15750: a macro that internally parses its input and then
// uses `quote_expr!` to rearrange it should be hygiene-preserving. // uses `quote_expr!` to rearrange it should be hygiene-preserving.
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate macro_crate_test; extern crate macro_crate_test;
fn main() { fn main() {

View file

@ -11,9 +11,9 @@
// aux-build:plugin_crate_outlive_expansion_phase.rs // aux-build:plugin_crate_outlive_expansion_phase.rs
// ignore-stage1 // ignore-stage1
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate plugin_crate_outlive_expansion_phase; extern crate plugin_crate_outlive_expansion_phase;
pub fn main() {} pub fn main() {}

View file

@ -11,9 +11,9 @@
// aux-build:macro_crate_test.rs // aux-build:macro_crate_test.rs
// ignore-stage1 // ignore-stage1
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[macro_use] #[plugin] #[no_link]
extern crate macro_crate_test; extern crate macro_crate_test;
#[into_foo] #[into_foo]

View file

@ -15,9 +15,9 @@
// macro_crate_test will not compile on a cross-compiled target because // macro_crate_test will not compile on a cross-compiled target because
// libsyntax is not compiled for it. // libsyntax is not compiled for it.
#![feature(phase)] #![feature(plugin)]
#[phase(plugin, link)] #[plugin]
extern crate macro_crate_test; extern crate macro_crate_test;
fn main() { fn main() {

View file

@ -11,9 +11,9 @@
// aux-build:roman_numerals.rs // aux-build:roman_numerals.rs
// ignore-stage1 // ignore-stage1
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate roman_numerals; extern crate roman_numerals;
pub fn main() { pub fn main() {

View file

@ -12,9 +12,9 @@
// aux-build:syntax-extension-with-dll-deps-2.rs // aux-build:syntax-extension-with-dll-deps-2.rs
// ignore-stage1 // ignore-stage1
#![feature(phase)] #![feature(plugin)]
#[phase(plugin)] #[plugin] #[no_link]
extern crate "syntax-extension-with-dll-deps-2" as extension; extern crate "syntax-extension-with-dll-deps-2" as extension;
fn main() { fn main() {

View file

@ -11,9 +11,7 @@
// ignore-android (FIXME #11419) // ignore-android (FIXME #11419)
// exec-env:RUST_LOG=info // exec-env:RUST_LOG=info
#![feature(phase)] #[macro_use]
#[phase(plugin, link)]
extern crate log; extern crate log;
use log::{set_logger, Logger, LogRecord}; use log::{set_logger, Logger, LogRecord};

View file

@ -11,8 +11,7 @@
// compile-flags: --cfg ndebug // compile-flags: --cfg ndebug
// exec-env:RUST_LOG=conditional-debug-macro-off=4 // exec-env:RUST_LOG=conditional-debug-macro-off=4
#![feature(phase)] #[macro_use]
#[phase(plugin, link)]
extern crate log; extern crate log;
pub fn main() { pub fn main() {

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(phase)] #[macro_use] extern crate "std" as std2;
#[phase(plugin, link)] extern crate "std" as std2;
fn main() {} fn main() {}

View file

@ -11,8 +11,7 @@
// compile-flags:--cfg ndebug // compile-flags:--cfg ndebug
// exec-env:RUST_LOG=logging-enabled-debug=debug // exec-env:RUST_LOG=logging-enabled-debug=debug
#![feature(phase)] #[macro_use]
#[phase(plugin, link)]
extern crate log; extern crate log;
pub fn main() { pub fn main() {

View file

@ -10,8 +10,7 @@
// exec-env:RUST_LOG=logging-enabled=info // exec-env:RUST_LOG=logging-enabled=info
#![feature(phase)] #[macro_use]
#[phase(plugin, link)]
extern crate log; extern crate log;
pub fn main() { pub fn main() {

View file

@ -12,9 +12,7 @@
// ignore-windows // ignore-windows
// exec-env:RUST_LOG=debug // exec-env:RUST_LOG=debug
#![feature(phase)] #[macro_use]
#[phase(plugin, link)]
extern crate log; extern crate log;
use std::io::Command; use std::io::Command;

View file

@ -10,9 +10,7 @@
// aux-build:macro_crate_def_only.rs // aux-build:macro_crate_def_only.rs
#![feature(phase)] #[macro_use] #[no_link]
#[phase(plugin)]
extern crate macro_crate_def_only; extern crate macro_crate_def_only;
pub fn main() { pub fn main() {

View file

@ -11,9 +11,7 @@
// aux-build:macro_crate_nonterminal.rs // aux-build:macro_crate_nonterminal.rs
// ignore-stage1 // ignore-stage1
#![feature(phase)] #[macro_use]
#[phase(plugin, link)]
extern crate "macro_crate_nonterminal" as new_name; extern crate "macro_crate_nonterminal" as new_name;
pub fn main() { pub fn main() {

View file

@ -11,9 +11,7 @@
// aux-build:macro_crate_nonterminal.rs // aux-build:macro_crate_nonterminal.rs
// ignore-stage1 // ignore-stage1
#![feature(phase)] #[macro_use]
#[phase(plugin, link)]
extern crate macro_crate_nonterminal; extern crate macro_crate_nonterminal;
pub fn main() { pub fn main() {

View file

@ -11,9 +11,7 @@
//aux-build:macro_export_inner_module.rs //aux-build:macro_export_inner_module.rs
//ignore-stage1 //ignore-stage1
#![feature(phase)] #[macro_use] #[no_link]
#[phase(plugin)]
extern crate macro_export_inner_module; extern crate macro_export_inner_module;
pub fn main() { pub fn main() {

View file

@ -12,9 +12,7 @@
// aux-build:macro_reexport_2.rs // aux-build:macro_reexport_2.rs
// ignore-stage1 // ignore-stage1
#![feature(phase)] #[macro_use] #[no_link]
#[phase(plugin)]
extern crate macro_reexport_2; extern crate macro_reexport_2;
fn main() { fn main() {

View file

@ -10,8 +10,7 @@
// exec-env:RUST_LOG=rust-log-filter/f.o // exec-env:RUST_LOG=rust-log-filter/f.o
#![feature(phase)] #[macro_use]
#[phase(plugin,link)]
extern crate log; extern crate log;
use std::sync::mpsc::{channel, Sender, Receiver}; use std::sync::mpsc::{channel, Sender, Receiver};

View file

@ -12,8 +12,7 @@
// ignore-android needs extra network permissions // ignore-android needs extra network permissions
// exec-env:RUST_LOG=debug // exec-env:RUST_LOG=debug
#![feature(phase)] #[macro_use]
#[phase(plugin, link)]
extern crate log; extern crate log;
extern crate libc; extern crate libc;

View file

@ -8,14 +8,14 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(phase, lang_items)] #![feature(lang_items)]
#![no_std] #![no_std]
#[phase(plugin, link)] #[macro_use]
extern crate core; extern crate core;
extern crate libc; extern crate libc;
#[phase(plugin, link)] #[macro_use]
extern crate collections; extern crate collections;
use core::option::Option::Some; use core::option::Option::Some;