Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
5127d24a
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
5127d24a
编写于
11月 24, 2015
作者:
V
Vadim Petrochenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove `#[staged_api]`
上级
1b9a13e6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
18 addition
and
37 deletion
+18
-37
src/doc/reference.md
src/doc/reference.md
+0
-4
src/librustc/metadata/creader.rs
src/librustc/metadata/creader.rs
+11
-4
src/librustc/middle/stability.rs
src/librustc/middle/stability.rs
+2
-12
src/librustc_driver/driver.rs
src/librustc_driver/driver.rs
+1
-1
src/librustc_driver/test.rs
src/librustc_driver/test.rs
+1
-1
src/libsyntax/feature_gate.rs
src/libsyntax/feature_gate.rs
+3
-2
src/test/compile-fail/staged_api.rs
src/test/compile-fail/staged_api.rs
+0
-13
未找到文件。
src/doc/reference.md
浏览文件 @
5127d24a
...
...
@@ -2325,10 +2325,6 @@ The currently implemented features of the reference compiler are:
* `simd_ffi` - Allows use of SIMD vectors in signatures for foreign functions.
The SIMD interface is subject to change.
* `staged_api` - Allows usage of stability markers and `#![staged_api]` in a
crate. Stability markers are also attributes: `#[stable]`,
`#[unstable]`, and `#[rustc_deprecated]` are the three levels.
* `start` - Allows use of the `#[start]` attribute, which changes the entry point
into a Rust program. This capability, especially the signature for the
annotated function, is subject to change.
...
...
src/librustc/metadata/creader.rs
浏览文件 @
5127d24a
...
...
@@ -350,12 +350,19 @@ fn register_crate(&mut self,
fn
is_staged_api
(
&
self
,
data
:
&
[
u8
])
->
bool
{
let
attrs
=
decoder
::
get_crate_attributes
(
data
);
for
attr
in
&
attrs
{
if
&
attr
.name
()[
..
]
==
"staged_api"
{
match
attr
.node.value.node
{
ast
::
MetaWord
(
_
)
=>
return
true
,
_
=>
(
/*pass*/
)
}
if
attr
.name
()
==
"feature"
{
if
let
Some
(
metas
)
=
attr
.meta_item_list
()
{
for
meta
in
metas
{
if
let
ast
::
MetaWord
(
ref
name
)
=
meta
.node
{
if
&
name
[
..
]
==
"staged_api"
{
return
true
}
}
}
}
}
}
return
false
;
false
}
fn
resolve_crate
(
&
mut
self
,
...
...
src/librustc/middle/stability.rs
浏览文件 @
5127d24a
...
...
@@ -279,19 +279,9 @@ pub fn build(&mut self, tcx: &ty::ctxt<'tcx>, krate: &Crate, access_levels: &Acc
|
v
|
intravisit
::
walk_crate
(
v
,
krate
));
}
pub
fn
new
(
krate
:
&
Crate
)
->
Index
{
let
mut
is_staged_api
=
false
;
for
attr
in
&
krate
.attrs
{
if
attr
.name
()
==
"staged_api"
{
if
let
ast
::
MetaWord
(
_
)
=
attr
.node.value.node
{
attr
::
mark_used
(
attr
);
is_staged_api
=
true
;
break
}
}
}
pub
fn
new
(
sess
:
&
Session
)
->
Index
<
'tcx
>
{
let
mut
staged_api
=
FnvHashMap
();
staged_api
.insert
(
LOCAL_CRATE
,
is_
staged_api
);
staged_api
.insert
(
LOCAL_CRATE
,
sess
.features
.borrow
()
.
staged_api
);
Index
{
staged_api
:
staged_api
,
map
:
DefIdMap
(),
...
...
src/librustc_driver/driver.rs
浏览文件 @
5127d24a
...
...
@@ -738,7 +738,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
freevars
,
region_map
,
lang_items
,
stability
::
Index
::
new
(
krate
),
stability
::
Index
::
new
(
sess
),
|
tcx
|
{
// passes are timed inside typeck
typeck
::
check_crate
(
tcx
,
trait_map
);
...
...
src/librustc_driver/test.rs
浏览文件 @
5127d24a
...
...
@@ -136,7 +136,7 @@ fn test_env<F>(source_string: &str,
freevars
,
region_map
,
lang_items
,
stability
::
Index
::
new
(
krate
),
stability
::
Index
::
new
(
&
sess
),
|
tcx
|
{
let
infcx
=
infer
::
new_infer_ctxt
(
tcx
,
&
tcx
.tables
,
None
,
false
);
body
(
Env
{
infcx
:
&
infcx
});
...
...
src/libsyntax/feature_gate.rs
浏览文件 @
5127d24a
...
...
@@ -277,8 +277,6 @@ enum Status {
// Not used any more, but we can't feature gate it
(
"no_stack_check"
,
Normal
,
Ungated
),
(
"staged_api"
,
CrateLevel
,
Gated
(
"staged_api"
,
"staged_api is for use by rustc only"
)),
(
"plugin"
,
CrateLevel
,
Gated
(
"plugin"
,
"compiler plugins are experimental
\
and possibly buggy"
)),
...
...
@@ -501,6 +499,7 @@ pub struct Features {
pub
cfg_target_vendor
:
bool
,
pub
augmented_assignments
:
bool
,
pub
braced_empty_structs
:
bool
,
pub
staged_api
:
bool
,
}
impl
Features
{
...
...
@@ -532,6 +531,7 @@ pub fn new() -> Features {
cfg_target_vendor
:
false
,
augmented_assignments
:
false
,
braced_empty_structs
:
false
,
staged_api
:
false
,
}
}
}
...
...
@@ -1104,6 +1104,7 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &SpanHandler,
cfg_target_vendor
:
cx
.has_feature
(
"cfg_target_vendor"
),
augmented_assignments
:
cx
.has_feature
(
"augmented_assignments"
),
braced_empty_structs
:
cx
.has_feature
(
"braced_empty_structs"
),
staged_api
:
cx
.has_feature
(
"staged_api"
),
}
}
...
...
src/test/compile-fail/staged_api.rs
已删除
100644 → 0
浏览文件 @
1b9a13e6
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![staged_api]
//~ ERROR staged_api is for use by rustc only
fn
main
()
{
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录