提交 60be2f52 编写于 作者: K Keegan McAllister

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

上级 f314e2c4
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -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;
......
......@@ -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::*;
......
......@@ -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");
......
......@@ -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 @@
/// # Example
///
/// ```
/// #![feature(phase)]
/// #[phase(plugin, link)] extern crate log;
/// #[macro_use] extern crate log;
///
/// fn main() {
/// let error = 3u;
......@@ -94,8 +92,7 @@
/// # Example
///
/// ```
/// #![feature(phase)]
/// #[phase(plugin, link)] extern crate log;
/// #[macro_use] extern crate log;
///
/// fn main() {
/// let code = 3u;
......@@ -119,8 +116,7 @@
/// # Example
///
/// ```
/// #![feature(phase)]
/// #[phase(plugin, link)] extern crate log;
/// #[macro_use] extern crate log;
///
/// fn main() {
/// let ret = 3i;
......@@ -146,8 +142,7 @@
/// # 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 @@
/// # 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 } }
......
......@@ -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::*;
......
......@@ -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::*;
......
......@@ -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)]
......
......@@ -40,8 +40,22 @@
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
......
......@@ -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 {
......
......@@ -84,26 +84,36 @@ fn visit_view_item(&mut self, vi: &ast::ViewItem) {
_ => 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());
......
......@@ -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.
......
......@@ -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;
......
......@@ -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.
......
......@@ -39,11 +39,25 @@
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;
......
......@@ -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;
......
......@@ -37,11 +37,25 @@
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;
......
......@@ -77,8 +77,21 @@
#![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;
......
......@@ -32,7 +32,14 @@
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
......
......@@ -31,8 +31,14 @@
#[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;
......
......@@ -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;
......
......@@ -44,7 +44,7 @@
("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 @@
("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 @@ fn visit_view_item(&mut self, i: &ast::ViewItem) {
}
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");
}
}
}
......
......@@ -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 {
......
......@@ -65,12 +65,8 @@ fn fold_crate(&mut self, mut krate: ast::Crate) -> ast::Crate {
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 @@ fn fold_crate(&mut self, mut krate: ast::Crate) -> ast::Crate {
// 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
}
}
......
......@@ -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)]
......
......@@ -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)]
......
......@@ -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;
......@@ -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;
......
......@@ -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;
......
......@@ -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<T>() {
fn death() -> int { panic!() }
......
......@@ -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;
......@@ -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;
......
......@@ -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;
......
......@@ -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() {}
......@@ -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'
......
......@@ -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'
......
......@@ -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'
......
......@@ -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'
......
......@@ -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'
......
......@@ -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() {
......
......@@ -12,9 +12,7 @@
// ignore-stage1
// ignore-android
#![feature(phase)]
#[phase(plugin)]
#[macro_use] #[no_link]
extern crate macro_crate_test;
fn main() {
......
......@@ -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() {}
......@@ -12,9 +12,7 @@
// ignore-stage1
// ignore-android
#![feature(phase)]
#[phase(plugin)]
#[macro_use] #[no_link]
extern crate macro_crate_test;
fn main() {
......
......@@ -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() {}
......@@ -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() { }
......@@ -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() {}
......@@ -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
......
......@@ -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::*;
......
// 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`
}
}
#![feature(phase)]
#![no_std]
#![feature(globs)]
#[phase(plugin, link)]
#[macro_use]
extern crate "std" as std;
#[prelude_import]
use std::prelude::v1::*;
......
......@@ -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() {
......
......@@ -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;
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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() {}
......@@ -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!();
......
......@@ -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'
......
......@@ -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() { }
......
......@@ -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'
......
......@@ -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() {
......
......@@ -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() {}
......@@ -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]
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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};
......
......@@ -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() {
......
......@@ -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() {}
......@@ -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() {
......
......@@ -10,8 +10,7 @@
// exec-env:RUST_LOG=logging-enabled=info
#![feature(phase)]
#[phase(plugin, link)]
#[macro_use]
extern crate log;
pub fn main() {
......
......@@ -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;
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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};
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册