Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
ba8b9324
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,发现更多精彩内容 >>
提交
ba8b9324
编写于
5月 21, 2016
作者:
J
Jeffrey Seyfried
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move `placement_in_syntax` gated feature checking from expansion to the post-expansion visitor
上级
82b49cd2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
3 addition
and
16 deletion
+3
-16
src/libsyntax/ext/expand.rs
src/libsyntax/ext/expand.rs
+0
-16
src/libsyntax/feature_gate.rs
src/libsyntax/feature_gate.rs
+3
-0
未找到文件。
src/libsyntax/ext/expand.rs
浏览文件 @
ba8b9324
...
...
@@ -70,7 +70,6 @@ fn dummy($span: Span) -> Self { $dummy }
}
pub
fn
expand_expr
(
e
:
P
<
ast
::
Expr
>
,
fld
:
&
mut
MacroExpander
)
->
P
<
ast
::
Expr
>
{
let
expr_span
=
e
.span
;
return
e
.and_then
(|
ast
::
Expr
{
id
,
node
,
span
,
attrs
}|
match
node
{
// expr_mac should really be expr_ext or something; it's the
...
...
@@ -79,21 +78,6 @@ pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> {
expand_mac_invoc
(
mac
,
None
,
attrs
.into_attr_vec
(),
span
,
fld
)
}
ast
::
ExprKind
::
InPlace
(
placer
,
value_expr
)
=>
{
// Ensure feature-gate is enabled
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
);
fld
.cx
.expr
(
span
,
ast
::
ExprKind
::
InPlace
(
placer
,
value_expr
))
.with_attrs
(
fold_thin_attrs
(
attrs
,
fld
))
}
ast
::
ExprKind
::
While
(
cond
,
body
,
opt_ident
)
=>
{
let
cond
=
fld
.fold_expr
(
cond
);
let
(
body
,
opt_ident
)
=
expand_loop_block
(
body
,
opt_ident
,
fld
);
...
...
src/libsyntax/feature_gate.rs
浏览文件 @
ba8b9324
...
...
@@ -997,6 +997,9 @@ fn visit_expr(&mut self, e: &ast::Expr) {
ast
::
ExprKind
::
Try
(
..
)
=>
{
gate_feature_post!
(
&
self
,
question_mark
,
e
.span
,
"the `?` operator is not stable"
);
}
ast
::
ExprKind
::
InPlace
(
..
)
=>
{
gate_feature_post!
(
&
self
,
placement_in_syntax
,
e
.span
,
EXPLAIN_PLACEMENT_IN
);
}
_
=>
{}
}
visit
::
walk_expr
(
self
,
e
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录