Skip to content

Commit 542e747

Browse files
committed
Remove impl const and ~const in the standard library
Otherwise it will fail to compile on nightly-2023-04-19 See rust-lang/rust#110395
1 parent dbbf708 commit 542e747

File tree

22 files changed

+89
-98
lines changed

22 files changed

+89
-98
lines changed

crates/axerrno/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
//! [`std::io::ErrorKind`]: https://doc.rust-lang.org/std/io/enum.ErrorKind.html
1111
1212
#![no_std]
13-
#![feature(const_trait_impl)]
1413

1514
mod linux_errno {
1615
include!(concat!(env!("OUT_DIR"), "/linux_errno.rs"));
@@ -167,7 +166,7 @@ impl AxError {
167166
}
168167
}
169168

170-
impl const From<AxError> for LinuxError {
169+
impl From<AxError> for LinuxError {
171170
fn from(e: AxError) -> Self {
172171
use AxError::*;
173172
match e {

crates/capability/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
//!
2828
2929
#![no_std]
30-
#![feature(const_trait_impl)]
3130

3231
bitflags::bitflags! {
3332
/// Capabilities (access rights).
@@ -132,7 +131,8 @@ impl<T> WithCap<T> {
132131
}
133132
}
134133

135-
impl const From<CapError> for axerrno::AxError {
134+
impl From<CapError> for axerrno::AxError {
135+
#[inline]
136136
fn from(_: CapError) -> Self {
137137
Self::PermissionDenied
138138
}

crates/driver_block/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
#![no_std]
44
#![feature(doc_auto_cfg)]
5+
#![feature(const_trait_impl)]
56

67
#[cfg(feature = "ramdisk")]
78
pub mod ramdisk;

crates/driver_block/src/ramdisk.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl RamDisk {
4444
}
4545
}
4646

47-
impl BaseDriverOps for RamDisk {
47+
impl const BaseDriverOps for RamDisk {
4848
fn device_type(&self) -> DeviceType {
4949
DeviceType::Block
5050
}

crates/linked_list/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//! [1]: https://github.com/Rust-for-Linux/linux/blob/rust/rust/kernel/linked_list.rs
66
77
#![no_std]
8-
#![feature(const_trait_impl)]
98

109
mod linked_list;
1110

crates/linked_list/src/linked_list.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl<G: AdapterWrapped> List<G> {
207207
}
208208
}
209209

210-
impl<G: AdapterWrapped> const Default for List<G> {
210+
impl<G: AdapterWrapped> Default for List<G> {
211211
fn default() -> Self {
212212
Self::new()
213213
}

0 commit comments

Comments
 (0)