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

Transition the code to Rust 2018 #500

Closed
1 task
phil-opp opened this issue Nov 17, 2018 · 2 comments · Fixed by #501
Closed
1 task

Transition the code to Rust 2018 #500

phil-opp opened this issue Nov 17, 2018 · 2 comments · Fixed by #501

Comments

@phil-opp
Copy link
Owner

phil-opp commented Nov 17, 2018

Rust 2018 is about to be released and it's already the default for new crates on nightly. So we should update this crate and the blog posts to the 2018 edition of Rust.

After transitioning:

  • Use #![cfg_attr(not(test), no_std)] instead of #[cfg(test)] extern crate std as proposed here.
@phil-opp phil-opp added help wanted We could use help for this issue/pull request! relnotes "Release notes" – Notable changes that are rendered on the blog. labels Nov 17, 2018
@lilyball
Copy link

With Rust 2015, you can use #![cfg_attr(not(test), no_std)] just by adding

#[cfg(test)]
extern crate core;

I took my copy of the source, removed the 2018 edition, and added that one snippet (to lib.rs and to bin/test-exception-double-fault-stack-overflow.rs) and it compiled.

@phil-opp
Copy link
Owner Author

Yeah, but this wouldn't really be an improvement over the current situation (#[cfg(test)] extern crate std and unconditional #![no_std]).

@phil-opp phil-opp removed help wanted We could use help for this issue/pull request! relnotes "Release notes" – Notable changes that are rendered on the blog. labels Nov 18, 2018
bors bot added a commit that referenced this issue Nov 19, 2018
501: Update to the 2018 edition of Rust r=phil-opp a=phil-opp

This updates the blog to use the upcoming [2018 edition](https://rust-lang-nursery.github.io/edition-guide/rust-2018/index.html) of Rust, which is currently in beta and already the default on nightly. It changes a few local import paths (now with a `crate::` prefix) and removes all `extern crate` definitions and `macro_use` attributes.

This PR changes a lot of code across all posts, so there might be some things in the posts that I forgot to update. Please let me know if you see anything! [Preview of the changes](https://rust-2018--blog-os.netlify.com/)

Fixes #499 
Fixes #500

Co-authored-by: Philipp Oppermann <dev@phil-opp.com>
@bors bors bot closed this as completed in #501 Nov 19, 2018
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 a pull request may close this issue.

2 participants