Repository navigation
Crater rollup - #164148
Draft
theemathas wants to merge 22 commits into
Draft
Crater rollup#164148theemathas wants to merge 22 commits into
theemathas wants to merge 22 commits into
Conversation
This brings the behavior of the language in line with the documentation in `library/core/src/primitive_docs.rs`.
Add two lints, very similar to `clippy::useless_conversion`, detecting when `.into()` is being called unnecessarily. We present two separate lints, one that triggers inside of macros, because it is common for macros to have `.into()` calls to make the caller side easier to use. In those cases people should still use the fully-qualified path instead, but allow them to silence that lint without silencing the more general, more likely to be problematic case. This lint allows us to protect developers from the semver-hazard that time 0.3.34 encountered, where a std change caused a valid method chain to start producing inference errors. This is explicitly allowed by the Rust project's backwards compatibility guarantees (inference is not included in them), which means that relying on the blanket `impl Into` is a problem. The lint as implemented has false negatives: because of the way type aliases are handled by the type system, we can't know whether `let _: i32 = 0i32.into()` corresponds to a call on `i32` *or* a call on a type alias that is `i32` only on some platforms (like `#[cfg(..)] type Int = i32;`). To avoid false positives, we keep track of type aliases that have been imported in the local crate and mark their types for exclusion. This means that calling `let _: i32 = Int::into(0i32);` will not be linted against even though it should. Ignore useless `.into()` calls on fields or structs that are behind a `cfg` attr. Ignore useless `.into()` calls on `const`s that are behind a cfg attr. This side-steps a lot of `libc` cases. Account for `foo.map(Into::into)`. Account for macros in suggestions. Do not emit a suggestion to remove the `.into()` call when the `Span` context of the receiver is different to the Span context of the expression to avoid malformed suggestions. The lint still triggers regardless, just with less information.
…ype T: Into<u64>;`
Implements RFC 4011.
The implementation had an incorrect short-circruting behavior, i.e., it failed to join `borrow` when `qualif` changed. This lead implementation to accept code that should have been rejected. Fix the issue and fallout in the standard library and tests.
Contributor
Author
|
@bors try |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
|
💔 Test for c8eb406 failed: CI. Failed jobs:
|
This just potentially makes the order of diagnostics nondeterministic, which is fine.
Contributor
Author
|
@bors try |
This comment has been minimized.
This comment has been minimized.
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
Contributor
Author
|
@craterbot check name=pr-164148-crater-rollup p=2 |
Collaborator
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
This was referenced Oct 11, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Due to the long crater queue, I am making a crater rollup. That is, I will run crater of all these PRs together at the same time. And then, once that is finished, I will rerun crater on each individual PR only on the crates that regressed in the result of this crater. This hopefully will speed up the crater process.
PRs in this rollup: #162986, #160186, #163699, #129249, #163717, #164053, #164081