-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
more clippy fixes #70187
more clippy fixes #70187
Conversation
matthiaskrgr
commented
Mar 20, 2020
•
edited
Loading
edited
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.
Most of this is a clear improvement IMO. However, I don't like eliding lifetimes everywhere possible, since some lifetime names ('tcx
) have a specific meaning in rustc
.
@matthiaskrgr I assume that your ultimate goal is to enable clippy
as part of x.py fmt
, which I am generally supportive of. However, I think the needless_lifetimes
lint in specific may not be a good fit for the compiler. Obviously this is subjective. Perhaps enabling and configuring clippy should go through the major change process so people can weigh in? In any case, I'll defer to someone with more seniority.
r? @Centril |
@bors r+ |
📌 Commit 85e608c503a8abf7fdb1c4613f000409354570a1 has been approved by |
@bors r- I don't think eliding 'tcx is a good idea for now, or at least we should have a broader discussion. |
remove redundant format!() call (clippy::useless_format) don't use ok() before calling expect() (clippy::ok_expect)
I removed the lifetime elision commit. |
Thanks! @bors r+ rollup |
📌 Commit ad00e91 has been approved by |
@ecstatic-morse I personally don't think clippy is ready to be part of I'm sifting through the clippy logs, can report false positives to clippy and fix the true positives in the codebase so I guess it's a win win. |
For what it's worth, I would have r+ed this PR as well with the lifetime elision. It just seems like standard practice, and I don't think there's anything special about the compiler as compared to other codebases here. The fact that there might be arena allocation involved can often be inferred by e.g. In some cases however, e.g., involving unsafe code in the standard library, or unsafe code in general, we should be more careful wrt. lifetime elision. But most of the time, there's no unsafe code in sight. |
more clippy fixes * remove redundant returns (clippy::needless_return) * remove redundant import (clippy::single_component_path_imports) * remove redundant format!() call (clippy::useless_format) * don't use ok() before calling expect() (clippy::ok_expect)
more clippy fixes * remove redundant returns (clippy::needless_return) * remove redundant import (clippy::single_component_path_imports) * remove redundant format!() call (clippy::useless_format) * don't use ok() before calling expect() (clippy::ok_expect)
Rollup of 16 pull requests Successful merges: - rust-lang#65097 (Make std::sync::Arc compatible with ThreadSanitizer) - rust-lang#69033 (Use generator resume arguments in the async/await lowering) - rust-lang#69997 (add `Option::{zip,zip_with}` methods under "option_zip" gate) - rust-lang#70038 (Remove the call that makes miri fail) - rust-lang#70058 (can_begin_literal_maybe_minus: `true` on `"-"? lit` NTs.) - rust-lang#70111 (BTreeMap: remove shared root) - rust-lang#70139 (add delay_span_bug to TransmuteSizeDiff, just to be sure) - rust-lang#70165 (Remove the erase regions MIR transform) - rust-lang#70166 (Derive PartialEq, Eq and Hash for RangeInclusive) - rust-lang#70176 (Add tests for rust-lang#58319 and rust-lang#65131) - rust-lang#70177 (Fix oudated comment for NamedRegionMap) - rust-lang#70184 (expand_include: set `.directory` to dir of included file.) - rust-lang#70187 (more clippy fixes) - rust-lang#70188 (Clean up E0439 explanation) - rust-lang#70189 (Abi::is_signed: assert that we are a Scalar) - rust-lang#70194 (#[must_use] on split_off()) Failed merges: r? @ghost