-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Clippy subtree update #137752
Clippy subtree update #137752
Conversation
By assuming that a recursive type is normalizable within the deeper calls to `is_normalizable_helper()`, more cases can be handled by this function. In order to fix stack overflows, a recursion limit has also been added for recursive generic type instantiations.
`manual_ok_or` covers the same case that were covered by `option_map_or_err_ok` which is not deprecated. The latter was in the "style" category. Also, the lint is machine applicable, and leads to shorter and more readable code, so "style" is appropriate. The only difference is that the η-expanded form of `Result::Ok()` was not covered by `option_map_or_err_ok` while it is by `manual_ok_or`, so the category change may expose some new occurrences.
Removing the `.as_ref()` or `.as_mut()` as the top-level expression in a closure may change the type of the result. In this case, it may be better not to lint rather than proposing a fix that would not work.
Labeled blocks cannot be used as-is in the "then" or "else" part of an `if` expression. They must be enclosed in an anonymous block.
This is the lint described at rust-lang#136308 (comment) that recommends using HTML to nest links inside code.
- `reindent_multiline()` always returns the result of `reindent_multiline_inner()` which returns a `String`. Make `reindent_multiline()` return a `String` as well, instead of a systematically owned `Cow<'_, str>`. - There is no reason for `reindent_multiline()` to force a caller to build a `Cow<'_, str>` instead of passing a `&str` directly, especially considering that a `String` will always be returned. Also, both the input parameter and return value (of type `Cow<'_, str>`) shared the same (elided) lifetime for no reason: this worked only because the result was always the `Cow::Owned` variant which is compatible with any lifetime. As a consequence, the signature changes from: ```rust fn reindent_multiline(s: Cow<'_, str>, …) -> Cow<'_, str> { … } ``` to ```rust fn reindent_multiline(s: &str, …) -> String { … } ```
And use it in the next commit to avoid ICE.
@bors r+ |
@bors p=4 This is a broken component, it is higher priority than rollups |
@bors p=3 Actually no, it's not a broken component, just an ICE. p=3 is fine by me but I'm happy with others bumping it up too. |
…nishearth Clippy subtree update ? `@Manishearth` Cargo.lock change because of Clippy version bump and rustc_tool_utils new release. Fixes rust-lang#137640 Would be nice, if we could this merged before nightly is being build, so that this ICE is fixed tomorrow.
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (351686b): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (secondary -2.6%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 3.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 773.316s -> 773.314s (-0.00%) |
? @Manishearth
Cargo.lock change because of Clippy version bump and rustc_tool_utils new release.
Fixes #137640
Would be nice, if we could this merged before nightly is being build, so that this ICE is fixed tomorrow.