Closed
Description
What is this?
This is a meta issue for tracking manual testing of "upgrading" crates to Rust 2018 preview. We're hoping to kick the tires for a lot of crates. There's a list below, but feel free to test your own additions and leave comments.
How to test a crate
The steps are described here in the transition guide, but here is a cheat sheet:
- Update nightly:
rustup update nightly
- Install rustfix if you haven't already:
cargo install cargo-fix --git https://github.com/rust-lang-nursery/rustfix
- Clone the crate in question
- Verify that it builds (if not, that's some other problem we better fix first):
cargo +nightly build
- Edit
src/lib.rs
and add#![feature(rust_2018_preview)]
- Verify that it still builds:
cargo +nightly build
- Create a commit, perhaps on a new branch (recommended name:
rust-2018-migration
):git commit -a -m 'add rust_2018_preview feature'
- Run rustfix:
cargo +nightly fix --prepare-for 2018
- Verify that it still builds:
cargo +nightly build
- Create another commit on that same branch:
git commit -a -m 'run rustfix
- Update to the new edition by adding the following to
Cargo.toml
:cargo-features = ["edition"]
package.edition = "2018"
- Verify that it still builds:
cargo +nightly build
- Create another commit on that same branch:
git commit -a -m 'upgraded to new edition
If all of this works, great! Leave a comment below, including a link to the commit or branch with the changes.
If you encounter an error due to the migration, leave a comment below with a link to the commit and the error!
Crate listing
- ✅ clap (branch here)
- ✅ futures-core and futures-io 0.2.x (branch here)
- ✅ cargo (branch here)
- ✅ bitflags (comment)
- ✅ serde (comment)
- ❌ libc (comment — libc fails to migrate #51210
- ❌ rand (comment — opened rand fails to migrate #51209
- ❌ rusty-machine (comment) — caveat, build works,
#[cfg(test)]
code fails, filed some kind of #[cfg] story for rustfix #51208 - ❌ faster (comment) —
faster
fails to migrate #51211 - ✅ clippy (comment)
- ✅ ipnetwork (comment)