Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
fa23d108
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,发现更多精彩内容 >>
提交
fa23d108
编写于
4月 09, 2016
作者:
L
Leo Testard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove some useless code.
上级
03ab057f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
37 deletion
+15
-37
src/libsyntax/ext/expand.rs
src/libsyntax/ext/expand.rs
+6
-4
src/libsyntax/feature_gate.rs
src/libsyntax/feature_gate.rs
+9
-33
未找到文件。
src/libsyntax/ext/expand.rs
浏览文件 @
fa23d108
...
...
@@ -83,10 +83,12 @@ pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> {
ast
::
ExprKind
::
InPlace
(
placer
,
value_expr
)
=>
{
// Ensure feature-gate is enabled
feature_gate
::
check_for_placement_in
(
fld
.cx.ecfg.features
,
&
fld
.cx.parse_sess.span_diagnostic
,
expr_span
);
if
!
fld
.cx.ecfg.features
.unwrap
()
.placement_in_syntax
{
feature_gate
::
emit_feature_err
(
&
fld
.cx.parse_sess.span_diagnostic
,
"placement_in_syntax"
,
expr_span
,
feature_gate
::
GateIssue
::
Language
,
feature_gate
::
EXPLAIN_PLACEMENT_IN
);
}
let
placer
=
fld
.fold_expr
(
placer
);
let
value_expr
=
fld
.fold_expr
(
value_expr
);
...
...
src/libsyntax/feature_gate.rs
浏览文件 @
fa23d108
...
...
@@ -654,39 +654,6 @@ fn check_and_emit(&self,
}
}
const
EXPLAIN_BOX_SYNTAX
:
&
'static
str
=
"box expression syntax is experimental; you can call `Box::new` instead."
;
const
EXPLAIN_PLACEMENT_IN
:
&
'static
str
=
"placement-in expression syntax is experimental and subject to change."
;
const
EXPLAIN_PUSHPOP_UNSAFE
:
&
'static
str
=
"push/pop_unsafe macros are experimental and subject to change."
;
const
EXPLAIN_STMT_ATTR_SYNTAX
:
&
'static
str
=
"attributes on non-item statements and expressions are experimental."
;
pub
fn
check_for_box_syntax
(
f
:
Option
<&
Features
>
,
diag
:
&
Handler
,
span
:
Span
)
{
if
let
Some
(
&
Features
{
box_syntax
:
true
,
..
})
=
f
{
return
;
}
emit_feature_err
(
diag
,
"box_syntax"
,
span
,
GateIssue
::
Language
,
EXPLAIN_BOX_SYNTAX
);
}
pub
fn
check_for_placement_in
(
f
:
Option
<&
Features
>
,
diag
:
&
Handler
,
span
:
Span
)
{
if
let
Some
(
&
Features
{
placement_in_syntax
:
true
,
..
})
=
f
{
return
;
}
emit_feature_err
(
diag
,
"placement_in_syntax"
,
span
,
GateIssue
::
Language
,
EXPLAIN_PLACEMENT_IN
);
}
pub
fn
check_for_pushpop_syntax
(
f
:
Option
<&
Features
>
,
diag
:
&
Handler
,
span
:
Span
)
{
if
let
Some
(
&
Features
{
pushpop_unsafe
:
true
,
..
})
=
f
{
return
;
}
emit_feature_err
(
diag
,
"pushpop_unsafe"
,
span
,
GateIssue
::
Language
,
EXPLAIN_PUSHPOP_UNSAFE
);
}
struct
Context
<
'a
>
{
features
:
&
'a
Features
,
span_handler
:
&
'a
Handler
,
...
...
@@ -809,6 +776,12 @@ pub fn emit_feature_err(diag: &Handler, feature: &str, span: Span, issue: GateIs
err
.emit
();
}
const
EXPLAIN_BOX_SYNTAX
:
&
'static
str
=
"box expression syntax is experimental; you can call `Box::new` instead."
;
const
EXPLAIN_STMT_ATTR_SYNTAX
:
&
'static
str
=
"attributes on non-item statements and expressions are experimental."
;
pub
const
EXPLAIN_ASM
:
&
'static
str
=
"inline assembly is not stable enough for use and is subject to change"
;
...
...
@@ -829,6 +802,9 @@ pub fn emit_feature_err(diag: &Handler, feature: &str, span: Span, issue: GateIs
pub
const
EXPLAIN_DERIVE_UNDERSCORE
:
&
'static
str
=
"attributes of the form `#[derive_*]` are reserved for the compiler"
;
pub
const
EXPLAIN_PLACEMENT_IN
:
&
'static
str
=
"placement-in expression syntax is experimental and subject to change."
;
struct
PostExpansionVisitor
<
'a
>
{
context
:
&
'a
Context
<
'a
>
,
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录