Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
c0e853f2
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,发现更多精彩内容 >>
提交
c0e853f2
编写于
8月 25, 2021
作者:
E
Ellen
提交者:
lcnr
8月 30, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove lazy_normalization_consts
上级
fcc2badf
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
10 addition
and
114 deletion
+10
-114
compiler/rustc_feature/src/active.rs
compiler/rustc_feature/src/active.rs
+0
-3
compiler/rustc_hir/src/def.rs
compiler/rustc_hir/src/def.rs
+1
-1
compiler/rustc_infer/src/infer/canonical/query_response.rs
compiler/rustc_infer/src/infer/canonical/query_response.rs
+1
-1
compiler/rustc_middle/src/ty/context.rs
compiler/rustc_middle/src/ty/context.rs
+1
-1
src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs
...t-generics/lazy_normalization_consts/const-equate-pred.rs
+1
-1
src/test/ui/const-generics/backcompat/trait-resolution-breakage.rs
...ui/const-generics/backcompat/trait-resolution-breakage.rs
+0
-0
src/test/ui/const-generics/backcompat/unevaluated-consts.rs
src/test/ui/const-generics/backcompat/unevaluated-consts.rs
+0
-0
src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.rs
...lization_consts/feature-gate-lazy_normalization_consts.rs
+0
-10
src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.stderr
...tion_consts/feature-gate-lazy_normalization_consts.stderr
+0
-11
src/test/ui/lazy_normalization_consts/issue-47814.rs
src/test/ui/lazy_normalization_consts/issue-47814.rs
+0
-16
src/test/ui/lazy_normalization_consts/issue-57739.rs
src/test/ui/lazy_normalization_consts/issue-57739.rs
+0
-17
src/test/ui/lazy_normalization_consts/issue-57739.stderr
src/test/ui/lazy_normalization_consts/issue-57739.stderr
+0
-19
src/test/ui/lazy_normalization_consts/issue-73980.rs
src/test/ui/lazy_normalization_consts/issue-73980.rs
+0
-16
src/test/ui/lazy_normalization_consts/issue-73980.stderr
src/test/ui/lazy_normalization_consts/issue-73980.stderr
+0
-12
src/test/ui/polymorphization/promoted-function-2.rs
src/test/ui/polymorphization/promoted-function-2.rs
+2
-2
src/test/ui/polymorphization/promoted-function-2.stderr
src/test/ui/polymorphization/promoted-function-2.stderr
+4
-4
未找到文件。
compiler/rustc_feature/src/active.rs
浏览文件 @
c0e853f2
...
...
@@ -545,9 +545,6 @@ pub fn set(&self, features: &mut Features, span: Span) {
/// Allows capturing variables in scope using format_args!
(
active
,
format_args_capture
,
"1.46.0"
,
Some
(
67984
),
None
),
/// Lazily evaluate constants. This allows constants to depend on type parameters.
(
incomplete
,
lazy_normalization_consts
,
"1.46.0"
,
Some
(
72219
),
None
),
/// Allows `if let` guard in match arms.
(
active
,
if_let_guard
,
"1.47.0"
,
Some
(
51114
),
None
),
...
...
compiler/rustc_hir/src/def.rs
浏览文件 @
c0e853f2
...
...
@@ -307,7 +307,7 @@ pub enum Res<Id = hir::HirId> {
/// We do however allow `Self` in repeat expression even if it is generic to not break code
/// which already works on stable while causing the `const_evaluatable_unchecked` future compat lint.
///
/// FIXME(
lazy_normalization_const
s): Remove this bodge once that feature is stable.
/// FIXME(
generic_const_expr
s): Remove this bodge once that feature is stable.
SelfTy
(
/// Optionally, the trait associated with this `Self` type.
Option
<
DefId
>
,
...
...
compiler/rustc_infer/src/infer/canonical/query_response.rs
浏览文件 @
c0e853f2
...
...
@@ -678,7 +678,7 @@ fn push_outlives(
fn
const_equate
(
&
mut
self
,
_
a
:
&
'tcx
Const
<
'tcx
>
,
_
b
:
&
'tcx
Const
<
'tcx
>
)
{
span_bug!
(
self
.cause
.span
(
self
.infcx.tcx
),
"
lazy_normalization_const
s: unreachable `const_equate`"
"
generic_const_expr
s: unreachable `const_equate`"
);
}
...
...
compiler/rustc_middle/src/ty/context.rs
浏览文件 @
c0e853f2
...
...
@@ -1421,7 +1421,7 @@ pub fn borrowck_mode(self) -> BorrowckMode {
pub
fn
lazy_normalization
(
self
)
->
bool
{
let
features
=
self
.features
();
// Note: We do not enable lazy normalization for `min_const_generics`.
features
.const_generics
||
features
.
lazy_normalization_const
s
features
.const_generics
||
features
.
generic_const_expr
s
}
#[inline]
...
...
src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs
浏览文件 @
c0e853f2
#![crate_name
=
"foo"
]
#![feature(
lazy_normalization_const
s)]
#![feature(
const_generics,
generic_const_expr
s)]
#![allow(incomplete_features)]
// Checking if `Send` is implemented for `Hasher` requires us to evaluate a `ConstEquate` predicate,
...
...
src/test/ui/
lazy_normalization_consts
/trait-resolution-breakage.rs
→
src/test/ui/
const-generics/backcompat
/trait-resolution-breakage.rs
浏览文件 @
c0e853f2
文件已移动
src/test/ui/
lazy_normalization_consts
/unevaluated-consts.rs
→
src/test/ui/
const-generics/backcompat
/unevaluated-consts.rs
浏览文件 @
c0e853f2
文件已移动
src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.rs
已删除
100644 → 0
浏览文件 @
fcc2badf
pub
const
fn
sof
<
T
>
()
->
usize
{
10
}
fn
test
<
T
>
()
{
let
_
:
[
u8
;
sof
::
<
T
>
()];
//~^ ERROR generic parameters may not be used in const operations
}
fn
main
()
{}
src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.stderr
已删除
100644 → 0
浏览文件 @
fcc2badf
error: generic parameters may not be used in const operations
--> $DIR/feature-gate-lazy_normalization_consts.rs:6:23
|
LL | let _: [u8; sof::<T>()];
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(const_generics)]` and `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to previous error
src/test/ui/lazy_normalization_consts/issue-47814.rs
已删除
100644 → 0
浏览文件 @
fcc2badf
// check-pass
#![feature(lazy_normalization_consts)]
#![allow(incomplete_features)]
pub
struct
ArpIPv4
<
'a
>
{
_
s
:
&
'a
u8
}
impl
<
'a
>
ArpIPv4
<
'a
>
{
const
LENGTH
:
usize
=
20
;
pub
fn
to_buffer
()
->
[
u8
;
Self
::
LENGTH
]
{
unimplemented!
()
}
}
fn
main
()
{}
src/test/ui/lazy_normalization_consts/issue-57739.rs
已删除
100644 → 0
浏览文件 @
fcc2badf
#![feature(lazy_normalization_consts)]
//~^ WARN the feature `lazy_normalization_consts` is incomplete
trait
ArraySizeTrait
{
const
SIZE
:
usize
=
0
;
}
impl
<
T
:
?
Sized
>
ArraySizeTrait
for
T
{
const
SIZE
:
usize
=
1
;
}
struct
SomeArray
<
T
:
ArraySizeTrait
>
{
array
:
[
u8
;
T
::
SIZE
],
//~^ ERROR constant expression depends on a generic parameter
phantom
:
std
::
marker
::
PhantomData
<
T
>
,
}
fn
main
()
{}
src/test/ui/lazy_normalization_consts/issue-57739.stderr
已删除
100644 → 0
浏览文件 @
fcc2badf
warning: the feature `lazy_normalization_consts` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-57739.rs:1:12
|
LL | #![feature(lazy_normalization_consts)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #72219 <https://github.com/rust-lang/rust/issues/72219> for more information
error: constant expression depends on a generic parameter
--> $DIR/issue-57739.rs:12:12
|
LL | array: [u8; T::SIZE],
| ^^^^^^^^^^^^^
|
= note: this may fail depending on what value the parameter takes
error: aborting due to previous error; 1 warning emitted
src/test/ui/lazy_normalization_consts/issue-73980.rs
已删除
100644 → 0
浏览文件 @
fcc2badf
// check-pass
#![feature(lazy_normalization_consts)]
#![allow(incomplete_features)]
pub
struct
X
<
P
,
Q
>
(
P
,
Q
);
pub
struct
L
<
T
:
?
Sized
>
(
T
);
impl
<
T
:
?
Sized
>
L
<
T
>
{
const
S
:
usize
=
1
;
}
impl
<
T
>
X
<
T
,
[
u8
;
L
::
<
T
>
::
S
]
>
{}
//~^ WARN cannot use constants which depend on generic parameters
//~| WARN this was previously accepted by the compiler but is being phased out
fn
main
()
{}
src/test/ui/lazy_normalization_consts/issue-73980.stderr
已删除
100644 → 0
浏览文件 @
fcc2badf
warning: cannot use constants which depend on generic parameters in types
--> $DIR/issue-73980.rs:12:9
|
LL | impl<T> X<T, [u8; L::<T>::S]> {}
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(const_evaluatable_unchecked)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
warning: 1 warning emitted
src/test/ui/polymorphization/promoted-function-2.rs
浏览文件 @
c0e853f2
// build-fail
// compile-flags:-Zpolymorphize=on
#![crate_type
=
"lib"
]
#![feature(
lazy_normalization_const
s,
rustc_attrs)]
//~^ WARN the feature `
lazy_normalization_const
s` is incomplete
#![feature(
generic_const_expr
s,
rustc_attrs)]
//~^ WARN the feature `
generic_const_expr
s` is incomplete
#[rustc_polymorphize_error]
fn
test
<
T
>
()
{
...
...
src/test/ui/polymorphization/promoted-function-2.stderr
浏览文件 @
c0e853f2
warning: the feature `
lazy_normalization_const
s` is incomplete and may not be safe to use and/or cause compiler crashes
warning: the feature `
generic_const_expr
s` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/promoted-function-2.rs:4:12
|
LL | #![feature(
lazy_normalization_const
s, rustc_attrs)]
| ^^^^^^^^^^^^^^^^^^^
^^^^^^
LL | #![feature(
generic_const_expr
s, rustc_attrs)]
| ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #7
2219 <https://github.com/rust-lang/rust/issues/72219
> for more information
= note: see issue #7
6560 <https://github.com/rust-lang/rust/issues/76560
> for more information
error: item has unused generic parameters
--> $DIR/promoted-function-2.rs:8:4
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录