Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
ae45e8a6
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,发现更多精彩内容 >>
提交
ae45e8a6
编写于
2月 22, 2022
作者:
L
lcnr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
don't special case `DefKind::Ctor` in encoding
上级
7ccfe2ff
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
46 addition
and
51 deletion
+46
-51
compiler/rustc_metadata/src/rmeta/encoder.rs
compiler/rustc_metadata/src/rmeta/encoder.rs
+2
-7
src/test/ui/deprecation/deprecation-lint.rs
src/test/ui/deprecation/deprecation-lint.rs
+9
-9
src/test/ui/deprecation/deprecation-lint.stderr
src/test/ui/deprecation/deprecation-lint.stderr
+9
-9
src/test/ui/lint/lint-stability-deprecated.rs
src/test/ui/lint/lint-stability-deprecated.rs
+6
-6
src/test/ui/lint/lint-stability-deprecated.stderr
src/test/ui/lint/lint-stability-deprecated.stderr
+6
-6
src/test/ui/lint/lint-stability-fields-deprecated.rs
src/test/ui/lint/lint-stability-fields-deprecated.rs
+3
-3
src/test/ui/lint/lint-stability-fields-deprecated.stderr
src/test/ui/lint/lint-stability-fields-deprecated.stderr
+3
-3
src/test/ui/stability-attribute/generics-default-stability.rs
...test/ui/stability-attribute/generics-default-stability.rs
+4
-4
src/test/ui/stability-attribute/generics-default-stability.stderr
.../ui/stability-attribute/generics-default-stability.stderr
+4
-4
未找到文件。
compiler/rustc_metadata/src/rmeta/encoder.rs
浏览文件 @
ae45e8a6
...
...
@@ -6,7 +6,7 @@
use
rustc_data_structures
::
stable_hasher
::
StableHasher
;
use
rustc_data_structures
::
sync
::{
join
,
par_iter
,
Lrc
,
ParallelIterator
};
use
rustc_hir
as
hir
;
use
rustc_hir
::
def
::
{
CtorOf
,
DefKind
}
;
use
rustc_hir
::
def
::
DefKind
;
use
rustc_hir
::
def_id
::{
CrateNum
,
DefId
,
DefIndex
,
LocalDefId
,
CRATE_DEF_ID
,
CRATE_DEF_INDEX
,
LOCAL_CRATE
,
};
...
...
@@ -983,12 +983,7 @@ fn encode_def_ids(&mut self) {
let
def_id
=
local_id
.to_def_id
();
let
def_kind
=
tcx
.opt_def_kind
(
local_id
);
let
Some
(
def_kind
)
=
def_kind
else
{
continue
};
record!
(
self
.tables.opt_def_kind
[
def_id
]
<-
match
def_kind
{
// Replace Ctor by the enclosing object to avoid leaking details in children crates.
DefKind
::
Ctor
(
CtorOf
::
Struct
,
_
)
=>
DefKind
::
Struct
,
DefKind
::
Ctor
(
CtorOf
::
Variant
,
_
)
=>
DefKind
::
Variant
,
def_kind
=>
def_kind
,
});
record!
(
self
.tables.opt_def_kind
[
def_id
]
<-
def_kind
);
record!
(
self
.tables.def_span
[
def_id
]
<-
tcx
.def_span
(
def_id
));
record!
(
self
.tables.attributes
[
def_id
]
<-
tcx
.get_attrs
(
def_id
));
record!
(
self
.tables.expn_that_defined
[
def_id
]
<-
self
.tcx
.expn_that_defined
(
def_id
));
...
...
src/test/ui/deprecation/deprecation-lint.rs
浏览文件 @
ae45e8a6
...
...
@@ -35,21 +35,21 @@ fn test() {
i
:
0
//~ ERROR use of deprecated field `deprecation_lint::DeprecatedStruct::i`: text
};
let
_
=
DeprecatedUnitStruct
;
//~ ERROR use of deprecated struct `deprecation_lint::DeprecatedUnitStruct`: text
let
_
=
DeprecatedUnitStruct
;
//~ ERROR use of deprecated
unit
struct `deprecation_lint::DeprecatedUnitStruct`: text
let
_
=
Enum
::
DeprecatedVariant
;
//~ ERROR use of deprecated variant `deprecation_lint::Enum::DeprecatedVariant`: text
let
_
=
Enum
::
DeprecatedVariant
;
//~ ERROR use of deprecated
unit
variant `deprecation_lint::Enum::DeprecatedVariant`: text
let
_
=
DeprecatedTupleStruct
(
1
);
//~ ERROR use of deprecated struct `deprecation_lint::DeprecatedTupleStruct`: text
let
_
=
DeprecatedTupleStruct
(
1
);
//~ ERROR use of deprecated
tuple
struct `deprecation_lint::DeprecatedTupleStruct`: text
let
_
=
nested
::
DeprecatedStruct
{
//~ ERROR use of deprecated struct `deprecation_lint::nested::DeprecatedStruct`: text
i
:
0
//~ ERROR use of deprecated field `deprecation_lint::nested::DeprecatedStruct::i`: text
};
let
_
=
nested
::
DeprecatedUnitStruct
;
//~ ERROR use of deprecated struct `deprecation_lint::nested::DeprecatedUnitStruct`: text
let
_
=
nested
::
DeprecatedUnitStruct
;
//~ ERROR use of deprecated
unit
struct `deprecation_lint::nested::DeprecatedUnitStruct`: text
let
_
=
nested
::
Enum
::
DeprecatedVariant
;
//~ ERROR use of deprecated variant `deprecation_lint::nested::Enum::DeprecatedVariant`: text
let
_
=
nested
::
Enum
::
DeprecatedVariant
;
//~ ERROR use of deprecated
unit
variant `deprecation_lint::nested::Enum::DeprecatedVariant`: text
let
_
=
nested
::
DeprecatedTupleStruct
(
1
);
//~ ERROR use of deprecated struct `deprecation_lint::nested::DeprecatedTupleStruct`: text
let
_
=
nested
::
DeprecatedTupleStruct
(
1
);
//~ ERROR use of deprecated
tuple
struct `deprecation_lint::nested::DeprecatedTupleStruct`: text
// At the moment, the lint checker only checks stability in
// in the arguments of macros.
...
...
@@ -130,7 +130,7 @@ pub fn foo() {
{
..
}
=
x
;
let
x
=
Deprecated2
(
1
,
2
,
3
);
//~^ ERROR use of deprecated struct `deprecation_lint::Deprecated2`: text
//~^ ERROR use of deprecated
tuple
struct `deprecation_lint::Deprecated2`: text
let
_
=
x
.0
;
//~^ ERROR use of deprecated field `deprecation_lint::Deprecated2::0`: text
...
...
@@ -140,7 +140,7 @@ pub fn foo() {
//~^ ERROR use of deprecated field `deprecation_lint::Deprecated2::2`: text
let
Deprecated2
//~^ ERROR use of deprecated struct `deprecation_lint::Deprecated2`: text
//~^ ERROR use of deprecated
tuple
struct `deprecation_lint::Deprecated2`: text
(
_
,
//~^ ERROR use of deprecated field `deprecation_lint::Deprecated2::0`: text
_
,
...
...
@@ -149,7 +149,7 @@ pub fn foo() {
//~^ ERROR use of deprecated field `deprecation_lint::Deprecated2::2`: text
=
x
;
let
Deprecated2
//~^ ERROR use of deprecated struct `deprecation_lint::Deprecated2`: text
//~^ ERROR use of deprecated
tuple
struct `deprecation_lint::Deprecated2`: text
// the patterns are all fine:
(
..
)
=
x
;
}
...
...
src/test/ui/deprecation/deprecation-lint.stderr
浏览文件 @
ae45e8a6
...
...
@@ -46,19 +46,19 @@ error: use of deprecated struct `deprecation_lint::DeprecatedStruct`: text
LL | let _ = DeprecatedStruct {
| ^^^^^^^^^^^^^^^^
error: use of deprecated struct `deprecation_lint::DeprecatedUnitStruct`: text
error: use of deprecated
unit
struct `deprecation_lint::DeprecatedUnitStruct`: text
--> $DIR/deprecation-lint.rs:38:17
|
LL | let _ = DeprecatedUnitStruct;
| ^^^^^^^^^^^^^^^^^^^^
error: use of deprecated variant `deprecation_lint::Enum::DeprecatedVariant`: text
error: use of deprecated
unit
variant `deprecation_lint::Enum::DeprecatedVariant`: text
--> $DIR/deprecation-lint.rs:40:23
|
LL | let _ = Enum::DeprecatedVariant;
| ^^^^^^^^^^^^^^^^^
error: use of deprecated struct `deprecation_lint::DeprecatedTupleStruct`: text
error: use of deprecated
tuple
struct `deprecation_lint::DeprecatedTupleStruct`: text
--> $DIR/deprecation-lint.rs:42:17
|
LL | let _ = DeprecatedTupleStruct (1);
...
...
@@ -70,19 +70,19 @@ error: use of deprecated struct `deprecation_lint::nested::DeprecatedStruct`: te
LL | let _ = nested::DeprecatedStruct {
| ^^^^^^^^^^^^^^^^
error: use of deprecated struct `deprecation_lint::nested::DeprecatedUnitStruct`: text
error: use of deprecated
unit
struct `deprecation_lint::nested::DeprecatedUnitStruct`: text
--> $DIR/deprecation-lint.rs:48:25
|
LL | let _ = nested::DeprecatedUnitStruct;
| ^^^^^^^^^^^^^^^^^^^^
error: use of deprecated variant `deprecation_lint::nested::Enum::DeprecatedVariant`: text
error: use of deprecated
unit
variant `deprecation_lint::nested::Enum::DeprecatedVariant`: text
--> $DIR/deprecation-lint.rs:50:31
|
LL | ... let _ = nested::Enum::DeprecatedVariant;
| ^^^^^^^^^^^^^^^^^
error: use of deprecated struct `deprecation_lint::nested::DeprecatedTupleStruct`: text
error: use of deprecated
tuple
struct `deprecation_lint::nested::DeprecatedTupleStruct`: text
--> $DIR/deprecation-lint.rs:52:25
|
LL | ... let _ = nested::DeprecatedTupleStruct (1);
...
...
@@ -154,19 +154,19 @@ error: use of deprecated struct `deprecation_lint::Deprecated`: text
LL | let Deprecated
| ^^^^^^^^^^
error: use of deprecated struct `deprecation_lint::Deprecated2`: text
error: use of deprecated
tuple
struct `deprecation_lint::Deprecated2`: text
--> $DIR/deprecation-lint.rs:132:17
|
LL | let x = Deprecated2(1, 2, 3);
| ^^^^^^^^^^^
error: use of deprecated struct `deprecation_lint::Deprecated2`: text
error: use of deprecated
tuple
struct `deprecation_lint::Deprecated2`: text
--> $DIR/deprecation-lint.rs:142:13
|
LL | let Deprecated2
| ^^^^^^^^^^^
error: use of deprecated struct `deprecation_lint::Deprecated2`: text
error: use of deprecated
tuple
struct `deprecation_lint::Deprecated2`: text
--> $DIR/deprecation-lint.rs:151:13
|
LL | let Deprecated2
...
...
src/test/ui/lint/lint-stability-deprecated.rs
浏览文件 @
ae45e8a6
...
...
@@ -115,18 +115,18 @@ fn test() {
let
_
=
UnstableStruct
{
i
:
0
};
let
_
=
StableStruct
{
i
:
0
};
let
_
=
DeprecatedUnitStruct
;
//~ WARN use of deprecated struct `lint_stability::DeprecatedUnitStruct`
let
_
=
DeprecatedUnstableUnitStruct
;
//~ WARN use of deprecated struct `lint_stability::DeprecatedUnstableUnitStruct`
let
_
=
DeprecatedUnitStruct
;
//~ WARN use of deprecated
unit
struct `lint_stability::DeprecatedUnitStruct`
let
_
=
DeprecatedUnstableUnitStruct
;
//~ WARN use of deprecated
unit
struct `lint_stability::DeprecatedUnstableUnitStruct`
let
_
=
UnstableUnitStruct
;
let
_
=
StableUnitStruct
;
let
_
=
Enum
::
DeprecatedVariant
;
//~ WARN use of deprecated variant `lint_stability::Enum::DeprecatedVariant`
let
_
=
Enum
::
DeprecatedUnstableVariant
;
//~ WARN use of deprecated variant `lint_stability::Enum::DeprecatedUnstableVariant`
let
_
=
Enum
::
DeprecatedVariant
;
//~ WARN use of deprecated
unit
variant `lint_stability::Enum::DeprecatedVariant`
let
_
=
Enum
::
DeprecatedUnstableVariant
;
//~ WARN use of deprecated
unit
variant `lint_stability::Enum::DeprecatedUnstableVariant`
let
_
=
Enum
::
UnstableVariant
;
let
_
=
Enum
::
StableVariant
;
let
_
=
DeprecatedTupleStruct
(
1
);
//~ WARN use of deprecated struct `lint_stability::DeprecatedTupleStruct`
let
_
=
DeprecatedUnstableTupleStruct
(
1
);
//~ WARN use of deprecated struct `lint_stability::DeprecatedUnstableTupleStruct`
let
_
=
DeprecatedTupleStruct
(
1
);
//~ WARN use of deprecated
tuple
struct `lint_stability::DeprecatedTupleStruct`
let
_
=
DeprecatedUnstableTupleStruct
(
1
);
//~ WARN use of deprecated
tuple
struct `lint_stability::DeprecatedUnstableTupleStruct`
let
_
=
UnstableTupleStruct
(
1
);
let
_
=
StableTupleStruct
(
1
);
...
...
src/test/ui/lint/lint-stability-deprecated.stderr
浏览文件 @
ae45e8a6
...
...
@@ -88,37 +88,37 @@ warning: use of deprecated struct `lint_stability::DeprecatedUnstableStruct`: te
LL | let _ = DeprecatedUnstableStruct {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated struct `lint_stability::DeprecatedUnitStruct`: text
warning: use of deprecated
unit
struct `lint_stability::DeprecatedUnitStruct`: text
--> $DIR/lint-stability-deprecated.rs:118:17
|
LL | let _ = DeprecatedUnitStruct;
| ^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated struct `lint_stability::DeprecatedUnstableUnitStruct`: text
warning: use of deprecated
unit
struct `lint_stability::DeprecatedUnstableUnitStruct`: text
--> $DIR/lint-stability-deprecated.rs:119:17
|
LL | let _ = DeprecatedUnstableUnitStruct;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated variant `lint_stability::Enum::DeprecatedVariant`: text
warning: use of deprecated
unit
variant `lint_stability::Enum::DeprecatedVariant`: text
--> $DIR/lint-stability-deprecated.rs:123:23
|
LL | let _ = Enum::DeprecatedVariant;
| ^^^^^^^^^^^^^^^^^
warning: use of deprecated variant `lint_stability::Enum::DeprecatedUnstableVariant`: text
warning: use of deprecated
unit
variant `lint_stability::Enum::DeprecatedUnstableVariant`: text
--> $DIR/lint-stability-deprecated.rs:124:23
|
LL | let _ = Enum::DeprecatedUnstableVariant;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated struct `lint_stability::DeprecatedTupleStruct`: text
warning: use of deprecated
tuple
struct `lint_stability::DeprecatedTupleStruct`: text
--> $DIR/lint-stability-deprecated.rs:128:17
|
LL | let _ = DeprecatedTupleStruct (1);
| ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated struct `lint_stability::DeprecatedUnstableTupleStruct`: text
warning: use of deprecated
tuple
struct `lint_stability::DeprecatedUnstableTupleStruct`: text
--> $DIR/lint-stability-deprecated.rs:129:17
|
LL | let _ = DeprecatedUnstableTupleStruct (1);
...
...
src/test/ui/lint/lint-stability-fields-deprecated.rs
浏览文件 @
ae45e8a6
...
...
@@ -129,7 +129,7 @@ pub fn foo() {
{
..
}
=
x
;
let
x
=
Deprecated2
(
1
,
2
,
3
);
//~^ ERROR use of deprecated struct
//~^ ERROR use of deprecated
tuple
struct
let
_
=
x
.0
;
//~^ ERROR use of deprecated field
...
...
@@ -139,7 +139,7 @@ pub fn foo() {
//~^ ERROR use of deprecated field
let
Deprecated2
//~^ ERROR use of deprecated struct
//~^ ERROR use of deprecated
tuple
struct
(
_
,
//~^ ERROR use of deprecated field
_
,
...
...
@@ -148,7 +148,7 @@ pub fn foo() {
//~^ ERROR use of deprecated field
=
x
;
let
Deprecated2
//~^ ERROR use of deprecated struct
//~^ ERROR use of deprecated
tuple
struct
// the patterns are all fine:
(
..
)
=
x
;
}
...
...
src/test/ui/lint/lint-stability-fields-deprecated.stderr
浏览文件 @
ae45e8a6
...
...
@@ -22,19 +22,19 @@ error: use of deprecated struct `cross_crate::lint_stability_fields::Deprecated`
LL | let Deprecated
| ^^^^^^^^^^
error: use of deprecated struct `cross_crate::lint_stability_fields::Deprecated2`: text
error: use of deprecated
tuple
struct `cross_crate::lint_stability_fields::Deprecated2`: text
--> $DIR/lint-stability-fields-deprecated.rs:131:17
|
LL | let x = Deprecated2(1, 2, 3);
| ^^^^^^^^^^^
error: use of deprecated struct `cross_crate::lint_stability_fields::Deprecated2`: text
error: use of deprecated
tuple
struct `cross_crate::lint_stability_fields::Deprecated2`: text
--> $DIR/lint-stability-fields-deprecated.rs:141:13
|
LL | let Deprecated2
| ^^^^^^^^^^^
error: use of deprecated struct `cross_crate::lint_stability_fields::Deprecated2`: text
error: use of deprecated
tuple
struct `cross_crate::lint_stability_fields::Deprecated2`: text
--> $DIR/lint-stability-fields-deprecated.rs:150:13
|
LL | let Deprecated2
...
...
src/test/ui/stability-attribute/generics-default-stability.rs
浏览文件 @
ae45e8a6
...
...
@@ -217,25 +217,25 @@ fn main() {
let
_
=
ENUM4
;
let
_
:
Enum4
<
isize
>
=
Enum4
::
Some
(
1
);
//~^ use of deprecated variant `unstable_generic_param::Enum4::Some`: test [deprecated]
//~^ use of deprecated
tuple
variant `unstable_generic_param::Enum4::Some`: test [deprecated]
//~^^ use of deprecated enum `unstable_generic_param::Enum4`: test [deprecated]
let
_
=
ENUM4
;
let
_
:
Enum4
=
ENUM4
;
//~ use of deprecated enum `unstable_generic_param::Enum4`: test [deprecated]
let
_
:
Enum4
<
usize
>
=
ENUM4
;
//~ use of deprecated enum `unstable_generic_param::Enum4`: test [deprecated]
let
_
:
Enum4
<
isize
>
=
Enum4
::
Some
(
0
);
//~^ use of deprecated variant `unstable_generic_param::Enum4::Some`: test [deprecated]
//~^ use of deprecated
tuple
variant `unstable_generic_param::Enum4::Some`: test [deprecated]
//~^^ use of deprecated enum `unstable_generic_param::Enum4`: test [deprecated]
let
_
=
ENUM5
;
let
_
:
Enum5
<
isize
>
=
Enum5
::
Some
(
1
);
//~ ERROR use of unstable library feature 'unstable_default'
//~^ use of deprecated variant `unstable_generic_param::Enum5::Some`: test [deprecated]
//~^ use of deprecated
tuple
variant `unstable_generic_param::Enum5::Some`: test [deprecated]
//~^^ use of deprecated enum `unstable_generic_param::Enum5`: test [deprecated]
let
_
=
ENUM5
;
let
_
:
Enum5
=
ENUM5
;
//~ use of deprecated enum `unstable_generic_param::Enum5`: test [deprecated]
let
_
:
Enum5
<
usize
>
=
ENUM5
;
//~ ERROR use of unstable library feature 'unstable_default'
//~^ use of deprecated enum `unstable_generic_param::Enum5`: test [deprecated]
let
_
:
Enum5
<
isize
>
=
Enum5
::
Some
(
0
);
//~ ERROR use of unstable library feature 'unstable_default'
//~^ use of deprecated variant `unstable_generic_param::Enum5::Some`: test [deprecated]
//~^ use of deprecated
tuple
variant `unstable_generic_param::Enum5::Some`: test [deprecated]
//~^^ use of deprecated enum `unstable_generic_param::Enum5`: test [deprecated]
let
_
:
Enum6
<
isize
>
=
Enum6
::
Some
(
1
);
// ok
...
...
src/test/ui/stability-attribute/generics-default-stability.stderr
浏览文件 @
ae45e8a6
...
...
@@ -144,7 +144,7 @@ warning: use of deprecated type alias `unstable_generic_param::Alias5`: test
LL | let _: Alias5<isize> = Alias5::Some(0);
| ^^^^^^
warning: use of deprecated variant `unstable_generic_param::Enum4::Some`: test
warning: use of deprecated
tuple
variant `unstable_generic_param::Enum4::Some`: test
--> $DIR/generics-default-stability.rs:219:34
|
LL | let _: Enum4<isize> = Enum4::Some(1);
...
...
@@ -168,7 +168,7 @@ warning: use of deprecated enum `unstable_generic_param::Enum4`: test
LL | let _: Enum4<usize> = ENUM4;
| ^^^^^
warning: use of deprecated variant `unstable_generic_param::Enum4::Some`: test
warning: use of deprecated
tuple
variant `unstable_generic_param::Enum4::Some`: test
--> $DIR/generics-default-stability.rs:225:34
|
LL | let _: Enum4<isize> = Enum4::Some(0);
...
...
@@ -180,7 +180,7 @@ warning: use of deprecated enum `unstable_generic_param::Enum4`: test
LL | let _: Enum4<isize> = Enum4::Some(0);
| ^^^^^
warning: use of deprecated variant `unstable_generic_param::Enum5::Some`: test
warning: use of deprecated
tuple
variant `unstable_generic_param::Enum5::Some`: test
--> $DIR/generics-default-stability.rs:230:34
|
LL | let _: Enum5<isize> = Enum5::Some(1);
...
...
@@ -204,7 +204,7 @@ warning: use of deprecated enum `unstable_generic_param::Enum5`: test
LL | let _: Enum5<usize> = ENUM5;
| ^^^^^
warning: use of deprecated variant `unstable_generic_param::Enum5::Some`: test
warning: use of deprecated
tuple
variant `unstable_generic_param::Enum5::Some`: test
--> $DIR/generics-default-stability.rs:237:34
|
LL | let _: Enum5<isize> = Enum5::Some(0);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录