Possible degradation in const generics #89334
Labels
A-const-generics
Area: const generics (parameters and arguments)
C-bug
Category: This is a bug.
F-generic_const_exprs
`#![feature(generic_const_exprs)]`
The following code compiles with rustc 1.56.0-nightly (4e28279 2021-07-31) but not rustc 1.56.0-nightly (5d68044 2021-08-30) or 1.57.0
As you see it compiles with the earlier compiler but not with the new one:
Meta
Build outputs
[user@machine as_mut_bug]$ rustup default nightly-2021-08-01-x86_64-unknown-linux-gnu info: using existing install for 'nightly-2021-08-01-x86_64-unknown-linux-gnu' info: default toolchain set to 'nightly-2021-08-01-x86_64-unknown-linux-gnu'
nightly-2021-08-01-x86_64-unknown-linux-gnu unchanged - rustc 1.56.0-nightly (4e28279 2021-07-31)
[user@machine as_mut_bug]$ cargo build
Compiling as_mut_bug v0.1.0 (/home/user/lazyhole/code/playground/rust-playground/as_mut_bug)
warning: the feature
const_generics
is incomplete and may not be safe to use and/or cause compiler crashes--> src/main.rs:1:12
|
1 | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note:
#[warn(incomplete_features)]
on by default= note: see issue #44580 #44580 for more information
warning: the feature
const_evaluatable_checked
is incomplete and may not be safe to use and/or cause compiler crashes--> src/main.rs:2:12
|
2 | #![feature(const_evaluatable_checked)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #76560 #76560 for more information
warning:
as_mut_bug
(bin "as_mut_bug") generated 2 warningsFinished dev [unoptimized + debuginfo] target(s) in 0.90s
[user@machine as_mut_bug]$ rustup default nightly-2021-08-31-x86_64-unknown-linux-gnu
info: using existing install for 'nightly-2021-08-31-x86_64-unknown-linux-gnu'
info: default toolchain set to 'nightly-2021-08-31-x86_64-unknown-linux-gnu'
nightly-2021-08-31-x86_64-unknown-linux-gnu unchanged - rustc 1.56.0-nightly (5d68044 2021-08-30)
[user@machine as_mut_bug]$ cargo build
Compiling as_mut_bug v0.1.0 (/home/user/lazyhole/code/playground/rust-playground/as_mut_bug)
warning: the feature
const_generics
is incomplete and may not be safe to use and/or cause compiler crashes--> src/main.rs:1:12
|
1 | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note:
#[warn(incomplete_features)]
on by default= note: see issue #44580 #44580 for more information
warning: the feature
const_evaluatable_checked
is incomplete and may not be safe to use and/or cause compiler crashes--> src/main.rs:2:12
|
2 | #![feature(const_evaluatable_checked)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #76560 #76560 for more information
error[E0283]: type annotations needed
--> src/main.rs:9:5
|
9 | AsMut<[[u8; T::ARRAY_SIZE]]>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter
Self
|
= note: cannot satisfy
Self: AsMut<[[u8; _]]>
note: required by a bound in
AsMut
For more information about this error, try
rustc --explain E0283
.warning:
as_mut_bug
(bin "as_mut_bug") generated 2 warningserror: could not compile
as_mut_bug
due to previous error; 2 warnings emitted[user@machine as_mut_bug]$
The text was updated successfully, but these errors were encountered: