-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
as_slice
will be stable in 1.7
#728
Comments
I agree that the lint should be removed. Warning because "using deref magic instead is nicer" is far too opinionated in my opinion. |
Hmmm...I think we need to have a story for deprecating lints. I think the lints could still be useful for people that intend (for whatever reason) to deploy on an older Rust version, so I think we shouldn't throw them away yet. |
In any case the documentation must be changed. |
If they were using the old nightly, then it's very likely that clippy won't work with it anymore. Even if they use a new nightly for clippy and an old one for their normal compilation, there are probably breaking changes between those nightlies, so the new nightly won't compile the code meant for the old one. Thus they are locked-in to an old nightly and a clippy that ran on that nightly. |
|
On stable they can't use the feature... |
Oh right, for some reason I thought that kind of feature could be explicitly allowed even on stable or beta 😳. You have a point then. |
Perhaps we could ask on rust-users and r/rust which Rust versions people are using? If most people are on current rust anyway, we may as well remove the lint. |
I think to deprecate a lint, we should:
Perhaps we should first get the framework for more than 2 lint groups up? The idea is simple, have a custom macro instead of |
👍 to that. Sometimes I’d also like an ”API breaking lints”-group that I could allow because I’m using clippy on a project that does not regularly use it and I don’t want to mess with their interface. |
We need to decide what to do with the
unstable_as_slice
andunstable_as_mut_slice
lints as these functions will be stable in 1.7 (ref. rust-lang/rust#30943). We could simply remove them or keep them and change their documentation to explain it’s better to use&v[..]
(see rust-lang/rust#27729 for some arguments).I think we can remove them as those functions are not inherently bad and can sometimes lead to slightly more readable code (
.map(String::as_slice)
vs..map(|s| &*s)
andy.happy().monkey().as_slice()
vs.&(y.happy().monkey())[..]
).The text was updated successfully, but these errors were encountered: