Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
90c4b947
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,发现更多精彩内容 >>
提交
90c4b947
编写于
6月 03, 2022
作者:
B
b-naber
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix wrong evaluation in clippy
上级
773d8b2e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
8 deletion
+8
-8
src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff
...r-opt/inline/inline_into_box_place.main.Inline.32bit.diff
+4
-4
src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir
...in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir
+2
-2
src/tools/clippy/clippy_utils/src/consts.rs
src/tools/clippy/clippy_utils/src/consts.rs
+2
-2
未找到文件。
src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff
浏览文件 @
90c4b947
...
@@ -23,10 +23,10 @@
...
@@ -23,10 +23,10 @@
StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
_2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_4 =
: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}
(move _2, move _3) -> bb1; // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_4 =
alloc::alloc::exchange_malloc
(move _2, move _3) -> bb1; // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
// mir::Constant
// mir::Constant
// + span: $DIR/inline-into-box-place.rs:8:29: 8:43
// + span: $DIR/inline-into-box-place.rs:8:29: 8:43
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(
ValTree::Branch(..
)) }
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(
Scalar(<ZST>
)) }
}
}
bb1: {
bb1: {
...
@@ -71,10 +71,10 @@
...
@@ -71,10 +71,10 @@
- }
- }
-
-
- bb5 (cleanup): {
- bb5 (cleanup): {
- _6 =
: unsafe fn(Unique::<Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>}
(move (_5.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_5.1: std::alloc::Global)) -> bb4; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- _6 =
alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>
(move (_5.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_5.1: std::alloc::Global)) -> bb4; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- // mir::Constant
- // mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
- // + literal: Const { ty: unsafe fn(Unique<Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>}, val: Value(
ValTree::Branch(..
)) }
- // + literal: Const { ty: unsafe fn(Unique<Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>}, val: Value(
Scalar(<ZST>
)) }
}
}
}
}
src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir
浏览文件 @
90c4b947
...
@@ -31,9 +31,9 @@ fn std::ptr::drop_in_place(_1: *mut Vec<i32>) -> () {
...
@@ -31,9 +31,9 @@ fn std::ptr::drop_in_place(_1: *mut Vec<i32>) -> () {
bb6: {
bb6: {
_2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_3 =
: for<'r> fn(&'r mut Vec::<i32>) {<Vec<i32> as Drop>::drop}
(move _2) -> [return: bb5, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_3 =
<Vec<i32> as Drop>::drop
(move _2) -> [return: bb5, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// mir::Constant
// mir::Constant
// + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// + literal: Const { ty: for<'r> fn(&'r mut Vec<i32>) {<Vec<i32> as Drop>::drop}, val: Value(
ValTree::Branch(..
)) }
// + literal: Const { ty: for<'r> fn(&'r mut Vec<i32>) {<Vec<i32> as Drop>::drop}, val: Value(
Scalar(<ZST>
)) }
}
}
}
}
src/tools/clippy/clippy_utils/src/consts.rs
浏览文件 @
90c4b947
...
@@ -619,7 +619,7 @@ pub fn miri_to_const<'tcx>(tcx: TyCtxt<'tcx>, result: mir::ConstantKind<'tcx>) -
...
@@ -619,7 +619,7 @@ pub fn miri_to_const<'tcx>(tcx: TyCtxt<'tcx>, result: mir::ConstantKind<'tcx>) -
},
},
mir
::
ConstantKind
::
Val
(
ConstValue
::
ByRef
{
alloc
,
offset
:
_
},
_
)
=>
match
result
.ty
()
.kind
()
{
mir
::
ConstantKind
::
Val
(
ConstValue
::
ByRef
{
alloc
,
offset
:
_
},
_
)
=>
match
result
.ty
()
.kind
()
{
ty
::
Array
(
sub_type
,
len
)
=>
match
sub_type
.kind
()
{
ty
::
Array
(
sub_type
,
len
)
=>
match
sub_type
.kind
()
{
ty
::
Float
(
FloatTy
::
F32
)
=>
match
len
.t
ry_eval_usize
(
tcx
,
ty
::
ParamEnv
::
empty
()
)
{
ty
::
Float
(
FloatTy
::
F32
)
=>
match
len
.t
o_valtree
()
.try_to_machine_usize
(
tcx
)
{
Some
(
len
)
=>
alloc
Some
(
len
)
=>
alloc
.inner
()
.inner
()
.inspect_with_uninit_and_ptr_outside_interpreter
(
0
..
(
4
*
len
as
usize
))
.inspect_with_uninit_and_ptr_outside_interpreter
(
0
..
(
4
*
len
as
usize
))
...
@@ -634,7 +634,7 @@ pub fn miri_to_const<'tcx>(tcx: TyCtxt<'tcx>, result: mir::ConstantKind<'tcx>) -
...
@@ -634,7 +634,7 @@ pub fn miri_to_const<'tcx>(tcx: TyCtxt<'tcx>, result: mir::ConstantKind<'tcx>) -
.map
(
Constant
::
Vec
),
.map
(
Constant
::
Vec
),
_
=>
None
,
_
=>
None
,
},
},
ty
::
Float
(
FloatTy
::
F64
)
=>
match
len
.t
ry_eval_usize
(
tcx
,
ty
::
ParamEnv
::
empty
()
)
{
ty
::
Float
(
FloatTy
::
F64
)
=>
match
len
.t
o_valtree
()
.try_to_machine_usize
(
tcx
)
{
Some
(
len
)
=>
alloc
Some
(
len
)
=>
alloc
.inner
()
.inner
()
.inspect_with_uninit_and_ptr_outside_interpreter
(
0
..
(
8
*
len
as
usize
))
.inspect_with_uninit_and_ptr_outside_interpreter
(
0
..
(
8
*
len
as
usize
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录