Skip to content

unstable alloc crate can be used without feature gates on the 2018 edition #54006

Closed
@japaric

Description

@japaric

STR

This compiles when edition = "2018"

// crate-type: lib
#![no_std]

use alloc::vec;

fn foo() {
    let mut xs = vec![];
    xs.push(0);
}

This doesn't compile when edition = "2015" because it needs a feature gate.

// crate-type: lib
#![no_std]

extern crate alloc; //~ ERROR use of unstable library feature `alloc`

use alloc::vec;

fn foo() {
    let mut xs = vec![];
    xs.push(0);
}

Meta

$ rustc -V
rustc 1.30.0-nightly (6e0f1cc15 2018-09-05)

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions