Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
89aa0bc1
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,发现更多精彩内容 >>
提交
89aa0bc1
编写于
7月 16, 2018
作者:
M
Michael Woerister
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Adapt codegen-unit tests to new CGU naming scheme."
This reverts commit
94b32adb
.
上级
8acf3d26
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
35 addition
and
58 deletion
+35
-58
src/test/codegen-units/item-collection/drop_in_place_intrinsic.rs
.../codegen-units/item-collection/drop_in_place_intrinsic.rs
+3
-3
src/test/codegen-units/item-collection/generic-drop-glue.rs
src/test/codegen-units/item-collection/generic-drop-glue.rs
+6
-6
src/test/codegen-units/item-collection/instantiation-through-vtable.rs
...gen-units/item-collection/instantiation-through-vtable.rs
+2
-2
src/test/codegen-units/item-collection/non-generic-drop-glue.rs
...st/codegen-units/item-collection/non-generic-drop-glue.rs
+2
-2
src/test/codegen-units/item-collection/transitive-drop-glue.rs
...est/codegen-units/item-collection/transitive-drop-glue.rs
+9
-9
src/test/codegen-units/item-collection/tuple-drop-glue.rs
src/test/codegen-units/item-collection/tuple-drop-glue.rs
+4
-4
src/test/codegen-units/item-collection/unsizing.rs
src/test/codegen-units/item-collection/unsizing.rs
+4
-4
src/tools/compiletest/src/runtest.rs
src/tools/compiletest/src/runtest.rs
+5
-28
未找到文件。
src/test/codegen-units/item-collection/drop_in_place_intrinsic.rs
浏览文件 @
89aa0bc1
...
...
@@ -14,7 +14,7 @@
#![feature(start)]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<drop_in_place_intrinsic::StructWithDtor[0]> @@ drop_in_place_intrinsic
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<drop_in_place_intrinsic::StructWithDtor[0]> @@ drop_in_place_intrinsic0[Internal]
struct
StructWithDtor
(
u32
);
impl
Drop
for
StructWithDtor
{
...
...
@@ -26,7 +26,7 @@ fn drop(&mut self) {}
#[start]
fn
start
(
_
:
isize
,
_
:
*
const
*
const
u8
)
->
isize
{
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<[drop_in_place_intrinsic::StructWithDtor[0]; 2]> @@ drop_in_place_intrinsic
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<[drop_in_place_intrinsic::StructWithDtor[0]; 2]> @@ drop_in_place_intrinsic0[Internal]
let
x
=
[
StructWithDtor
(
0
),
StructWithDtor
(
1
)];
drop_slice_in_place
(
&
x
);
...
...
@@ -40,7 +40,7 @@ fn drop_slice_in_place(x: &[StructWithDtor]) {
// This is the interesting thing in this test case: Normally we would
// not have drop-glue for the unsized [StructWithDtor]. This has to be
// generated though when the drop_in_place() intrinsic is used.
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<[drop_in_place_intrinsic::StructWithDtor[0]]> @@ drop_in_place_intrinsic
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<[drop_in_place_intrinsic::StructWithDtor[0]]> @@ drop_in_place_intrinsic0[Internal]
::
std
::
ptr
::
drop_in_place
(
x
as
*
const
_
as
*
mut
[
StructWithDtor
]);
}
}
src/test/codegen-units/item-collection/generic-drop-glue.rs
浏览文件 @
89aa0bc1
...
...
@@ -47,7 +47,7 @@ enum EnumNoDrop<T1, T2> {
struct
NonGenericNoDrop
(
i32
);
struct
NonGenericWithDrop
(
i32
);
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::NonGenericWithDrop[0]> @@ generic_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::NonGenericWithDrop[0]> @@ generic_drop_glue0[Internal]
impl
Drop
for
NonGenericWithDrop
{
//~ MONO_ITEM fn generic_drop_glue::{{impl}}[2]::drop[0]
...
...
@@ -57,11 +57,11 @@ fn drop(&mut self) {}
//~ MONO_ITEM fn generic_drop_glue::start[0]
#[start]
fn
start
(
_
:
isize
,
_
:
*
const
*
const
u8
)
->
isize
{
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::StructWithDrop[0]<i8, char>> @@ generic_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::StructWithDrop[0]<i8, char>> @@ generic_drop_glue0[Internal]
//~ MONO_ITEM fn generic_drop_glue::{{impl}}[0]::drop[0]<i8, char>
let
_
=
StructWithDrop
{
x
:
0i8
,
y
:
'a'
}
.x
;
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::StructWithDrop[0]<&str, generic_drop_glue::NonGenericNoDrop[0]>> @@ generic_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::StructWithDrop[0]<&str, generic_drop_glue::NonGenericNoDrop[0]>> @@ generic_drop_glue0[Internal]
//~ MONO_ITEM fn generic_drop_glue::{{impl}}[0]::drop[0]<&str, generic_drop_glue::NonGenericNoDrop[0]>
let
_
=
StructWithDrop
{
x
:
"&str"
,
y
:
NonGenericNoDrop
(
0
)
}
.y
;
...
...
@@ -70,17 +70,17 @@ fn start(_: isize, _: *const *const u8) -> isize {
// This is supposed to generate drop-glue because it contains a field that
// needs to be dropped.
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::StructNoDrop[0]<generic_drop_glue::NonGenericWithDrop[0], f64>> @@ generic_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::StructNoDrop[0]<generic_drop_glue::NonGenericWithDrop[0], f64>> @@ generic_drop_glue0[Internal]
let
_
=
StructNoDrop
{
x
:
NonGenericWithDrop
(
0
),
y
:
0f64
}
.y
;
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::EnumWithDrop[0]<i32, i64>> @@ generic_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::EnumWithDrop[0]<i32, i64>> @@ generic_drop_glue0[Internal]
//~ MONO_ITEM fn generic_drop_glue::{{impl}}[1]::drop[0]<i32, i64>
let
_
=
match
EnumWithDrop
::
A
::
<
i32
,
i64
>
(
0
)
{
EnumWithDrop
::
A
(
x
)
=>
x
,
EnumWithDrop
::
B
(
x
)
=>
x
as
i32
};
//~MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::EnumWithDrop[0]<f64, f32>> @@ generic_drop_glue
-cgu.
0[Internal]
//~MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::EnumWithDrop[0]<f64, f32>> @@ generic_drop_glue0[Internal]
//~ MONO_ITEM fn generic_drop_glue::{{impl}}[1]::drop[0]<f64, f32>
let
_
=
match
EnumWithDrop
::
B
::
<
f64
,
f32
>
(
1.0
)
{
EnumWithDrop
::
A
(
x
)
=>
x
,
...
...
src/test/codegen-units/item-collection/instantiation-through-vtable.rs
浏览文件 @
89aa0bc1
...
...
@@ -34,13 +34,13 @@ fn bar(&self) {}
fn
start
(
_
:
isize
,
_
:
*
const
*
const
u8
)
->
isize
{
let
s1
=
Struct
{
_
a
:
0u32
};
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<instantiation_through_vtable::Struct[0]<u32>> @@ instantiation_through_vtable
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<instantiation_through_vtable::Struct[0]<u32>> @@ instantiation_through_vtable0[Internal]
//~ MONO_ITEM fn instantiation_through_vtable::{{impl}}[0]::foo[0]<u32>
//~ MONO_ITEM fn instantiation_through_vtable::{{impl}}[0]::bar[0]<u32>
let
_
=
&
s1
as
&
Trait
;
let
s1
=
Struct
{
_
a
:
0u64
};
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<instantiation_through_vtable::Struct[0]<u64>> @@ instantiation_through_vtable
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<instantiation_through_vtable::Struct[0]<u64>> @@ instantiation_through_vtable0[Internal]
//~ MONO_ITEM fn instantiation_through_vtable::{{impl}}[0]::foo[0]<u64>
//~ MONO_ITEM fn instantiation_through_vtable::{{impl}}[0]::bar[0]<u64>
let
_
=
&
s1
as
&
Trait
;
...
...
src/test/codegen-units/item-collection/non-generic-drop-glue.rs
浏览文件 @
89aa0bc1
...
...
@@ -15,7 +15,7 @@
#![deny(dead_code)]
#![feature(start)]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<non_generic_drop_glue::StructWithDrop[0]> @@ non_generic_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<non_generic_drop_glue::StructWithDrop[0]> @@ non_generic_drop_glue0[Internal]
struct
StructWithDrop
{
x
:
i32
}
...
...
@@ -29,7 +29,7 @@ struct StructNoDrop {
x
:
i32
}
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<non_generic_drop_glue::EnumWithDrop[0]> @@ non_generic_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<non_generic_drop_glue::EnumWithDrop[0]> @@ non_generic_drop_glue0[Internal]
enum
EnumWithDrop
{
A
(
i32
)
}
...
...
src/test/codegen-units/item-collection/transitive-drop-glue.rs
浏览文件 @
89aa0bc1
...
...
@@ -15,11 +15,11 @@
#![deny(dead_code)]
#![feature(start)]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Root[0]> @@ transitive_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Root[0]> @@ transitive_drop_glue0[Internal]
struct
Root
(
Intermediate
);
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Intermediate[0]> @@ transitive_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Intermediate[0]> @@ transitive_drop_glue0[Internal]
struct
Intermediate
(
Leaf
);
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Leaf[0]> @@ transitive_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Leaf[0]> @@ transitive_drop_glue0[Internal]
struct
Leaf
;
impl
Drop
for
Leaf
{
...
...
@@ -40,15 +40,15 @@ fn drop(&mut self) {}
fn
start
(
_
:
isize
,
_
:
*
const
*
const
u8
)
->
isize
{
let
_
=
Root
(
Intermediate
(
Leaf
));
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::RootGen[0]<u32>> @@ transitive_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::IntermediateGen[0]<u32>> @@ transitive_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::LeafGen[0]<u32>> @@ transitive_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::RootGen[0]<u32>> @@ transitive_drop_glue0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::IntermediateGen[0]<u32>> @@ transitive_drop_glue0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::LeafGen[0]<u32>> @@ transitive_drop_glue0[Internal]
//~ MONO_ITEM fn transitive_drop_glue::{{impl}}[1]::drop[0]<u32>
let
_
=
RootGen
(
IntermediateGen
(
LeafGen
(
0u32
)));
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::RootGen[0]<i16>> @@ transitive_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::IntermediateGen[0]<i16>> @@ transitive_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::LeafGen[0]<i16>> @@ transitive_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::RootGen[0]<i16>> @@ transitive_drop_glue0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::IntermediateGen[0]<i16>> @@ transitive_drop_glue0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::LeafGen[0]<i16>> @@ transitive_drop_glue0[Internal]
//~ MONO_ITEM fn transitive_drop_glue::{{impl}}[1]::drop[0]<i16>
let
_
=
RootGen
(
IntermediateGen
(
LeafGen
(
0i16
)));
...
...
src/test/codegen-units/item-collection/tuple-drop-glue.rs
浏览文件 @
89aa0bc1
...
...
@@ -15,7 +15,7 @@
#![deny(dead_code)]
#![feature(start)]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<tuple_drop_glue::Dropped[0]> @@ tuple_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<tuple_drop_glue::Dropped[0]> @@ tuple_drop_glue0[Internal]
struct
Dropped
;
impl
Drop
for
Dropped
{
...
...
@@ -26,11 +26,11 @@ fn drop(&mut self) {}
//~ MONO_ITEM fn tuple_drop_glue::start[0]
#[start]
fn
start
(
_
:
isize
,
_
:
*
const
*
const
u8
)
->
isize
{
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<(u32, tuple_drop_glue::Dropped[0])> @@ tuple_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<(u32, tuple_drop_glue::Dropped[0])> @@ tuple_drop_glue0[Internal]
let
x
=
(
0u32
,
Dropped
);
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<(i16, (tuple_drop_glue::Dropped[0], bool))> @@ tuple_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<(tuple_drop_glue::Dropped[0], bool)> @@ tuple_drop_glue
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<(i16, (tuple_drop_glue::Dropped[0], bool))> @@ tuple_drop_glue0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<(tuple_drop_glue::Dropped[0], bool)> @@ tuple_drop_glue0[Internal]
let
x
=
(
0i16
,
(
Dropped
,
true
));
0
...
...
src/test/codegen-units/item-collection/unsizing.rs
浏览文件 @
89aa0bc1
...
...
@@ -59,13 +59,13 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Wrapper<U>> for Wrapper<T>
fn
start
(
_
:
isize
,
_
:
*
const
*
const
u8
)
->
isize
{
// simple case
let
bool_sized
=
&
true
;
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<bool> @@ unsizing
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<bool> @@ unsizing0[Internal]
//~ MONO_ITEM fn unsizing::{{impl}}[0]::foo[0]
let
_
bool_unsized
=
bool_sized
as
&
Trait
;
let
char_sized
=
&
'a'
;
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<char> @@ unsizing
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<char> @@ unsizing0[Internal]
//~ MONO_ITEM fn unsizing::{{impl}}[1]::foo[0]
let
_
char_unsized
=
char_sized
as
&
Trait
;
...
...
@@ -75,13 +75,13 @@ fn start(_: isize, _: *const *const u8) -> isize {
_
b
:
2
,
_
c
:
3.0f64
};
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<f64> @@ unsizing
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<f64> @@ unsizing0[Internal]
//~ MONO_ITEM fn unsizing::{{impl}}[2]::foo[0]
let
_
struct_unsized
=
struct_sized
as
&
Struct
<
Trait
>
;
// custom coercion
let
wrapper_sized
=
Wrapper
(
&
0u32
);
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<u32> @@ unsizing
-cgu.
0[Internal]
//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<u32> @@ unsizing0[Internal]
//~ MONO_ITEM fn unsizing::{{impl}}[3]::foo[0]
let
_
wrapper_sized
=
wrapper_sized
as
Wrapper
<
Trait
>
;
...
...
src/tools/compiletest/src/runtest.rs
浏览文件 @
89aa0bc1
...
...
@@ -2209,12 +2209,12 @@ fn run_codegen_units_test(&self) {
.stdout
.lines
()
.filter
(|
line
|
line
.starts_with
(
PREFIX
))
.map
(
|
line
|
str_to_mono_item
(
line
,
true
)
)
.map
(
str_to_mono_item
)
.collect
();
let
expected
:
Vec
<
MonoItem
>
=
errors
::
load_errors
(
&
self
.testpaths.file
,
None
)
.iter
()
.map
(|
e
|
str_to_mono_item
(
&
e
.msg
[
..
]
,
false
))
.map
(|
e
|
str_to_mono_item
(
&
e
.msg
[
..
]))
.collect
();
let
mut
missing
=
Vec
::
new
();
...
...
@@ -2299,14 +2299,14 @@ struct MonoItem {
}
// [MONO_ITEM] name [@@ (cgu)+]
fn
str_to_mono_item
(
s
:
&
str
,
cgu_has_crate_disambiguator
:
bool
)
->
MonoItem
{
fn
str_to_mono_item
(
s
:
&
str
)
->
MonoItem
{
let
s
=
if
s
.starts_with
(
PREFIX
)
{
(
&
s
[
PREFIX
.len
()
..
])
.trim
()
}
else
{
s
.trim
()
};
let
full_string
=
format!
(
"{}{}"
,
PREFIX
,
s
);
let
full_string
=
format!
(
"{}{}"
,
PREFIX
,
s
.trim
()
.to_owned
()
);
let
parts
:
Vec
<&
str
>
=
s
.split
(
CGU_MARKER
)
...
...
@@ -2323,13 +2323,7 @@ fn str_to_mono_item(s: &str, cgu_has_crate_disambiguator: bool) -> MonoItem {
.split
(
' '
)
.map
(
str
::
trim
)
.filter
(|
s
|
!
s
.is_empty
())
.map
(|
s
|
{
if
cgu_has_crate_disambiguator
{
remove_crate_disambiguator_from_cgu
(
s
)
}
else
{
s
.to_string
()
}
})
.map
(
str
::
to_owned
)
.collect
()
}
else
{
HashSet
::
new
()
...
...
@@ -2354,23 +2348,6 @@ fn codegen_units_to_str(cgus: &HashSet<String>) -> String {
string
}
fn
remove_crate_disambiguator_from_cgu
(
cgu
:
&
str
)
->
String
{
// The first '.' is the start of the crate disambiguator
let
disambiguator_start
=
cgu
.find
(
'.'
)
.expect
(
"Could not find start of crate disambiguator in CGU spec"
);
// The first non-alphanumeric character is the end of the disambiguator
let
disambiguator_end
=
cgu
[
disambiguator_start
+
1
..
]
.find
(|
c
|
!
char
::
is_alphanumeric
(
c
))
.expect
(
"Could not find end of crate disambiguator in CGU spec"
)
+
disambiguator_start
+
1
;
let
mut
result
=
cgu
[
0
..
disambiguator_start
]
.to_string
();
result
.push_str
(
&
cgu
[
disambiguator_end
..
]);
result
}
}
fn
init_incremental_test
(
&
self
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录