Skip to content

Commit e728ee0

Browse files
authored
Rollup merge of rust-lang#59675 - SimonSapin:stable-alloc, r=alexcrichton
Stabilize the `alloc` crate. This implements RFC 2480: * rust-lang/rfcs#2480 * https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md Closes rust-lang#27783
2 parents 9a612b2 + fc928a1 commit e728ee0

28 files changed

+25
-43
lines changed

src/liballoc/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@
5151
//! default global allocator. It is not compatible with the libc allocator API.
5252
5353
#![allow(unused_attributes)]
54-
#![unstable(feature = "alloc",
55-
reason = "this library is unlikely to be stabilized in its current \
56-
form or name",
57-
issue = "27783")]
54+
#![stable(feature = "alloc", since = "1.36.0")]
5855
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
5956
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
6057
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]

src/liballoc/prelude/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//!
66
//! ```
77
//! # #![allow(unused_imports)]
8-
//! # #![feature(alloc)]
98
//! #![feature(alloc_prelude)]
109
//! extern crate alloc;
1110
//! use alloc::prelude::v1::*;

src/liballoc/raw_vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl<T, A: Alloc> RawVec<T, A> {
256256
/// # Examples
257257
///
258258
/// ```
259-
/// # #![feature(alloc, raw_vec_internals)]
259+
/// # #![feature(raw_vec_internals)]
260260
/// # extern crate alloc;
261261
/// # use std::ptr;
262262
/// # use alloc::raw_vec::RawVec;
@@ -460,7 +460,7 @@ impl<T, A: Alloc> RawVec<T, A> {
460460
/// # Examples
461461
///
462462
/// ```
463-
/// # #![feature(alloc, raw_vec_internals)]
463+
/// # #![feature(raw_vec_internals)]
464464
/// # extern crate alloc;
465465
/// # use std::ptr;
466466
/// # use alloc::raw_vec::RawVec;

src/libarena/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#![deny(rust_2018_idioms)]
1515
#![cfg_attr(not(stage0), deny(internal))]
1616

17-
#![feature(alloc)]
1817
#![feature(core_intrinsics)]
1918
#![feature(dropck_eyepatch)]
2019
#![feature(raw_vec_internals)]

src/libpanic_unwind/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
#![deny(rust_2018_idioms)]
2121

22-
#![feature(allocator_api)]
23-
#![feature(alloc)]
2422
#![feature(core_intrinsics)]
2523
#![feature(lang_items)]
2624
#![feature(libc)]

src/libstd/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@
229229
#![feature(align_offset)]
230230
#![feature(alloc_error_handler)]
231231
#![feature(alloc_layout_extra)]
232-
#![feature(alloc)]
233232
#![feature(allocator_api)]
234233
#![feature(allocator_internals)]
235234
#![feature(allow_internal_unsafe)]

src/test/run-make-fulldeps/sysroot-crates-are-unstable/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
# This is a whitelist of files which are stable crates or simply are not crates,
99
# we don't check for the instability of these crates as they're all stable!
10-
STABLE_CRATES = ['std', 'core', 'proc_macro', 'rsbegin.o', 'rsend.o', 'dllcrt2.o', 'crt2.o',
11-
'clang_rt']
10+
STABLE_CRATES = ['std', 'alloc', 'core', 'proc_macro',
11+
'rsbegin.o', 'rsend.o', 'dllcrt2.o', 'crt2.o', 'clang_rt']
1212

1313

1414
def convert_to_string(s):

src/test/run-pass/array-slice-vec/vec-macro-no-std.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// ignore-emscripten no no_std executables
44

5-
#![feature(lang_items, start, rustc_private, alloc)]
5+
#![feature(lang_items, start, rustc_private)]
66
#![no_std]
77

88
extern crate std as other;

src/test/run-pass/extern/extern-prelude-core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-pass
2-
#![feature(extern_prelude, lang_items, start, alloc)]
2+
#![feature(extern_prelude, lang_items, start)]
33
#![no_std]
44

55
extern crate std as other;

src/test/run-pass/extern/extern-prelude-core.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
warning: the feature `extern_prelude` has been stable since 1.30.0 and no longer requires an attribute to enable
22
--> $DIR/extern-prelude-core.rs:2:12
33
|
4-
LL | #![feature(extern_prelude, lang_items, start, alloc)]
4+
LL | #![feature(extern_prelude, lang_items, start)]
55
| ^^^^^^^^^^^^^^
66
|
77
= note: #[warn(stable_features)] on by default

0 commit comments

Comments
 (0)