Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax: Implement #![no_core] #27393

Merged
merged 2 commits into from
Aug 5, 2015
Merged

Conversation

alexcrichton
Copy link
Member

This commit is an implementation of RFC 1184 which tweaks the behavior of
the #![no_std] attribute and adds a new #![no_core] attribute. The
#![no_std] attribute now injects extern crate core at the top of the crate
as well as the libcore prelude into all modules (in the same manner as the
standard library's prelude). The #![no_core] attribute disables both std and
core injection.

Closes #27394

@rust-highfive
Copy link
Collaborator

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@@ -17,12 +17,6 @@
//!
//! There is no method to automatically inject this prelude, and this prelude is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence could be updated

@bors
Copy link
Contributor

bors commented Jul 30, 2015

☔ The latest upstream changes (presumably #27385) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton
Copy link
Member Author

I've also pushed a commit to make --test a bit more hygienic

@bors
Copy link
Contributor

bors commented Jul 30, 2015

☔ The latest upstream changes (presumably #27406) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton alexcrichton force-pushed the no-std-changes branch 4 times, most recently from c6abe01 to 5877903 Compare July 30, 2015 23:56
@brson
Copy link
Contributor

brson commented Jul 31, 2015

@bors r+

@bors
Copy link
Contributor

bors commented Jul 31, 2015

📌 Commit 5877903 has been approved by brson

@bors
Copy link
Contributor

bors commented Jul 31, 2015

⌛ Testing commit 5877903 with merge ea95ff6...

@bors
Copy link
Contributor

bors commented Jul 31, 2015

💔 Test failed - auto-mac-32-opt

@alexcrichton
Copy link
Member Author

@bors: r=brson

On Fri, Jul 31, 2015 at 10:55 AM, bors [email protected] wrote:

[image: 💔] Test failed - auto-mac-32-opt
http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5970


Reply to this email directly or view it on GitHub
#27393 (comment).

@bors
Copy link
Contributor

bors commented Jul 31, 2015

📌 Commit 6ed2a32 has been approved by brson

@bors
Copy link
Contributor

bors commented Jul 31, 2015

⌛ Testing commit 6ed2a32 with merge 6cd5e85...

@bors
Copy link
Contributor

bors commented Jul 31, 2015

💔 Test failed - auto-linux-64-opt

@alexcrichton
Copy link
Member Author

@bors: r=brson

On Fri, Jul 31, 2015 at 12:33 PM, bors [email protected] wrote:

[image: 💔] Test failed - auto-linux-64-opt
http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5921


Reply to this email directly or view it on GitHub
#27393 (comment).

@bors
Copy link
Contributor

bors commented Jul 31, 2015

📌 Commit df94d26 has been approved by brson

@bors
Copy link
Contributor

bors commented Jul 31, 2015

⌛ Testing commit df94d26 with merge b0c4634...

@bors
Copy link
Contributor

bors commented Aug 3, 2015

⌛ Testing commit 855ce95 with merge 797d29c...

@bors
Copy link
Contributor

bors commented Aug 3, 2015

💔 Test failed - auto-mac-64-opt

@alexcrichton
Copy link
Member Author

@bors: retry

On Mon, Aug 3, 2015 at 10:39 AM, bors [email protected] wrote:

[image: 💔] Test failed - auto-mac-64-opt
http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5958


Reply to this email directly or view it on GitHub
#27393 (comment).

@alexcrichton alexcrichton force-pushed the no-std-changes branch 4 times, most recently from 8dbe3e0 to 8ec313d Compare August 3, 2015 21:27
@alexcrichton
Copy link
Member Author

@bors: r=brson 8ec313d

This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of
the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The
`#![no_std]` attribute now injects `extern crate core` at the top of the crate
as well as the libcore prelude into all modules (in the same manner as the
standard library's prelude). The `#![no_core]` attribute disables both std and
core injection.

[rfc]: rust-lang/rfcs#1184
@bors
Copy link
Contributor

bors commented Aug 4, 2015

⌛ Testing commit 8ec313d with merge 31efc19...

@bors
Copy link
Contributor

bors commented Aug 4, 2015

💔 Test failed - auto-mac-64-nopt-t

@alexcrichton
Copy link
Member Author

@bors: r=brson 606d60e

@bors
Copy link
Contributor

bors commented Aug 4, 2015

⌛ Testing commit 606d60e with merge 1f6cc16...

@bors
Copy link
Contributor

bors commented Aug 4, 2015

💔 Test failed - auto-linux-64-x-android-t

@Gankra
Copy link
Contributor

Gankra commented Aug 4, 2015

../src/libstd/sys/unix/thread.rs:169:9: 169:24 error: unused import,
#[deny(unused_imports)] on by default
../src/libstd/sys/unix/thread.rs:169 use prelude::v1::*;
^~~~~~~~~~~~~~~

On Tue, Aug 4, 2015 at 12:38 PM, bors [email protected] wrote:

[image: 💔] Test failed - auto-linux-64-x-android-t
http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/5942


Reply to this email directly or view it on GitHub
#27393 (comment).

This commit removes the injection of `std::env::args()` from `--test` expanded
code, relying on the test runner itself to call this funciton. This is more
hygienic because we can't assume that `std` exists at the top layer all the
time, and it meaks the injected test module entirely self contained.
@alexcrichton
Copy link
Member Author

@bors: r=brson 0d83403

bors added a commit that referenced this pull request Aug 5, 2015
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of
the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The
`#![no_std]` attribute now injects `extern crate core` at the top of the crate
as well as the libcore prelude into all modules (in the same manner as the
standard library's prelude). The `#![no_core]` attribute disables both std and
core injection.

[rfc]: rust-lang/rfcs#1184

Closes #27394
@bors
Copy link
Contributor

bors commented Aug 5, 2015

⌛ Testing commit 0d83403 with merge dbe415a...

@bors bors merged commit 0d83403 into rust-lang:master Aug 5, 2015
@alexcrichton alexcrichton deleted the no-std-changes branch August 17, 2015 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants