Skip to content

Commit 6bd122f

Browse files
author
Keegan McAllister
committed
---
yaml --- r: 183274 b: refs/heads/beta c: d788588 h: refs/heads/master v: v3
1 parent 1c80f92 commit 6bd122f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+77
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 67350bc8681d6df212817644cad7c748039a6238
34+
refs/heads/beta: d788588dce5525b2bf5674b0c90c791a70582330
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: eb836bf767aa1d8d4cba488a9091cde3c0ab4b2f

branches/beta/src/doc/reference.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,6 +2467,12 @@ The currently implemented features of the reference compiler are:
24672467

24682468
* `associated_types` - Allows type aliases in traits. Experimental.
24692469

2470+
* `no_std` - Allows the `#![no_std]` crate attribute, which disables the implicit
2471+
`extern crate std`. This typically requires use of the unstable APIs
2472+
behind the libstd "facade", such as libcore and libcollections. It
2473+
may also cause problems when using syntax extensions, including
2474+
`#[derive]`.
2475+
24702476
If a feature is promoted to a language feature, then all existing programs will
24712477
start to receive compilation warnings about #[feature] directives which enabled
24722478
the new feature (because the directive is no longer necessary). However, if a

branches/beta/src/doc/trpl/unsafe.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ attribute attached to the crate.
433433
```ignore
434434
// a minimal library
435435
#![crate_type="lib"]
436+
#![feature(no_std)]
436437
#![no_std]
437438
# // fn main() {} tricked you, rustdoc!
438439
```
@@ -446,8 +447,8 @@ The function marked `#[start]` is passed the command line parameters
446447
in the same format as C:
447448

448449
```
450+
#![feature(lang_items, start, no_std)]
449451
#![no_std]
450-
#![feature(lang_items, start)]
451452
452453
// Pull in the system libc library for what crt0.o likely requires
453454
extern crate libc;
@@ -473,6 +474,7 @@ correct ABI and the correct name, which requires overriding the
473474
compiler's name mangling too:
474475

475476
```ignore
477+
#![feature(no_std)]
476478
#![no_std]
477479
#![no_main]
478480
#![feature(lang_items, start)]
@@ -528,8 +530,8 @@ As an example, here is a program that will calculate the dot product of two
528530
vectors provided from C, using idiomatic Rust practices.
529531

530532
```
533+
#![feature(lang_items, start, no_std)]
531534
#![no_std]
532-
#![feature(lang_items, start)]
533535
534536
# extern crate libc;
535537
extern crate core;
@@ -652,8 +654,8 @@ and one for deallocation. A freestanding program that uses the `Box`
652654
sugar for dynamic allocations via `malloc` and `free`:
653655

654656
```
657+
#![feature(lang_items, box_syntax, start, no_std)]
655658
#![no_std]
656-
#![feature(lang_items, box_syntax, start)]
657659
658660
extern crate libc;
659661

branches/beta/src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
6666
html_root_url = "http://doc.rust-lang.org/nightly/")]
6767

68+
#![feature(no_std)]
6869
#![no_std]
6970
#![feature(lang_items, unsafe_destructor)]
7071
#![feature(box_syntax)]

branches/beta/src/libcollections/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#![cfg_attr(test, feature(test))]
3434
#![cfg_attr(test, allow(deprecated))] // rand
3535

36+
#![feature(no_std)]
3637
#![no_std]
3738

3839
#[macro_use]

branches/beta/src/libcore/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
html_root_url = "http://doc.rust-lang.org/nightly/",
5757
html_playground_url = "http://play.rust-lang.org/")]
5858

59+
#![feature(no_std)]
5960
#![no_std]
6061
#![allow(raw_pointer_derive)]
6162
#![deny(missing_docs)]

branches/beta/src/liblibc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#![cfg_attr(not(feature = "cargo-build"), staged_api)]
1717
#![cfg_attr(not(feature = "cargo-build"), feature(core))]
1818
#![feature(int_uint)]
19+
#![feature(no_std)]
1920
#![no_std]
2021
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2122
html_favicon_url = "http://www.rust-lang.org/favicon.ico",

branches/beta/src/librand/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
html_root_url = "http://doc.rust-lang.org/nightly/",
2424
html_playground_url = "http://play.rust-lang.org/")]
2525
#![feature(int_uint)]
26+
#![feature(no_std)]
2627
#![no_std]
2728
#![unstable(feature = "rand")]
2829
#![feature(staged_api)]

branches/beta/src/librustc_bitflags/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#![feature(staged_api)]
1313
#![staged_api]
1414
#![crate_type = "rlib"]
15+
#![feature(no_std)]
1516
#![no_std]
1617
#![unstable(feature = "rustc_private")]
1718

branches/beta/src/librustc_driver/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct RH<'a> {
4343
sub: &'a [RH<'a>]
4444
}
4545

46-
static EMPTY_SOURCE_STR: &'static str = "#![no_std]";
46+
static EMPTY_SOURCE_STR: &'static str = "#![feature(no_std)] #![no_std]";
4747

4848
struct ExpectErrorEmitter {
4949
messages: Vec<String>

branches/beta/src/libstd/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
#![cfg_attr(test, feature(test))]
125125

126126
// Don't link to std. We are std.
127+
#![feature(no_std)]
127128
#![no_std]
128129

129130
#![deny(missing_docs)]

branches/beta/src/libsyntax/feature_gate.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
122122
("staged_api", "1.0.0", Active),
123123

124124
// Allows using items which are missing stability attributes
125-
("unmarked_api", "1.0.0", Active)
125+
("unmarked_api", "1.0.0", Active),
126+
127+
// Allows using #![no_std]
128+
("no_std", "1.0.0", Active),
126129
];
127130

128131
enum Status {
@@ -466,6 +469,11 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
466469
attr.span,
467470
"language items are subject to change");
468471
}
472+
473+
if attr.check_name("no_std") {
474+
self.gate_feature("no_std", attr.span,
475+
"no_std is experimental");
476+
}
469477
}
470478

471479
fn visit_pat(&mut self, pattern: &ast::Pat) {

branches/beta/src/libunicode/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
3030
html_root_url = "http://doc.rust-lang.org/nightly/",
3131
html_playground_url = "http://play.rust-lang.org/")]
32+
#![feature(no_std)]
3233
#![no_std]
3334
#![feature(slicing_syntax)]
3435
#![feature(int_uint)]

branches/beta/src/test/auxiliary/lang-item-public.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(no_std)]
1112
#![no_std]
1213
#![feature(lang_items)]
1314

branches/beta/src/test/auxiliary/no_std_crate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(no_std)]
1112
#![no_std]
1213

1314
pub fn foo() {}

branches/beta/src/test/auxiliary/weak-lang-items.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// This aux-file will require the eh_personality function to be codegen'd, but
1414
// it hasn't been defined just yet. Make sure we don't explode.
1515

16+
#![feature(no_std)]
1617
#![no_std]
1718
#![crate_type = "rlib"]
1819

branches/beta/src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#![crate_type = "lib"]
1515
#![feature(lang_items)]
16+
#![feature(no_std)]
1617
#![no_std]
1718

1819
#[lang="sized"]

branches/beta/src/test/compile-fail/bad-mid-path-type-params.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// ignore-tidy-linelength
1212

13+
#![feature(no_std)]
1314
#![no_std]
1415
#![feature(lang_items)]
1516

branches/beta/src/test/compile-fail/derive-no-std-not-supported.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(no_std)]
1112
#![no_std]
1213

1314
extern crate core;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2105 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![no_std] //~ ERROR no_std is experimental
12+
13+
fn main() {}

branches/beta/src/test/compile-fail/issue-19660.rs

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

1111
// error-pattern: requires `copy` lang_item
1212

13-
#![feature(lang_items, start)]
13+
#![feature(lang_items, start, no_std)]
1414
#![no_std]
1515

1616
#[lang = "sized"]

branches/beta/src/test/compile-fail/lang-item-missing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
// error-pattern: requires `sized` lang_item
1515

16+
#![feature(start, no_std)]
1617
#![no_std]
17-
#![feature(start)]
1818

1919
#[start]
2020
fn start(argc: isize, argv: *const *const u8) -> isize {

branches/beta/src/test/compile-fail/lint-dead-code-1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(no_std)]
1112
#![no_std]
1213
#![allow(unused_variables)]
1314
#![allow(non_camel_case_types)]

branches/beta/src/test/compile-fail/privacy1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(lang_items, start)]
11+
#![feature(lang_items, start, no_std)]
1212
#![no_std] // makes debugging this test *a lot* easier (during resolve)
1313

1414
#[lang="sized"]

branches/beta/src/test/compile-fail/privacy2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(start)]
11+
#![feature(start, no_std)]
1212
#![no_std] // makes debugging this test *a lot* easier (during resolve)
1313

1414
// Test to make sure that globs don't leak in regular `use` statements.

branches/beta/src/test/compile-fail/privacy3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(start)]
11+
#![feature(start, no_std)]
1212
#![no_std] // makes debugging this test *a lot* easier (during resolve)
1313

1414
// Test to make sure that private items imported through globs remain private

branches/beta/src/test/compile-fail/privacy4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(lang_items, start)]
11+
#![feature(lang_items, start, no_std)]
1212
#![no_std] // makes debugging this test *a lot* easier (during resolve)
1313

1414
#[lang = "sized"] pub trait Sized {}

branches/beta/src/test/compile-fail/regions-bounded-method-type-parameters-trait-bound.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(lang_items, no_std)]
1112
#![no_std]
12-
#![feature(lang_items)]
1313

1414
// Check that explicit region bounds are allowed on the various
1515
// nominal types (but not on other types) and that they are type

branches/beta/src/test/compile-fail/regions-struct-not-wf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// Various examples of structs whose fields are not well-formed.
1212

13+
#![feature(no_std)]
1314
#![no_std]
1415
#![allow(dead_code)]
1516

branches/beta/src/test/compile-fail/required-lang-item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(lang_items)]
11+
#![feature(lang_items, no_std)]
1212
#![no_std]
1313

1414
#[lang="sized"] pub trait Sized {}

branches/beta/src/test/compile-fail/weak-lang-item.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// error-pattern: language item required, but not found: `stack_exhausted`
1414
// error-pattern: language item required, but not found: `eh_personality`
1515

16+
#![feature(no_std)]
1617
#![no_std]
1718

1819
extern crate core;

branches/beta/src/test/pretty/issue-4264.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![feature(no_std)]
12
#![no_std]
23
#[prelude_import]
34
use std::prelude::v1::*;

branches/beta/src/test/run-make/mismatching-target-triples/bar.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10+
#![feature(no_std)]
1011
#![no_std]
1112
extern crate foo;

branches/beta/src/test/run-make/mismatching-target-triples/foo.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10+
#![feature(no_std)]
1011
#![no_std]
1112
#![crate_type = "lib"]

branches/beta/src/test/run-make/no-duplicate-libs/bar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(lang_items, no_std)]
1112
#![no_std]
12-
#![feature(lang_items)]
1313
#![crate_type = "dylib"]
1414

1515
extern crate libc;

branches/beta/src/test/run-make/no-duplicate-libs/foo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(lang_items, no_std)]
1112
#![no_std]
12-
#![feature(lang_items)]
1313
#![crate_type = "dylib"]
1414

1515
extern crate libc;

branches/beta/src/test/run-make/pretty-expanded-hygiene/input.pp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// minimal junk
12+
#![feature(no_std)]
1213
#![no_std]
1314

1415

branches/beta/src/test/run-make/pretty-expanded-hygiene/input.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// minimal junk
12+
#![feature(no_std)]
1213
#![no_std]
1314

1415
macro_rules! foo {

branches/beta/src/test/run-make/simd-ffi/simd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#![crate_type = "lib"]
1313
// we can compile to a variety of platforms, because we don't need
1414
// cross-compiled standard libraries.
15+
#![feature(no_std)]
1516
#![no_std]
1617

1718
#![feature(simd, simd_ffi, link_llvm_intrinsics, lang_items)]

branches/beta/src/test/run-make/target-specs/foo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(lang_items)]
11+
#![feature(lang_items, no_std)]
1212
#![no_std]
1313

1414
#[lang="copy"]

0 commit comments

Comments
 (0)