Skip to content

initial draft of 'testing rust 2018' #286

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

Merged
merged 3 commits into from
Oct 30, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove idiom lints
  • Loading branch information
steveklabnik committed Oct 30, 2018
commit bf3ec50d0db26c46cd6f1e03da8c22bc0d52ebd7
22 changes: 1 addition & 21 deletions _posts/2018-10-29-help-test-rust-2018.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,4 @@ edition = "2018"
```

See that `edition = "2018"`? That's what opts you in to the new features.
Set it, `cargo +beta build`, and you should be good to go!

## Writing idiomatic code

We have some new lints that suggest using certain idioms in your Rust 2018
code. We don't have them turned on by default yet. To see what your code would
look like, you can use `cargo fix`:

```console
$ cargo +beta fix --edition-idioms
```

If things look great, or things look terrible, please let us know! We hope to make
these lints warn by default after gaining some experience with them and working
out the bugs.

> The `--edition-idioms` flag applies only to the "current crate"; if you want
> to run it against a workspace is necessary to use a workaround with `RUSTFLAGS`
> in order to execute it in all the workspace members.
>
> $ RUSTFLAGS='-Wrust_2018_idioms' cargo fix --all
Set it, `cargo +beta build`, and you should be good to go!