Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
ae10b23a
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,发现更多精彩内容 >>
提交
ae10b23a
编写于
8月 23, 2017
作者:
R
Ralf Jung
提交者:
GitHub
8月 23, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into mir-validate
上级
1f20b7d7
66108be9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
41 deletion
+12
-41
src/librustc_mir/interpret/eval_context.rs
src/librustc_mir/interpret/eval_context.rs
+6
-0
src/librustc_mir/interpret/terminator/mod.rs
src/librustc_mir/interpret/terminator/mod.rs
+5
-41
xargo/build.sh
xargo/build.sh
+1
-0
未找到文件。
src/librustc_mir/interpret/eval_context.rs
浏览文件 @
ae10b23a
...
...
@@ -2270,6 +2270,12 @@ fn resolve_associated_item<'a, 'tcx>(
substs
:
rcvr_substs
,
}
}
::
rustc
::
traits
::
VtableBuiltin
(
..
)
if
Some
(
trait_id
)
==
tcx
.lang_items
.clone_trait
()
=>
{
ty
::
Instance
{
def
:
ty
::
InstanceDef
::
CloneShim
(
def_id
,
trait_ref
.self_ty
()),
substs
:
rcvr_substs
}
}
_
=>
bug!
(
"static call to invalid vtable: {:?}"
,
vtbl
),
}
}
...
...
src/librustc_mir/interpret/terminator/mod.rs
浏览文件 @
ae10b23a
...
...
@@ -256,6 +256,7 @@ fn eval_fn_call(
self
.dump_local
(
ret
);
Ok
(())
}
// FIXME: figure out why we can't just go through the shim
ty
::
InstanceDef
::
ClosureOnceShim
{
..
}
=>
{
let
mut
args
=
Vec
::
new
();
for
arg
in
arg_operands
{
...
...
@@ -297,6 +298,9 @@ fn eval_fn_call(
}
Ok
(())
}
ty
::
InstanceDef
::
FnPtrShim
(
..
)
|
ty
::
InstanceDef
::
DropGlue
(
..
)
|
ty
::
InstanceDef
::
CloneShim
(
..
)
|
ty
::
InstanceDef
::
Item
(
_
)
=>
{
let
mut
args
=
Vec
::
new
();
for
arg
in
arg_operands
{
...
...
@@ -394,47 +398,7 @@ fn eval_fn_call(
}
Ok
(())
}
ty
::
InstanceDef
::
DropGlue
(
..
)
=>
{
assert_eq!
(
arg_operands
.len
(),
1
);
assert_eq!
(
sig
.abi
,
Abi
::
Rust
);
let
val
=
self
.eval_operand
(
&
arg_operands
[
0
])
?
;
let
ty
=
self
.operand_ty
(
&
arg_operands
[
0
]);
let
(
_
,
target
)
=
destination
.expect
(
"diverging drop glue"
);
self
.goto_block
(
target
);
// FIXME: deduplicate these matches
let
pointee_type
=
match
ty
.sty
{
ty
::
TyRawPtr
(
ref
tam
)
|
ty
::
TyRef
(
_
,
ref
tam
)
=>
tam
.ty
,
ty
::
TyAdt
(
def
,
_
)
if
def
.is_box
()
=>
ty
.boxed_ty
(),
_
=>
bug!
(
"can only deref pointer types"
),
};
self
.drop
(
val
,
instance
,
pointee_type
,
span
)
}
ty
::
InstanceDef
::
FnPtrShim
(
..
)
=>
{
trace!
(
"ABI: {}"
,
sig
.abi
);
let
mut
args
=
Vec
::
new
();
for
arg
in
arg_operands
{
let
arg_val
=
self
.eval_operand
(
arg
)
?
;
let
arg_ty
=
self
.operand_ty
(
arg
);
args
.push
((
arg_val
,
arg_ty
));
}
if
M
::
eval_fn_call
(
self
,
instance
,
destination
,
arg_operands
,
span
,
sig
)
?
{
return
Ok
(());
}
let
arg_locals
=
self
.frame
()
.mir
.args_iter
();
match
sig
.abi
{
Abi
::
Rust
=>
{
args
.remove
(
0
);
}
Abi
::
RustCall
=>
{}
_
=>
unimplemented!
(),
};
for
(
arg_local
,
(
arg_val
,
arg_ty
))
in
arg_locals
.zip
(
args
)
{
let
dest
=
self
.eval_lvalue
(
&
mir
::
Lvalue
::
Local
(
arg_local
))
?
;
self
.write_value
(
arg_val
,
dest
,
arg_ty
)
?
;
}
Ok
(())
}
// cannot use the shim here, because that will only result in infinite recursion
ty
::
InstanceDef
::
Virtual
(
_
,
idx
)
=>
{
let
ptr_size
=
self
.memory
.pointer_size
();
let
(
_
,
vtable
)
=
self
.eval_operand
(
&
arg_operands
[
0
])
?
.into_ptr_vtable_pair
(
...
...
xargo/build.sh
浏览文件 @
ae10b23a
#!/bin/sh
cd
"
$(
dirname
"
$0
"
)
"
sed
's/gcc = "0\.3\.50"/gcc = "=0\.3\.50"/'
-i
~/.rustup/toolchains/
*
/lib/rustlib/src/rust/src/libstd/Cargo.toml
RUSTFLAGS
=
'-Zalways-encode-mir -Zmir-emit-validate=1'
xargo build
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录