Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
60be2f52
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
60be2f52
编写于
12月 31, 2014
作者:
K
Keegan McAllister
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]
上级
f314e2c4
变更
82
隐藏空白更改
内联
并排
Showing
82 changed file
with
363 addition
and
236 deletion
+363
-236
src/compiletest/compiletest.rs
src/compiletest/compiletest.rs
+8
-1
src/grammar/verify.rs
src/grammar/verify.rs
+2
-3
src/liballoc/lib.rs
src/liballoc/lib.rs
+21
-2
src/libcollections/lib.rs
src/libcollections/lib.rs
+22
-3
src/libflate/lib.rs
src/libflate/lib.rs
+2
-2
src/libgetopts/lib.rs
src/libgetopts/lib.rs
+2
-2
src/liblog/lib.rs
src/liblog/lib.rs
+1
-2
src/liblog/macros.rs
src/liblog/macros.rs
+6
-12
src/librand/lib.rs
src/librand/lib.rs
+20
-2
src/librbml/lib.rs
src/librbml/lib.rs
+8
-1
src/libregex/lib.rs
src/libregex/lib.rs
+1
-1
src/librustc/lib.rs
src/librustc/lib.rs
+16
-2
src/librustc/metadata/creader.rs
src/librustc/metadata/creader.rs
+1
-6
src/librustc/plugin/load.rs
src/librustc/plugin/load.rs
+22
-12
src/librustc/plugin/mod.rs
src/librustc/plugin/mod.rs
+4
-4
src/librustc_back/lib.rs
src/librustc_back/lib.rs
+6
-0
src/librustc_borrowck/lib.rs
src/librustc_borrowck/lib.rs
+15
-2
src/librustc_driver/lib.rs
src/librustc_driver/lib.rs
+16
-2
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+15
-2
src/librustc_trans/lib.rs
src/librustc_trans/lib.rs
+16
-2
src/librustc_typeck/lib.rs
src/librustc_typeck/lib.rs
+15
-2
src/librustdoc/lib.rs
src/librustdoc/lib.rs
+8
-1
src/libserialize/lib.rs
src/libserialize/lib.rs
+6
-0
src/libstd/lib.rs
src/libstd/lib.rs
+19
-1
src/libsyntax/feature_gate.rs
src/libsyntax/feature_gate.rs
+7
-21
src/libsyntax/lib.rs
src/libsyntax/lib.rs
+8
-1
src/libsyntax/std_inject.rs
src/libsyntax/std_inject.rs
+2
-16
src/libterm/lib.rs
src/libterm/lib.rs
+7
-1
src/libtest/lib.rs
src/libtest/lib.rs
+1
-1
src/test/auxiliary/issue-13560-3.rs
src/test/auxiliary/issue-13560-3.rs
+2
-3
src/test/auxiliary/lint_group_plugin_test.rs
src/test/auxiliary/lint_group_plugin_test.rs
+2
-2
src/test/auxiliary/lint_plugin_test.rs
src/test/auxiliary/lint_plugin_test.rs
+2
-2
src/test/auxiliary/logging_right_crate.rs
src/test/auxiliary/logging_right_crate.rs
+1
-2
src/test/auxiliary/macro_reexport_2.rs
src/test/auxiliary/macro_reexport_2.rs
+1
-2
src/test/auxiliary/weak-lang-items.rs
src/test/auxiliary/weak-lang-items.rs
+1
-2
src/test/bench/shootout-regex-dna.rs
src/test/bench/shootout-regex-dna.rs
+1
-1
src/test/compile-fail-fulldeps/gated-plugin.rs
src/test/compile-fail-fulldeps/gated-plugin.rs
+2
-2
src/test/compile-fail-fulldeps/lint-group-plugin-deny-cmdline.rs
...t/compile-fail-fulldeps/lint-group-plugin-deny-cmdline.rs
+2
-2
src/test/compile-fail-fulldeps/lint-plugin-deny-attr.rs
src/test/compile-fail-fulldeps/lint-plugin-deny-attr.rs
+2
-2
src/test/compile-fail-fulldeps/lint-plugin-deny-cmdline.rs
src/test/compile-fail-fulldeps/lint-plugin-deny-cmdline.rs
+2
-2
src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs
src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs
+2
-2
src/test/compile-fail-fulldeps/lint-plugin-forbid-cmdline.rs
src/test/compile-fail-fulldeps/lint-plugin-forbid-cmdline.rs
+2
-2
src/test/compile-fail-fulldeps/macro-crate-cannot-read-embedded-ident.rs
...e-fail-fulldeps/macro-crate-cannot-read-embedded-ident.rs
+2
-2
src/test/compile-fail-fulldeps/macro-crate-doesnt-resolve.rs
src/test/compile-fail-fulldeps/macro-crate-doesnt-resolve.rs
+1
-3
src/test/compile-fail-fulldeps/macro-crate-rlib.rs
src/test/compile-fail-fulldeps/macro-crate-rlib.rs
+2
-2
src/test/compile-fail-fulldeps/macro-crate-unexported-macro.rs
...est/compile-fail-fulldeps/macro-crate-unexported-macro.rs
+1
-3
src/test/compile-fail-fulldeps/macro-crate-unknown-crate.rs
src/test/compile-fail-fulldeps/macro-crate-unknown-crate.rs
+1
-3
src/test/compile-fail-fulldeps/plugin-MacroRulesTT.rs
src/test/compile-fail-fulldeps/plugin-MacroRulesTT.rs
+2
-2
src/test/compile-fail/deprecated-phase.rs
src/test/compile-fail/deprecated-phase.rs
+3
-6
src/test/compile-fail/fail-no-dead-code-core.rs
src/test/compile-fail/fail-no-dead-code-core.rs
+1
-2
src/test/compile-fail/lint-stability.rs
src/test/compile-fail/lint-stability.rs
+2
-2
src/test/compile-fail/no-link.rs
src/test/compile-fail/no-link.rs
+7
-7
src/test/pretty/issue-4264.pp
src/test/pretty/issue-4264.pp
+1
-2
src/test/run-fail/rt-set-exit-status-panic.rs
src/test/run-fail/rt-set-exit-status-panic.rs
+1
-2
src/test/run-fail/rt-set-exit-status-panic2.rs
src/test/run-fail/rt-set-exit-status-panic2.rs
+1
-2
src/test/run-fail/rt-set-exit-status.rs
src/test/run-fail/rt-set-exit-status.rs
+1
-2
src/test/run-make/extern-diff-internal-name/test.rs
src/test/run-make/extern-diff-internal-name/test.rs
+1
-3
src/test/run-make/lto-syntax-extension/main.rs
src/test/run-make/lto-syntax-extension/main.rs
+1
-3
src/test/run-pass-fulldeps/issue_16723_multiple_items_syntax_ext.rs
...un-pass-fulldeps/issue_16723_multiple_items_syntax_ext.rs
+2
-2
src/test/run-pass-fulldeps/lint-group-plugin.rs
src/test/run-pass-fulldeps/lint-group-plugin.rs
+2
-2
src/test/run-pass-fulldeps/lint-plugin-cmdline.rs
src/test/run-pass-fulldeps/lint-plugin-cmdline.rs
+2
-2
src/test/run-pass-fulldeps/lint-plugin.rs
src/test/run-pass-fulldeps/lint-plugin.rs
+2
-2
src/test/run-pass-fulldeps/macro-crate-does-hygiene-work.rs
src/test/run-pass-fulldeps/macro-crate-does-hygiene-work.rs
+2
-2
src/test/run-pass-fulldeps/macro-crate-outlive-expansion-phase.rs
.../run-pass-fulldeps/macro-crate-outlive-expansion-phase.rs
+2
-2
src/test/run-pass-fulldeps/macro-crate.rs
src/test/run-pass-fulldeps/macro-crate.rs
+2
-2
src/test/run-pass-fulldeps/plugin-link-does-resolve.rs
src/test/run-pass-fulldeps/plugin-link-does-resolve.rs
+2
-2
src/test/run-pass-fulldeps/roman-numerals-macro.rs
src/test/run-pass-fulldeps/roman-numerals-macro.rs
+2
-2
src/test/run-pass-fulldeps/syntax-extension-with-dll-deps.rs
src/test/run-pass-fulldeps/syntax-extension-with-dll-deps.rs
+2
-2
src/test/run-pass/capturing-logging.rs
src/test/run-pass/capturing-logging.rs
+1
-3
src/test/run-pass/conditional-debug-macro-off.rs
src/test/run-pass/conditional-debug-macro-off.rs
+1
-2
src/test/run-pass/issue-14330.rs
src/test/run-pass/issue-14330.rs
+1
-3
src/test/run-pass/logging-enabled-debug.rs
src/test/run-pass/logging-enabled-debug.rs
+1
-2
src/test/run-pass/logging-enabled.rs
src/test/run-pass/logging-enabled.rs
+1
-2
src/test/run-pass/logging-separate-lines.rs
src/test/run-pass/logging-separate-lines.rs
+1
-3
src/test/run-pass/macro-crate-def-only.rs
src/test/run-pass/macro-crate-def-only.rs
+1
-3
src/test/run-pass/macro-crate-nonterminal-renamed.rs
src/test/run-pass/macro-crate-nonterminal-renamed.rs
+1
-3
src/test/run-pass/macro-crate-nonterminal.rs
src/test/run-pass/macro-crate-nonterminal.rs
+1
-3
src/test/run-pass/macro-export-inner-module.rs
src/test/run-pass/macro-export-inner-module.rs
+1
-3
src/test/run-pass/macro-reexport.rs
src/test/run-pass/macro-reexport.rs
+1
-3
src/test/run-pass/rust-log-filter.rs
src/test/run-pass/rust-log-filter.rs
+1
-2
src/test/run-pass/tcp-stress.rs
src/test/run-pass/tcp-stress.rs
+1
-2
src/test/run-pass/vec-macro-no-std.rs
src/test/run-pass/vec-macro-no-std.rs
+3
-3
未找到文件。
src/compiletest/compiletest.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/grammar/verify.rs
浏览文件 @
60be2f52
...
...
@@ -8,15 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(globs,
p
hase
,
macro_rules)]
#![feature(globs,
p
lugin
,
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
;
...
...
src/liballoc/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
...
...
src/libcollections/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/libflate/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/libgetopts/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
::
*
;
...
...
src/liblog/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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");
...
...
src/liblog/macros.rs
浏览文件 @
60be2f52
...
...
@@ -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 } }
...
...
src/librand/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
::
*
;
...
...
src/librbml/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
::
*
;
...
...
src/libregex/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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)]
...
...
src/librustc/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
...
...
src/librustc/metadata/creader.rs
浏览文件 @
60be2f52
...
...
@@ -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
{
...
...
src/librustc/plugin/load.rs
浏览文件 @
60be2f52
...
...
@@ -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
());
...
...
src/librustc/plugin/mod.rs
浏览文件 @
60be2f52
...
...
@@ -43,14 +43,14 @@
//! To use a plugin while compiling another crate:
//!
//! ```rust
//! #![feature(p
hase
)]
//! #![feature(p
lugin
)]
//!
//! #[p
hase(plugin)
]
//! #[p
lugin
]
//! 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.
...
...
src/librustc_back/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/librustc_borrowck/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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.
...
...
src/librustc_driver/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/librustc_resolve/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/librustc_trans/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/librustc_typeck/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/librustdoc/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
...
...
src/libserialize/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/libstd/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/libsyntax/feature_gate.rs
浏览文件 @
60be2f52
...
...
@@ -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
(
"p
hase
"
,
attr
.span
,
"compile
time crate loading is
\
experimental
and possibly buggy"
);
if
attr
.
check_name
(
"plugin"
)
{
self
.gate_feature
(
"p
lugin
"
,
attr
.span
,
"compile
r plugins are experimental
\
and possibly buggy"
);
}
}
}
...
...
src/libsyntax/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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
{
...
...
src/libsyntax/std_inject.rs
浏览文件 @
60be2f52
...
...
@@ -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
}
}
...
...
src/libterm/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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)]
...
...
src/libtest/lib.rs
浏览文件 @
60be2f52
...
...
@@ -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)]
...
...
src/test/auxiliary/issue-13560-3.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
src/test/auxiliary/lint_group_plugin_test.rs
浏览文件 @
60be2f52
...
...
@@ -10,12 +10,12 @@
// force-host
#![feature(p
hase,
p
lugin_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
;
...
...
src/test/auxiliary/lint_plugin_test.rs
浏览文件 @
60be2f52
...
...
@@ -10,12 +10,12 @@
// force-host
#![feature(p
hase,
p
lugin_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
;
...
...
src/test/auxiliary/logging_right_crate.rs
浏览文件 @
60be2f52
...
...
@@ -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!
()
}
...
...
src/test/auxiliary/macro_reexport_2.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
src/test/auxiliary/weak-lang-items.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/test/bench/shootout-regex-dna.rs
浏览文件 @
60be2f52
...
...
@@ -41,7 +41,7 @@
// ignore-stage1
// ignore-cross-compile #12102
#![feature(macro_rules,
p
hase
,
slicing_syntax)]
#![feature(macro_rules,
p
lugin
,
slicing_syntax)]
extern
crate
regex
;
...
...
src/test/compile-fail-fulldeps/gated-p
hase
.rs
→
src/test/compile-fail-fulldeps/gated-p
lugin
.rs
浏览文件 @
60be2f52
...
...
@@ -11,8 +11,8 @@
// aux-build:macro_crate_test.rs
// ignore-stage1
#[p
hase(plugin)
]
//~^ ERROR compile
time crate loading is
experimental and possibly buggy
#[p
lugin]
#[no_link
]
//~^ ERROR compile
r plugins are
experimental and possibly buggy
extern
crate
macro_crate_test
;
fn
main
()
{}
src/test/compile-fail-fulldeps/lint-group-plugin-deny-cmdline.rs
浏览文件 @
60be2f52
...
...
@@ -12,9 +12,9 @@
// ignore-stage1
// compile-flags: -D lint-me
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
lint_group_plugin_test
;
fn
lintme
()
{
}
//~ ERROR item is named 'lintme'
...
...
src/test/compile-fail-fulldeps/lint-plugin-deny-attr.rs
浏览文件 @
60be2f52
...
...
@@ -11,10 +11,10 @@
// aux-build:lint_plugin_test.rs
// ignore-stage1
#![feature(p
hase
)]
#![feature(p
lugin
)]
#![deny(test_lint)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
lint_plugin_test
;
fn
lintme
()
{
}
//~ ERROR item is named 'lintme'
...
...
src/test/compile-fail-fulldeps/lint-plugin-deny-cmdline.rs
浏览文件 @
60be2f52
...
...
@@ -12,9 +12,9 @@
// ignore-stage1
// compile-flags: -D test-lint
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
lint_plugin_test
;
fn
lintme
()
{
}
//~ ERROR item is named 'lintme'
...
...
src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs
浏览文件 @
60be2f52
...
...
@@ -11,10 +11,10 @@
// aux-build:lint_plugin_test.rs
// ignore-stage1
#![feature(p
hase
)]
#![feature(p
lugin
)]
#![forbid(test_lint)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
lint_plugin_test
;
fn
lintme
()
{
}
//~ ERROR item is named 'lintme'
...
...
src/test/compile-fail-fulldeps/lint-plugin-forbid-cmdline.rs
浏览文件 @
60be2f52
...
...
@@ -12,9 +12,9 @@
// ignore-stage1
// compile-flags: -F test-lint
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
lint_plugin_test
;
fn
lintme
()
{
}
//~ ERROR item is named 'lintme'
...
...
src/test/compile-fail-fulldeps/macro-crate-cannot-read-embedded-ident.rs
浏览文件 @
60be2f52
...
...
@@ -20,9 +20,9 @@
// editors, so instead he made a macro that expands into the embedded
// ident form.
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
macro_crate_test
;
fn
main
()
{
...
...
src/test/compile-fail-fulldeps/
phase-syntax
-doesnt-resolve.rs
→
src/test/compile-fail-fulldeps/
macro-crate
-doesnt-resolve.rs
浏览文件 @
60be2f52
...
...
@@ -12,9 +12,7 @@
// ignore-stage1
// ignore-android
#![feature(phase)]
#[phase(plugin)]
#[macro_use]
#[no_link]
extern
crate
macro_crate_test
;
fn
main
()
{
...
...
src/test/compile-fail-fulldeps/macro-crate-rlib.rs
浏览文件 @
60be2f52
...
...
@@ -14,8 +14,8 @@
// ignore-android
// ignore-cross-compile gives a different error message
#![feature(p
hase
)]
#[p
hase(plugin)
]
extern
crate
rlib_crate_test
;
#![feature(p
lugin
)]
#[p
lugin]
#[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
()
{}
src/test/compile-fail-fulldeps/macro-crate-unexported-macro.rs
浏览文件 @
60be2f52
...
...
@@ -12,9 +12,7 @@
// ignore-stage1
// ignore-android
#![feature(phase)]
#[phase(plugin)]
#[macro_use]
#[no_link]
extern
crate
macro_crate_test
;
fn
main
()
{
...
...
src/test/compile-fail-fulldeps/macro-crate-unknown-crate.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{}
src/test/compile-fail-fulldeps/plugin-MacroRulesTT.rs
浏览文件 @
60be2f52
...
...
@@ -13,9 +13,9 @@
// ignore-android
// error-pattern: plugin tried to register a new MacroRulesTT
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
macro_crate_MacroRulesTT
;
fn
main
()
{
}
src/test/
run-pass/phase-use-ignored
.rs
→
src/test/
compile-fail/deprecated-phase
.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{}
src/test/compile-fail/fail-no-dead-code-core.rs
浏览文件 @
60be2f52
...
...
@@ -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
...
...
src/test/compile-fail/lint-stability.rs
浏览文件 @
60be2f52
...
...
@@ -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
::
*
;
...
...
src/test/
run-pass/deprecated-phase-syntax
.rs
→
src/test/
compile-fail/no-link
.rs
浏览文件 @
60be2f52
// Copyright 201
3-2014
The Rust Project Developers. See the COPYRIGHT
// Copyright 201
5
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`
}
}
src/test/pretty/issue-4264.pp
浏览文件 @
60be2f52
#![feature(phase)]
#![no_std]
#![feature(globs)]
#[
phase(plugin, link)
]
#[
macro_use
]
extern
crate
"std"
as
std
;
#[prelude_import]
use
std::prelude::v1
::
*
;
...
...
src/test/run-fail/rt-set-exit-status-panic.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{
...
...
src/test/run-fail/rt-set-exit-status-panic2.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/test/run-fail/rt-set-exit-status.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{
...
...
src/test/run-make/extern-diff-internal-name/test.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{
...
...
src/test/run-make/lto-syntax-extension/main.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{}
src/test/run-pass-fulldeps/issue_16723_multiple_items_syntax_ext.rs
浏览文件 @
60be2f52
...
...
@@ -11,9 +11,9 @@
// ignore-stage1
// ignore-android
// aux-build:issue_16723_multiple_items_syntax_ext.rs
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
extern
crate
issue_16723_multiple_items_syntax_ext
;
#[p
lugin]
#[no_link
]
extern
crate
issue_16723_multiple_items_syntax_ext
;
multiple_items!
();
...
...
src/test/run-pass-fulldeps/lint-group-plugin.rs
浏览文件 @
60be2f52
...
...
@@ -12,9 +12,9 @@
// ignore-stage1
// ignore-pretty
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
lint_group_plugin_test
;
fn
lintme
()
{
}
//~ WARNING item is named 'lintme'
...
...
src/test/run-pass-fulldeps/lint-plugin-cmdline.rs
浏览文件 @
60be2f52
...
...
@@ -12,9 +12,9 @@
// ignore-stage1
// compile-flags: -A test-lint
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
lint_plugin_test
;
fn
lintme
()
{
}
...
...
src/test/run-pass-fulldeps/lint-plugin.rs
浏览文件 @
60be2f52
...
...
@@ -12,9 +12,9 @@
// ignore-stage1
// ignore-pretty
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
lint_plugin_test
;
fn
lintme
()
{
}
//~ WARNING item is named 'lintme'
...
...
src/test/run-pass-fulldeps/macro-crate-does-hygiene-work.rs
浏览文件 @
60be2f52
...
...
@@ -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(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
macro_crate_test
;
fn
main
()
{
...
...
src/test/run-pass-fulldeps/macro-crate-outlive-expansion-phase.rs
浏览文件 @
60be2f52
...
...
@@ -11,9 +11,9 @@
// aux-build:plugin_crate_outlive_expansion_phase.rs
// ignore-stage1
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
plugin_crate_outlive_expansion_phase
;
pub
fn
main
()
{}
src/test/run-pass-fulldeps/macro-crate.rs
浏览文件 @
60be2f52
...
...
@@ -11,9 +11,9 @@
// aux-build:macro_crate_test.rs
// ignore-stage1
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[
phase(plugin)
]
#[
macro_use]
#[plugin]
#[no_link
]
extern
crate
macro_crate_test
;
#[into_foo]
...
...
src/test/run-pass-fulldeps/p
hase-syntax
-link-does-resolve.rs
→
src/test/run-pass-fulldeps/p
lugin
-link-does-resolve.rs
浏览文件 @
60be2f52
...
...
@@ -15,9 +15,9 @@
// macro_crate_test will not compile on a cross-compiled target because
// libsyntax is not compiled for it.
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin,
link)
]
#[p
lugin
]
extern
crate
macro_crate_test
;
fn
main
()
{
...
...
src/test/run-pass-fulldeps/roman-numerals-macro.rs
浏览文件 @
60be2f52
...
...
@@ -11,9 +11,9 @@
// aux-build:roman_numerals.rs
// ignore-stage1
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
roman_numerals
;
pub
fn
main
()
{
...
...
src/test/run-pass-fulldeps/syntax-extension-with-dll-deps.rs
浏览文件 @
60be2f52
...
...
@@ -12,9 +12,9 @@
// aux-build:syntax-extension-with-dll-deps-2.rs
// ignore-stage1
#![feature(p
hase
)]
#![feature(p
lugin
)]
#[p
hase(plugin)
]
#[p
lugin]
#[no_link
]
extern
crate
"syntax-extension-with-dll-deps-2"
as
extension
;
fn
main
()
{
...
...
src/test/run-pass/capturing-logging.rs
浏览文件 @
60be2f52
...
...
@@ -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
};
...
...
src/test/run-pass/conditional-debug-macro-off.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{
...
...
src/test/run-pass/issue-14330.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{}
src/test/run-pass/logging-enabled-debug.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{
...
...
src/test/run-pass/logging-enabled.rs
浏览文件 @
60be2f52
...
...
@@ -10,8 +10,7 @@
// exec-env:RUST_LOG=logging-enabled=info
#![feature(phase)]
#[phase(plugin,
link)]
#[macro_use]
extern
crate
log
;
pub
fn
main
()
{
...
...
src/test/run-pass/logging-separate-lines.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/test/run-pass/macro-crate-def-only.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{
...
...
src/test/run-pass/macro-crate-nonterminal-renamed.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{
...
...
src/test/run-pass/macro-crate-nonterminal.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{
...
...
src/test/run-pass/macro-export-inner-module.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{
...
...
src/test/run-pass/macro-reexport.rs
浏览文件 @
60be2f52
...
...
@@ -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
()
{
...
...
src/test/run-pass/rust-log-filter.rs
浏览文件 @
60be2f52
...
...
@@ -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
};
...
...
src/test/run-pass/tcp-stress.rs
浏览文件 @
60be2f52
...
...
@@ -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
;
...
...
src/test/run-pass/vec-macro-no-std.rs
浏览文件 @
60be2f52
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录