Skip to content

Commit 9e7e06a

Browse files
Minor fixes
1 parent 301d090 commit 9e7e06a

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

library/std/src/ffi/os_str.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#[cfg(test)]
22
mod tests;
33

4+
use crate::alloc::Global;
45
use crate::borrow::{Borrow, Cow};
56
use crate::cmp;
67
use crate::collections::TryReserveError;

library/std/src/io/impls.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[cfg(test)]
22
mod tests;
33

4-
use crate::alloc::Allocator;
4+
use crate::alloc::{Allocator, self};
55
use crate::cmp;
66
use crate::collections::VecDeque;
77
use crate::fmt;
@@ -419,7 +419,7 @@ where
419419
#[stable(feature = "vecdeque_read_write", since = "1.63.0")]
420420
impl<A: Allocator, const _COOP_PREFERRED: bool> Read for VecDeque<u8, A, _COOP_PREFERRED>
421421
where
422-
[(); co_alloc_metadata_num_slots_with_preference::<A>(_COOP_PREFERRED)]:,
422+
[(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(_COOP_PREFERRED)]:,
423423
{
424424
/// Fill `buf` with the contents of the "front" slice as returned by
425425
/// [`as_slices`][`VecDeque::as_slices`]. If the contained byte slices of the `VecDeque` are
@@ -446,7 +446,7 @@ where
446446
#[stable(feature = "vecdeque_read_write", since = "1.63.0")]
447447
impl<A: Allocator, const _COOP_PREFERRED: bool> Write for VecDeque<u8, A, _COOP_PREFERRED>
448448
where
449-
[(); co_alloc_metadata_num_slots_with_preference::<A>(_COOP_PREFERRED)]:,
449+
[(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(_COOP_PREFERRED)]:,
450450
{
451451
#[inline]
452452
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {

library/std/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@
214214
#![needs_panic_runtime]
215215
//
216216
// Lints:
217+
#![allow(incomplete_features)]
218+
#![feature(generic_const_exprs)]
219+
#![feature(global_co_alloc)]
220+
#![feature(global_co_alloc_plvec)]
217221
#![warn(deprecated_in_future)]
218222
#![warn(missing_docs)]
219223
#![warn(missing_debug_implementations)]

library/std/src/path.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#[cfg(test)]
7171
mod tests;
7272

73+
use crate::alloc::{Global, self};
7374
use crate::borrow::{Borrow, Cow};
7475
use crate::cmp;
7576
use crate::collections::TryReserveError;
@@ -3143,7 +3144,7 @@ impl AsRef<Path> for str {
31433144
#[stable(feature = "rust1", since = "1.0.0")]
31443145
impl<const COOP_PREFERRED: bool> AsRef<Path> for String<COOP_PREFERRED>
31453146
where
3146-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:,
3147+
[(); alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:,
31473148
{
31483149
#[inline]
31493150
fn as_ref(&self) -> &Path {

library/std/src/sys/unix/thread_local_dtor.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
#![cfg(target_thread_local)]
22
#![unstable(feature = "thread_local_internals", issue = "none")]
3-
#![feature(global_co_alloc_plvec)]
43

54
//! Provides thread-local destructors without an associated "key", which
65
//! can be more efficient.
76
8-
use core::alloc::PlVec;
9-
107
// Since what appears to be glibc 2.18 this symbol has been shipped which
118
// GCC and clang both use to invoke destructors in thread_local globals, so
129
// let's do the same!
@@ -69,7 +66,7 @@ pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) {
6966
REGISTERED.set(true);
7067
}
7168

72-
type List = PlVec<(*mut u8, unsafe extern "C" fn(*mut u8))>;
69+
type List = alloc::vec::PlVec<(*mut u8, unsafe extern "C" fn(*mut u8))>;
7370

7471
#[thread_local]
7572
static DTORS: Cell<*mut List> = Cell::new(ptr::null_mut());

library/std/src/sys_common/thread_local_dtor.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
1313
#![unstable(feature = "thread_local_internals", issue = "none")]
1414
#![allow(dead_code)]
15-
#![feature(global_co_alloc_plvec)]
1615

1716
use crate::ptr;
1817
use crate::sys_common::thread_local_key::StaticKey;

0 commit comments

Comments
 (0)