Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
c7860913
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,发现更多精彩内容 >>
提交
c7860913
编写于
1月 15, 2016
作者:
F
Florian Hahn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MIR] use mir::repr::Constant in ExprKind::Repeat, close #29789
上级
9ae76b36
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
5 addition
and
13 deletion
+5
-13
src/librustc_mir/build/expr/as_rvalue.rs
src/librustc_mir/build/expr/as_rvalue.rs
+0
-1
src/librustc_mir/hair/cx/expr.rs
src/librustc_mir/hair/cx/expr.rs
+3
-6
src/librustc_mir/hair/mod.rs
src/librustc_mir/hair/mod.rs
+2
-6
未找到文件。
src/librustc_mir/build/expr/as_rvalue.rs
浏览文件 @
c7860913
...
...
@@ -44,7 +44,6 @@ fn expr_as_rvalue(&mut self,
}
ExprKind
::
Repeat
{
value
,
count
}
=>
{
let
value_operand
=
unpack!
(
block
=
this
.as_operand
(
block
,
value
));
let
count
=
this
.as_constant
(
count
);
block
.and
(
Rvalue
::
Repeat
(
value_operand
,
count
))
}
ExprKind
::
Borrow
{
region
,
borrow_kind
,
arg
}
=>
{
...
...
src/librustc_mir/hair/cx/expr.rs
浏览文件 @
c7860913
...
...
@@ -325,14 +325,11 @@ fn make_mirror<'a>(self, cx: &mut Cx<'a, 'tcx>) -> Expr<'tcx> {
hir
::
ExprRepeat
(
ref
v
,
ref
c
)
=>
ExprKind
::
Repeat
{
value
:
v
.to_ref
(),
count
:
Expr
{
count
:
Constant
{
ty
:
cx
.tcx
.expr_ty
(
c
),
temp_lifetime
:
None
,
span
:
c
.span
,
kind
:
ExprKind
::
Literal
{
literal
:
cx
.const_eval_literal
(
c
)
}
}
.to_ref
()
},
hir
::
ExprRet
(
ref
v
)
=>
ExprKind
::
Return
{
value
:
v
.to_ref
()
},
...
...
src/librustc_mir/hair/mod.rs
浏览文件 @
c7860913
...
...
@@ -14,7 +14,7 @@
//! unit-tested and separated from the Rust source and compiler data
//! structures.
use
rustc
::
mir
::
repr
::{
BinOp
,
BorrowKind
,
Field
,
Literal
,
Mutability
,
UnOp
,
ItemKind
};
use
rustc
::
mir
::
repr
::{
Constant
,
BinOp
,
BorrowKind
,
Field
,
Literal
,
Mutability
,
UnOp
,
ItemKind
};
use
rustc
::
middle
::
const_eval
::
ConstVal
;
use
rustc
::
middle
::
def_id
::
DefId
;
use
rustc
::
middle
::
region
::
CodeExtent
;
...
...
@@ -213,10 +213,7 @@ pub enum ExprKind<'tcx> {
},
Repeat
{
value
:
ExprRef
<
'tcx
>
,
// FIXME(#29789): Add a separate hair::Constant<'tcx> so this could be more explicit about
// its contained data. Currently this should only contain expression of ExprKind::Literal
// kind.
count
:
ExprRef
<
'tcx
>
,
count
:
Constant
<
'tcx
>
,
},
Vec
{
fields
:
Vec
<
ExprRef
<
'tcx
>>
,
...
...
@@ -341,7 +338,6 @@ pub struct FieldPattern<'tcx> {
pub
field
:
Field
,
pub
pattern
:
Pattern
<
'tcx
>
,
}
///////////////////////////////////////////////////////////////////////////
// The Mirror trait
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录