Skip to content

Crater rollup - #164148

Draft
theemathas wants to merge 22 commits into
rust-lang:mainfrom
theemathas:crater-rollup
Draft

theemathas wants to merge 22 commits into
rust-lang:mainfrom
theemathas:crater-rollup

Conversation

@theemathas

@theemathas theemathas commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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

sjwang05 and others added 21 commits October 11, 2026 16:54
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.
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.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) O-unix Operating system: Unix-like S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 11, 2026
@theemathas

Copy link
Copy Markdown
Contributor Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 11, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

💔 Test for c8eb406 failed: CI. Failed jobs:

This just potentially makes the order of diagnostics nondeterministic,
which is fine.
@theemathas

Copy link
Copy Markdown
Contributor Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 11, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-aarch64-gnu-llvm-22-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

failures:

---- compiler/rustc_lint_defs/src/builtin.rs - builtin::UNSATISFIED_HRTB_ARG (line 5096) stdout ----
error: the trait bound `T: _doctest_main_compiler_rustc_lint_defs_src_builtin_rs_5096_0::Bound` is not satisfied
    --> compiler/rustc_lint_defs/src/builtin.rs:5100:18
     |
5100 | fn wf<T>() where for<'a> W<'a, T>: Sized {}
     |                  ^^^^^^^^^^^^^^^^^^^^^^^
     |
     = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
     = note: for more information, see issue #162200 <https://github.com/rust-lang/rust/issues/162200>
     = note: `#[forbid(unsatisfied_hrtb_arg)]` (part of `#[forbid(future_incompatible)]`) on by default

error: aborting due to 1 previous error

Couldn't compile the test.
\ (no newline at end of output)
---

test result: FAILED. 125 passed; 1 failed; 36 ignored; 0 measured; 0 filtered out; finished in 2.41s

all doctests ran in 3.64s; merged doctests compilation took 1.23s
error: doctest failed, to rerun pass `-p rustc_lint_defs --doc`
Bootstrap failed while executing `--stage 2 test --skip tidy --skip tests --skip library --skip tidyselftest`
Currently active steps:
test::CrateLibrustc { build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu, crates: ["rustc-main", "rustc_abi", "rustc_arena", "rustc_ast", "rustc_ast_ir", "rustc_ast_lowering", "rustc_ast_passes", "rustc_ast_pretty", "rustc_attr_ir", "rustc_attr_parsing", "rustc_baked_icu_data", "rustc_borrowck", "rustc_builtin_macros", "rustc_codegen_llvm", "rustc_codegen_ssa", "rustc_const_eval", "rustc_crate_store", "rustc_data_structures", "rustc_driver", "rustc_driver_impl", "rustc_error_codes", "rustc_error_messages", "rustc_errors", "rustc_expand", "rustc_expand_queries", "rustc_feature", "rustc_fs_util", "rustc_graphviz", "rustc_hashes", "rustc_hir", "rustc_hir_analysis", "rustc_hir_id", "rustc_hir_pretty", "rustc_hir_typeck", "rustc_incremental", "rustc_index", "rustc_index_macros", "rustc_infer", "rustc_interface", "rustc_lexer", "rustc_lint", "rustc_lint_defs", "rustc_llvm", "rustc_log", "rustc_macros", "rustc_metadata", "rustc_middle", "rustc_mir_build", "rustc_mir_dataflow", "rustc_mir_transform", "rustc_monomorphize", "rustc_next_trait_solver", "rustc_parse", "rustc_parse_format", "rustc_passes", "rustc_pattern_analysis", "rustc_privacy", "rustc_proc_macro", "rustc_public", "rustc_public_bridge", "rustc_query_impl", "rustc_resolve", "rustc_sanitizers", "rustc_serialize", "rustc_session", "rustc_span", "rustc_structures", "rustc_symbol_mangling", "rustc_target", "rustc_thread_pool", "rustc_trait_selection", "rustc_traits", "rustc_transmute", "rustc_ty_utils", "rustc_ty_walk", "rustc_type_ir", "rustc_type_ir_macros", "rustc_windows_rc"] } at src/bootstrap/src/core/build_steps/test.rs:3444
test::Crate { build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu, mode: Rustc, crates: ["rustc-main", "rustc_abi", "rustc_arena", "rustc_ast", "rustc_ast_ir", "rustc_ast_lowering", "rustc_ast_passes", "rustc_ast_pretty", "rustc_attr_ir", "rustc_attr_parsing", "rustc_baked_icu_data", "rustc_borrowck", "rustc_builtin_macros", "rustc_codegen_llvm", "rustc_codegen_ssa", "rustc_const_eval", "rustc_crate_store", "rustc_data_structures", "rustc_driver", "rustc_driver_impl", "rustc_error_codes", "rustc_error_messages", "rustc_errors", "rustc_expand", "rustc_expand_queries", "rustc_feature", "rustc_fs_util", "rustc_graphviz", "rustc_hashes", "rustc_hir", "rustc_hir_analysis", "rustc_hir_id", "rustc_hir_pretty", "rustc_hir_typeck", "rustc_incremental", "rustc_index", "rustc_index_macros", "rustc_infer", "rustc_interface", "rustc_lexer", "rustc_lint", "rustc_lint_defs", "rustc_llvm", "rustc_log", "rustc_macros", "rustc_metadata", "rustc_middle", "rustc_mir_build", "rustc_mir_dataflow", "rustc_mir_transform", "rustc_monomorphize", "rustc_next_trait_solver", "rustc_parse", "rustc_parse_format", "rustc_passes", "rustc_pattern_analysis", "rustc_privacy", "rustc_proc_macro", "rustc_public", "rustc_public_bridge", "rustc_query_impl", "rustc_resolve", "rustc_sanitizers", "rustc_serialize", "rustc_session", "rustc_span", "rustc_structures", "rustc_symbol_mangling", "rustc_target", "rustc_thread_pool", "rustc_trait_selection", "rustc_traits", "rustc_transmute", "rustc_ty_utils", "rustc_ty_walk", "rustc_type_ir", "rustc_type_ir_macros", "rustc_windows_rc"] } at src/bootstrap/src/core/build_steps/test.rs:3451
Build completed unsuccessfully in 0:31:00

@rust-bors

rust-bors Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: c60b92c (c60b92c03ca8a3b101eb9d57f51e2232690638c7)
Base parent: 7211ea5 (7211ea594cbf137ef6118b1752b959dea7cb9088)

@theemathas

Copy link
Copy Markdown
Contributor Author

@craterbot check name=pr-164148-crater-rollup p=2

@craterbot

Copy link
Copy Markdown
Collaborator

👌 Experiment pr-164148-crater-rollup created and queued.
🤖 Automatically detected try build c60b92c
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) O-unix Operating system: Unix-like S-waiting-on-crater Status: Waiting on a crater run to be completed. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants