-
Couldn't load subscription status.
- Fork 1.8k
correct suggestions in no_std
#13999
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
Conversation
| format!("{suggested_type} of `Range` that is only one element"), | ||
| |diag| { | ||
| if should_emit_every_value { | ||
| if should_emit_every_value && !is_no_std_crate(cx) { |
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 a no_std environment, we may use alloc::vec::Vec, but this assumes the existence of a heap allocator, so Clippy shouldn't suggest to use alloc::vec::Vec in general because it violates the purpose of Applicability::MaybeIncorrect. Also, using Applicability::Unspecified is noisy in such environments.
|
Could not assign reviewer from: |
|
r? clippy |
…n a `no_std` environment
…o_std` environment
2c04e5b to
3b0b8b0
Compare
I opened #13896 before. However, I found that there're more cases where Clippy suggests to use modules that belong to the
stdcrate even in ano_stdenvironment. Therefore, this PR include the changes I've made in #13896 and new changes to fix cases I found this time to prevent wrong suggestions inno_stdenvironments as well.changelog: [
redundant_closure]: correct suggestion inno_stdchangelog: [
repeat_vec_with_capacity]: correct suggestion inno_stdchangelog: [
single_range_in_vec_init]: don't emit suggestion to useVecinno_stdchangelog: [
drain_collect]: correct suggestion inno_stdchangelog: [
map_with_unused_argument_over_ranges]: correct suggestion inno_stdalso close #13895