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

Rust 2018 migration #2821

Merged
merged 4 commits into from
May 30, 2018
Merged

Rust 2018 migration #2821

merged 4 commits into from
May 30, 2018

Conversation

mati865
Copy link
Contributor

@mati865 mati865 commented May 30, 2018

Clippy being nightly-only crate can easily migrate to new Rust edition and start using new features.

This PR gives insight of required changes and is was created to open discussion about the migration.
I think it looks mostly fine although I'm not sure about setting edition in Cargo.toml just yet.

@mati865
Copy link
Contributor Author

mati865 commented May 30, 2018

Meh

$ npm install remark-cli remark-lint
npm ERR! code E429
npm ERR! 429 Too Many Requests: remark-lint@latest
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2018-05-30T09_22_58_988Z-debug.log

@mati865 mati865 closed this May 30, 2018
@mati865 mati865 reopened this May 30, 2018
@oli-obk
Copy link
Contributor

oli-obk commented May 30, 2018

Yea, we're ddosing npm -.- there's a commit in some PR, but it hasn't been merged yet

@@ -153,7 +153,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
}

fn create_new_without_default_suggest_msg(ty: Ty) -> String {
#[rustfmt_skip]
#[cfg_attr(rustfmt, rustfmt_skip)]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that should be #[rustfmt::skip] without the cfg_attr

Copy link
Contributor Author

@mati865 mati865 May 30, 2018

Choose a reason for hiding this comment

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

I also thought about it but decided to keep it more consistent with current code base.

click here for `rg` output
$ rg "rustfmt" .     
pre_publish.sh
23:echo "remember to add a git tag and running 'cargo test' before committing the rustfmt changes"

tests/trim_multiline.rs
16:#[cfg_attr(rustfmt, rustfmt_skip)]
41:#[cfg_attr(rustfmt, rustfmt_skip)]

tests/needless_continue_helpers.rs
8:#[cfg_attr(rustfmt, rustfmt_skip)]
26:#[cfg_attr(rustfmt, rustfmt_skip)]
38:#[cfg_attr(rustfmt, rustfmt_skip)]
57:#[cfg_attr(rustfmt, rustfmt_skip)]
73:#[cfg_attr(rustfmt, rustfmt_skip)]

clippy_lints/src/new_without_default.rs
156:    #[cfg_attr(rustfmt, rustfmt_skip)]

clippy_lints/src/loops.rs
1781:#[cfg_attr(rustfmt, rustfmt_skip)]

clippy_lints/src/non_expressive_names.rs
91:#[cfg_attr(rustfmt, rustfmt_skip)]

clippy_lints/src/methods.rs
1824:#[cfg_attr(rustfmt, rustfmt_skip)]
1834:#[cfg_attr(rustfmt, rustfmt_skip)]
1868:#[cfg_attr(rustfmt, rustfmt_skip)]

clippy_lints/src/matches.rs
200:#[cfg_attr(rustfmt, rustfmt_skip)]

clippy_lints/src/lib.rs
211:#[cfg_attr(rustfmt, rustfmt_skip)]

Copy link
Contributor

Choose a reason for hiding this comment

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

oh ^^

@oli-obk
Copy link
Contributor

oli-obk commented May 30, 2018

This is awesome! @killercup and I were talking about this at some point this in the last 24h. And now there's a PR ❤️

@mati865 mati865 changed the title [WIP] Rust 2018 migration Rust 2018 migration May 30, 2018
@oli-obk oli-obk merged commit bb2f6a5 into rust-lang:master May 30, 2018
@oli-obk
Copy link
Contributor

oli-obk commented May 30, 2018

The future is now. Let's see how this goes

@mati865
Copy link
Contributor Author

mati865 commented May 30, 2018

@nikomatsakis might be interested to see it.

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.

2 participants