Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
splade
rust
提交
9b2c8d86
R
rust
项目概览
splade
/
rust
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9b2c8d86
编写于
9月 23, 2020
作者:
A
Ashley Mannix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revert const_type_id stabilization
This reverts commit
e3856616
.
上级
e0bc2675
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
10 addition
and
6 deletion
+10
-6
library/core/src/any.rs
library/core/src/any.rs
+1
-1
library/core/src/intrinsics.rs
library/core/src/intrinsics.rs
+1
-1
library/core/src/lib.rs
library/core/src/lib.rs
+1
-0
src/test/ui/consts/const-typeid-of-rpass.rs
src/test/ui/consts/const-typeid-of-rpass.rs
+1
-0
src/test/ui/consts/issue-73976-monomorphic.rs
src/test/ui/consts/issue-73976-monomorphic.rs
+1
-0
src/test/ui/consts/issue-73976-polymorphic.rs
src/test/ui/consts/issue-73976-polymorphic.rs
+1
-0
src/test/ui/consts/issue-73976-polymorphic.stderr
src/test/ui/consts/issue-73976-polymorphic.stderr
+4
-4
未找到文件。
library/core/src/any.rs
浏览文件 @
9b2c8d86
...
...
@@ -435,7 +435,7 @@ impl TypeId {
/// assert_eq!(is_string(&"cookie monster".to_string()), true);
/// ```
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[rustc_const_
stable(feature
=
"const_type_id"
,
since
=
"1.46.0
"
)]
#[rustc_const_
unstable(feature
=
"const_type_id"
,
issue
=
"63084
"
)]
pub
const
fn
of
<
T
:
?
Sized
+
'static
>
()
->
TypeId
{
TypeId
{
t
:
intrinsics
::
type_id
::
<
T
>
()
}
}
...
...
library/core/src/intrinsics.rs
浏览文件 @
9b2c8d86
...
...
@@ -807,7 +807,7 @@
/// crate it is invoked in.
///
/// The stabilized version of this intrinsic is [`crate::any::TypeId::of`].
#[rustc_const_
stable(feature
=
"const_type_id"
,
since
=
"1.46.0
"
)]
#[rustc_const_
unstable(feature
=
"const_type_id"
,
issue
=
"63084
"
)]
pub
fn
type_id
<
T
:
?
Sized
+
'static
>
()
->
u64
;
/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
...
...
library/core/src/lib.rs
浏览文件 @
9b2c8d86
...
...
@@ -90,6 +90,7 @@
#![feature(const_slice_ptr_len)]
#![feature(const_size_of_val)]
#![feature(const_align_of_val)]
#![feature(const_type_id)]
#![feature(const_type_name)]
#![feature(const_likely)]
#![feature(const_unreachable_unchecked)]
...
...
src/test/ui/consts/const-typeid-of-rpass.rs
浏览文件 @
9b2c8d86
// run-pass
#![feature(const_type_id)]
#![feature(core_intrinsics)]
use
std
::
any
::
TypeId
;
...
...
src/test/ui/consts/issue-73976-monomorphic.rs
浏览文件 @
9b2c8d86
...
...
@@ -5,6 +5,7 @@
// will be properly rejected. This test will ensure that monomorphic use of these
// would not be wrongly rejected in patterns.
#![feature(const_type_id)]
#![feature(const_type_name)]
use
std
::
any
::{
self
,
TypeId
};
...
...
src/test/ui/consts/issue-73976-polymorphic.rs
浏览文件 @
9b2c8d86
...
...
@@ -5,6 +5,7 @@
// This test case should either run-pass or be rejected at compile time.
// Currently we just disallow this usage and require pattern is monomorphic.
#![feature(const_type_id)]
#![feature(const_type_name)]
use
std
::
any
::{
self
,
TypeId
};
...
...
src/test/ui/consts/issue-73976-polymorphic.stderr
浏览文件 @
9b2c8d86
error: constant pattern depends on a generic parameter
--> $DIR/issue-73976-polymorphic.rs:
19
:37
--> $DIR/issue-73976-polymorphic.rs:
20
:37
|
LL | matches!(GetTypeId::<T>::VALUE, GetTypeId::<T>::VALUE)
| ^^^^^^^^^^^^^^^^^^^^^
error: constant pattern depends on a generic parameter
--> $DIR/issue-73976-polymorphic.rs:3
1
:42
--> $DIR/issue-73976-polymorphic.rs:3
2
:42
|
LL | matches!(GetTypeNameLen::<T>::VALUE, GetTypeNameLen::<T>::VALUE)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: constant pattern depends on a generic parameter
--> $DIR/issue-73976-polymorphic.rs:
19
:37
--> $DIR/issue-73976-polymorphic.rs:
20
:37
|
LL | matches!(GetTypeId::<T>::VALUE, GetTypeId::<T>::VALUE)
| ^^^^^^^^^^^^^^^^^^^^^
error: constant pattern depends on a generic parameter
--> $DIR/issue-73976-polymorphic.rs:3
1
:42
--> $DIR/issue-73976-polymorphic.rs:3
2
:42
|
LL | matches!(GetTypeNameLen::<T>::VALUE, GetTypeNameLen::<T>::VALUE)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录