Skip to content

[E0658]: panicking in constant functions is unstable #254

Closed
@shzhxh

Description

@shzhxh

错误的提示信息如下:

error[E0658]: panicking in constant functions is unstable
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/x86_64-0.14.7/src/addr.rs:547:5
    |
547 |     assert!(align.is_power_of_two(), "`align` must be a power of two");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #51999 <https://github.com/rust-lang/rust/issues/51999> for more information
    = help: add `#![feature(const_panic)]` to the crate attributes to enable
    = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: panicking in constant functions is unstable
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/x86_64-0.14.7/src/addr.rs:559:5
    |
559 |     assert!(align.is_power_of_two(), "`align` must be a power of two");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #51999 <https://github.com/rust-lang/rust/issues/51999> for more information
    = help: add `#![feature(const_panic)]` to the crate attributes to enable
    = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: panicking in constant functions is unstable
  --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/x86_64-0.14.7/src/structures/gdt.rs:75:9
   |
75 | /         assert!(
76 | |             next_free <= 8,
77 | |             "initializing a GDT from a slice requires it to be **at most** 8 elements."
78 | |         );
   | |__________^
   |
   = note: see issue #51999 <https://github.com/rust-lang/rust/issues/51999> for more information
   = help: add `#![feature(const_panic)]` to the crate attributes to enable
   = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: panicking in constant functions is unstable
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/x86_64-0.14.7/src/structures/gdt.rs:168:17
    |
168 |                 panic!("GDT full");
    |                 ^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #51999 <https://github.com/rust-lang/rust/issues/51999> for more information
    = help: add `#![feature(const_panic)]` to the crate attributes to enable
    = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0658`.
error: could not compile `x86_64` due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
Error: Process completed with exit code 101.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions