Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shzhxh opened this issue Dec 31, 2021 · 1 comment
Closed

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

shzhxh opened this issue Dec 31, 2021 · 1 comment

Comments

@shzhxh
Copy link
Contributor

shzhxh commented Dec 31, 2021

错误的提示信息如下:

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.
@shzhxh
Copy link
Contributor Author

shzhxh commented Dec 31, 2021

解决者: @elliott10
原因分析:此问题由于依赖库x86_64从0.14.6升级到0.14.7而产生。
解决方法:把工具链的版本从nightly-2021-07-27提升到nightly-2021-11-02。另外,子模块rboot的工具链也要做相应的提升。

@shzhxh shzhxh closed this as completed Dec 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant