rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
94.73k stars 12.21k forks source link

Nightly Regression on Feature Gate Missing for "const_fn_trait_bounds" #84977

Closed HTGAzureX1212 closed 3 years ago

HTGAzureX1212 commented 3 years ago

Code

I tried this code:

// this was related to the `x86_64` crate so I am providing a link to the corresponding lines:
// https://github.com/rust-osdev/x86_64/blob/master/src/structures/paging/frame.rs#L18
// https://github.com/rust-osdev/x86_64/blob/master/src/structures/paging/page.rs#L62
// https://github.com/rust-osdev/x86_64/blob/master/src/structures/paging/page.rs#L150

I expected to see this happen:

The compilation should be completed successfully without any errors being emitted by the compiler.

Instead, this happened:

The compilation failed with several errors mentioning about the "const_fn_trait_bounds" feature:

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
  --> <path redacted>\x86_64-0.14.0\src\structures\paging\frame.rs:18:6
   |
18 | impl<S: PageSize> PhysFrame<S> {
   |      ^
   |
   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
   = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
  --> <path redacted>\x86_64-0.14.0\src\structures\paging\page.rs:62:6
   |
62 | impl<S: PageSize> Page<S> {
   |      ^
   |
   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
   = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
   --> <path redacted>\x86_64-0.14.0\src\structures\paging\page.rs:150:6
    |
150 | impl<S: NotGiantPageSize> Page<S> {
    |      ^
    |
    = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

error: aborting due to 3 previous errors

Version it worked on

It most recently worked on (taken from the x86_64 crate's GitHub CI):

rustc --version --verbose

rustc 1.53.0-nightly (968425893 2021-04-26)
binary: rustc
commit-hash: 9684258936dabda2ba49d4c67f041a6baf388348
commit-date: 2021-04-26
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Version with regression

rustc --version --verbose:

rustc 1.53.0-nightly (478a07df0 2021-04-29)
binary: rustc
commit-hash: 478a07df05e3fe8df964291d8b25dd80b7e0e76b
commit-date: 2021-04-29
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Backtrace

Backtrace

``` None ```

@rustbot modify labels: +regression-from-nightly-to-nightly -regression-untriaged

HTGAzureX1212 commented 3 years ago

This is solved by updating to the new 0.14.1-beta version of the x86_64 crate (reference: https://github.com/rust-osdev/x86_64/pull/250)