-
Notifications
You must be signed in to change notification settings - Fork 299
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
Expand Clippy coverage to docs features and resolve more lints #1092
Conversation
src/impl_constructors.rs
Outdated
let mut v = Vec::with_capacity(size); | ||
v.set_len(size); | ||
Self::from_shape_vec_unchecked(shape, v) | ||
Self::uninit(shape).assume_init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not yet triggered on beta, but on nightly this hits the deny by default lint uninit_vec
. The change does not really fix anything as the problem is inherent in the signature of the deprecated method but rather works around this by deduplicating the implementation so that Clippy's pattern matching does see this any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the changed implementation is a safety risk. Maybe I don't really want to analyze it, but I really don't think clippy should push us into this, it's not better, it just doesn't detect it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you expand on why you think it is worse than the previous one? The semantics of
let mut v = Vec::with_capacity(size);
v.set_len(size);
are the same as
MaybeUninit::uninit().assume_init()
are they not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I really don't think clippy should push us into this
I would also say that Clippy pushes us into not having this method which we already know as it is deprecated for exactly this reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, I would not mind dropping the commit as this does not affect beta yet and the method will probably go away soon in any case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the overhead to analyse it again. It's probably the same like you said. Thus we don't need to change it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced by a commit that just suppresses the lint for the deprecated method.
The remaining lints are |
This leaves |
I guess both of those traits are not really extension interfaces either. At least the former should disappear now with const generics. |
…ith more features enabled.
…e not implementable downstream.
Marked them using One thing I wondered while adding those macro invocations is whether one could drop macro_rules! private_decl {
() => {
/// This trait is private to implement; this method exists to make it
/// impossible to implement outside the crate.
fn __private__(&self) -> crate::private::PrivateMarker {
crate::private::PrivateMarker
}
}
} |
Ok, I will drop the commit preparing for |
Thanks for working on this so eagerly, but we can't add |
Ah right, this is strictly speaking a breaking change since they are indeed implementable downstream ATM... Will drop that commit as well. |
Thanks! |
No description provided.