Skip to content

Commit

Permalink
Do not require nightly for no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Jul 7, 2024
1 parent 1f776c0 commit fcd5d20
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@
#![forbid(missing_docs, unsafe_op_in_unsafe_fn)]
#![cfg_attr(not(feature = "std"), no_std)]
#![feature(allocator_api)]
#![cfg_attr(any(feature = "alloc"), feature(new_uninit))]
#![cfg_attr(any(feature = "alloc"), feature(get_mut_unchecked))]
#![cfg_attr(feature = "alloc", feature(allocator_api))]
#![cfg_attr(feature = "alloc", feature(new_uninit))]
#![cfg_attr(feature = "alloc", feature(get_mut_unchecked))]

#[cfg(feature = "alloc")]
extern crate alloc;
Expand All @@ -249,7 +249,6 @@ use alloc::boxed::Box;
use alloc::sync::Arc;

use core::{
alloc::AllocError,
cell::UnsafeCell,
convert::Infallible,
marker::PhantomData,
Expand All @@ -259,6 +258,9 @@ use core::{
ptr::{self, NonNull},
};

#[cfg(feature = "alloc")]
use core::alloc::AllocError;

#[doc(hidden)]
pub mod __internal;
#[doc(hidden)]
Expand Down Expand Up @@ -1092,6 +1094,7 @@ unsafe impl<T, E> PinInit<T, E> for T {
}

/// Smart pointer that can initialize memory in-place.
#[cfg(feature = "alloc")]
pub trait InPlaceInit<T>: Sized {
/// Use the given pin-initializer to pin-initialize a `T` inside of a new smart pointer of this
/// type.
Expand Down

0 comments on commit fcd5d20

Please sign in to comment.