Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
2984670c
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
2984670c
编写于
8月 02, 2023
作者:
R
Ralf Jung
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avoid 'miri' when refering to the shared interpreter
上级
828bdc2c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
13 addition
and
12 deletion
+13
-12
compiler/rustc_const_eval/src/interpret/intrinsics.rs
compiler/rustc_const_eval/src/interpret/intrinsics.rs
+1
-1
compiler/rustc_const_eval/src/interpret/memory.rs
compiler/rustc_const_eval/src/interpret/memory.rs
+1
-1
compiler/rustc_middle/src/mir/interpret/error.rs
compiler/rustc_middle/src/mir/interpret/error.rs
+1
-1
compiler/rustc_middle/src/mir/interpret/mod.rs
compiler/rustc_middle/src/mir/interpret/mod.rs
+1
-1
compiler/rustc_monomorphize/src/collector.rs
compiler/rustc_monomorphize/src/collector.rs
+7
-7
compiler/rustc_symbol_mangling/src/v0.rs
compiler/rustc_symbol_mangling/src/v0.rs
+2
-1
未找到文件。
compiler/rustc_const_eval/src/interpret/intrinsics.rs
浏览文件 @
2984670c
//! Intrinsics and other functions that the
miri engine
executes without
//! Intrinsics and other functions that the
interpreter
executes without
//! looking at their MIR. Intrinsics/functions supported here are shared by CTFE
//! looking at their MIR. Intrinsics/functions supported here are shared by CTFE
//! and miri.
//! and miri.
...
...
compiler/rustc_const_eval/src/interpret/memory.rs
浏览文件 @
2984670c
...
@@ -91,7 +91,7 @@ pub fn as_instance(self) -> InterpResult<'tcx, Instance<'tcx>> {
...
@@ -91,7 +91,7 @@ pub fn as_instance(self) -> InterpResult<'tcx, Instance<'tcx>> {
// `Memory` has to depend on the `Machine` because some of its operations
// `Memory` has to depend on the `Machine` because some of its operations
// (e.g., `get`) call a `Machine` hook.
// (e.g., `get`) call a `Machine` hook.
pub
struct
Memory
<
'mir
,
'tcx
,
M
:
Machine
<
'mir
,
'tcx
>>
{
pub
struct
Memory
<
'mir
,
'tcx
,
M
:
Machine
<
'mir
,
'tcx
>>
{
/// Allocations local to this instance of the
miri engine
. The kind
/// Allocations local to this instance of the
interpreter
. The kind
/// helps ensure that the same mechanism is used for allocation and
/// helps ensure that the same mechanism is used for allocation and
/// deallocation. When an allocation is not found here, it is a
/// deallocation. When an allocation is not found here, it is a
/// global and looked up in the `tcx` for read access. Some machines may
/// global and looked up in the `tcx` for read access. Some machines may
...
...
compiler/rustc_middle/src/mir/interpret/error.rs
浏览文件 @
2984670c
...
@@ -155,7 +155,7 @@ pub fn kind(&self) -> &InterpError<'tcx> {
...
@@ -155,7 +155,7 @@ pub fn kind(&self) -> &InterpError<'tcx> {
}
}
fn
print_backtrace
(
backtrace
:
&
Backtrace
)
{
fn
print_backtrace
(
backtrace
:
&
Backtrace
)
{
eprintln!
(
"
\n\n
An error occurred in
miri
:
\n
{backtrace}"
);
eprintln!
(
"
\n\n
An error occurred in
the MIR interpreter
:
\n
{backtrace}"
);
}
}
impl
From
<
ErrorGuaranteed
>
for
InterpErrorInfo
<
'_
>
{
impl
From
<
ErrorGuaranteed
>
for
InterpErrorInfo
<
'_
>
{
...
...
compiler/rustc_middle/src/mir/interpret/mod.rs
浏览文件 @
2984670c
...
@@ -609,7 +609,7 @@ pub fn try_get_global_alloc(self, id: AllocId) -> Option<GlobalAlloc<'tcx>> {
...
@@ -609,7 +609,7 @@ pub fn try_get_global_alloc(self, id: AllocId) -> Option<GlobalAlloc<'tcx>> {
/// Panics in case the `AllocId` is dangling. Since that is impossible for `AllocId`s in
/// Panics in case the `AllocId` is dangling. Since that is impossible for `AllocId`s in
/// constants (as all constants must pass interning and validation that check for dangling
/// constants (as all constants must pass interning and validation that check for dangling
/// ids), this function is frequently used throughout rustc, but should not be used within
/// ids), this function is frequently used throughout rustc, but should not be used within
/// the
miri engine
.
/// the
interpreter
.
pub
fn
global_alloc
(
self
,
id
:
AllocId
)
->
GlobalAlloc
<
'tcx
>
{
pub
fn
global_alloc
(
self
,
id
:
AllocId
)
->
GlobalAlloc
<
'tcx
>
{
match
self
.try_get_global_alloc
(
id
)
{
match
self
.try_get_global_alloc
(
id
)
{
Some
(
alloc
)
=>
alloc
,
Some
(
alloc
)
=>
alloc
,
...
...
compiler/rustc_monomorphize/src/collector.rs
浏览文件 @
2984670c
...
@@ -384,7 +384,7 @@ fn collect_items_rec<'tcx>(
...
@@ -384,7 +384,7 @@ fn collect_items_rec<'tcx>(
if
let
Ok
(
alloc
)
=
tcx
.eval_static_initializer
(
def_id
)
{
if
let
Ok
(
alloc
)
=
tcx
.eval_static_initializer
(
def_id
)
{
for
&
id
in
alloc
.inner
()
.provenance
()
.ptrs
()
.values
()
{
for
&
id
in
alloc
.inner
()
.provenance
()
.ptrs
()
.values
()
{
collect_
miri
(
tcx
,
id
,
&
mut
used_items
);
collect_
alloc
(
tcx
,
id
,
&
mut
used_items
);
}
}
}
}
...
@@ -1331,8 +1331,8 @@ fn create_mono_items_for_default_impls<'tcx>(
...
@@ -1331,8 +1331,8 @@ fn create_mono_items_for_default_impls<'tcx>(
}
}
}
}
/// Scans the
miri
alloc in order to find function calls, closures, and drop-glue.
/// Scans the
CTFE
alloc in order to find function calls, closures, and drop-glue.
fn
collect_
miri
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
alloc_id
:
AllocId
,
output
:
&
mut
MonoItems
<
'tcx
>
)
{
fn
collect_
alloc
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
alloc_id
:
AllocId
,
output
:
&
mut
MonoItems
<
'tcx
>
)
{
match
tcx
.global_alloc
(
alloc_id
)
{
match
tcx
.global_alloc
(
alloc_id
)
{
GlobalAlloc
::
Static
(
def_id
)
=>
{
GlobalAlloc
::
Static
(
def_id
)
=>
{
assert
!
(
!
tcx
.is_thread_local_static
(
def_id
));
assert
!
(
!
tcx
.is_thread_local_static
(
def_id
));
...
@@ -1346,7 +1346,7 @@ fn collect_miri<'tcx>(tcx: TyCtxt<'tcx>, alloc_id: AllocId, output: &mut MonoIte
...
@@ -1346,7 +1346,7 @@ fn collect_miri<'tcx>(tcx: TyCtxt<'tcx>, alloc_id: AllocId, output: &mut MonoIte
trace!
(
"collecting {:?} with {:#?}"
,
alloc_id
,
alloc
);
trace!
(
"collecting {:?} with {:#?}"
,
alloc_id
,
alloc
);
for
&
inner
in
alloc
.inner
()
.provenance
()
.ptrs
()
.values
()
{
for
&
inner
in
alloc
.inner
()
.provenance
()
.ptrs
()
.values
()
{
rustc_data_structures
::
stack
::
ensure_sufficient_stack
(||
{
rustc_data_structures
::
stack
::
ensure_sufficient_stack
(||
{
collect_
miri
(
tcx
,
inner
,
output
);
collect_
alloc
(
tcx
,
inner
,
output
);
});
});
}
}
}
}
...
@@ -1358,7 +1358,7 @@ fn collect_miri<'tcx>(tcx: TyCtxt<'tcx>, alloc_id: AllocId, output: &mut MonoIte
...
@@ -1358,7 +1358,7 @@ fn collect_miri<'tcx>(tcx: TyCtxt<'tcx>, alloc_id: AllocId, output: &mut MonoIte
}
}
GlobalAlloc
::
VTable
(
ty
,
trait_ref
)
=>
{
GlobalAlloc
::
VTable
(
ty
,
trait_ref
)
=>
{
let
alloc_id
=
tcx
.vtable_allocation
((
ty
,
trait_ref
));
let
alloc_id
=
tcx
.vtable_allocation
((
ty
,
trait_ref
));
collect_
miri
(
tcx
,
alloc_id
,
output
)
collect_
alloc
(
tcx
,
alloc_id
,
output
)
}
}
}
}
}
}
...
@@ -1381,10 +1381,10 @@ fn collect_const_value<'tcx>(
...
@@ -1381,10 +1381,10 @@ fn collect_const_value<'tcx>(
output
:
&
mut
MonoItems
<
'tcx
>
,
output
:
&
mut
MonoItems
<
'tcx
>
,
)
{
)
{
match
value
{
match
value
{
ConstValue
::
Scalar
(
Scalar
::
Ptr
(
ptr
,
_
size
))
=>
collect_
miri
(
tcx
,
ptr
.provenance
,
output
),
ConstValue
::
Scalar
(
Scalar
::
Ptr
(
ptr
,
_
size
))
=>
collect_
alloc
(
tcx
,
ptr
.provenance
,
output
),
ConstValue
::
Slice
{
data
:
alloc
,
start
:
_
,
end
:
_
}
|
ConstValue
::
ByRef
{
alloc
,
..
}
=>
{
ConstValue
::
Slice
{
data
:
alloc
,
start
:
_
,
end
:
_
}
|
ConstValue
::
ByRef
{
alloc
,
..
}
=>
{
for
&
id
in
alloc
.inner
()
.provenance
()
.ptrs
()
.values
()
{
for
&
id
in
alloc
.inner
()
.provenance
()
.ptrs
()
.values
()
{
collect_
miri
(
tcx
,
id
,
output
);
collect_
alloc
(
tcx
,
id
,
output
);
}
}
}
}
_
=>
{}
_
=>
{}
...
...
compiler/rustc_symbol_mangling/src/v0.rs
浏览文件 @
2984670c
...
@@ -628,7 +628,8 @@ fn print_const(mut self, ct: ty::Const<'tcx>) -> Result<Self::Const, Self::Error
...
@@ -628,7 +628,8 @@ fn print_const(mut self, ct: ty::Const<'tcx>) -> Result<Self::Const, Self::Error
valtree
,
ty
valtree
,
ty
)
)
});
});
let
s
=
std
::
str
::
from_utf8
(
slice
)
.expect
(
"non utf8 str from miri"
);
let
s
=
std
::
str
::
from_utf8
(
slice
)
.expect
(
"non utf8 str from MIR interpreter"
);
self
.push
(
"e"
);
self
.push
(
"e"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录