Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
b64572ce
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,发现更多精彩内容 >>
提交
b64572ce
编写于
2月 04, 2015
作者:
M
Manish Goregaokar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add unmarked_api feature (fixes #21884)
上级
4aa661ab
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
4 deletion
+19
-4
src/librustc/middle/stability.rs
src/librustc/middle/stability.rs
+13
-4
src/libsyntax/feature_gate.rs
src/libsyntax/feature_gate.rs
+6
-0
未找到文件。
src/librustc/middle/stability.rs
浏览文件 @
b64572ce
...
...
@@ -253,10 +253,19 @@ fn check(&mut self, id: ast::DefId, span: Span, stab: &Option<Stability>) {
None
=>
{
// This is an 'unmarked' API, which should not exist
// in the standard library.
self
.tcx.sess
.span_err
(
span
,
"use of unmarked library feature"
);
self
.tcx.sess
.span_note
(
span
,
"this is either a bug in the library you are
\
using or a bug in the compiler - there is
\
no way to use this feature"
);
if
self
.tcx.sess.features
.borrow
()
.unmarked_api
{
self
.tcx.sess
.span_warn
(
span
,
"use of unmarked library feature"
);
self
.tcx.sess
.span_note
(
span
,
"this is either a bug in the library you are
\
using and a bug in the compiler - please
\
report it in both places"
);
}
else
{
self
.tcx.sess
.span_err
(
span
,
"use of unmarked library feature"
);
self
.tcx.sess
.span_note
(
span
,
"this is either a bug in the library you are
\
using and a bug in the compiler - please
\
report it in both places"
);
self
.tcx.sess
.span_note
(
span
,
"use #![feature(unmarked_api)] in the
\
crate attributes to override this"
);
}
}
}
}
...
...
src/libsyntax/feature_gate.rs
浏览文件 @
b64572ce
...
...
@@ -119,6 +119,9 @@
// Allows use of #[staged_api]
(
"staged_api"
,
"1.0.0"
,
Active
),
// Allows using items which are missing stability attributes
(
"unmarked_api"
,
"1.0.0"
,
Active
)
];
enum
Status
{
...
...
@@ -145,6 +148,7 @@ pub struct Features {
pub
quote
:
bool
,
pub
old_orphan_check
:
bool
,
pub
simd_ffi
:
bool
,
pub
unmarked_api
:
bool
,
pub
lib_features
:
Vec
<
(
InternedString
,
Span
)
>
}
...
...
@@ -157,6 +161,7 @@ pub fn new() -> Features {
quote
:
false
,
old_orphan_check
:
false
,
simd_ffi
:
false
,
unmarked_api
:
false
,
lib_features
:
Vec
::
new
()
}
}
...
...
@@ -566,6 +571,7 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::C
quote
:
cx
.has_feature
(
"quote"
),
old_orphan_check
:
cx
.has_feature
(
"old_orphan_check"
),
simd_ffi
:
cx
.has_feature
(
"simd_ffi"
),
unmarked_api
:
cx
.has_feature
(
"unmarked_api"
),
lib_features
:
unknown_features
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录