Skip to content

Commit

Permalink
Remove impl const and ~const in the standard library
Browse files Browse the repository at this point in the history
Otherwise it will fail to compile on nightly-2023-04-19

See rust-lang/rust#110395
  • Loading branch information
equation314 committed Apr 20, 2023
1 parent dbbf708 commit 542e747
Show file tree
Hide file tree
Showing 22 changed files with 89 additions and 98 deletions.
3 changes: 1 addition & 2 deletions crates/axerrno/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
//! [`std::io::ErrorKind`]: https://doc.rust-lang.org/std/io/enum.ErrorKind.html

#![no_std]
#![feature(const_trait_impl)]

mod linux_errno {
include!(concat!(env!("OUT_DIR"), "/linux_errno.rs"));
Expand Down Expand Up @@ -167,7 +166,7 @@ impl AxError {
}
}

impl const From<AxError> for LinuxError {
impl From<AxError> for LinuxError {
fn from(e: AxError) -> Self {
use AxError::*;
match e {
Expand Down
4 changes: 2 additions & 2 deletions crates/capability/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
//!

#![no_std]
#![feature(const_trait_impl)]

bitflags::bitflags! {
/// Capabilities (access rights).
Expand Down Expand Up @@ -132,7 +131,8 @@ impl<T> WithCap<T> {
}
}

impl const From<CapError> for axerrno::AxError {
impl From<CapError> for axerrno::AxError {
#[inline]
fn from(_: CapError) -> Self {
Self::PermissionDenied
}
Expand Down
1 change: 1 addition & 0 deletions crates/driver_block/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#![no_std]
#![feature(doc_auto_cfg)]
#![feature(const_trait_impl)]

#[cfg(feature = "ramdisk")]
pub mod ramdisk;
Expand Down
2 changes: 1 addition & 1 deletion crates/driver_block/src/ramdisk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl RamDisk {
}
}

impl BaseDriverOps for RamDisk {
impl const BaseDriverOps for RamDisk {
fn device_type(&self) -> DeviceType {
DeviceType::Block
}
Expand Down
1 change: 0 additions & 1 deletion crates/linked_list/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//! [1]: https://github.com/Rust-for-Linux/linux/blob/rust/rust/kernel/linked_list.rs

#![no_std]
#![feature(const_trait_impl)]

mod linked_list;

Expand Down
2 changes: 1 addition & 1 deletion crates/linked_list/src/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl<G: AdapterWrapped> List<G> {
}
}

impl<G: AdapterWrapped> const Default for List<G> {
impl<G: AdapterWrapped> Default for List<G> {
fn default() -> Self {
Self::new()
}
Expand Down
Loading

0 comments on commit 542e747

Please sign in to comment.