Rollup of 11 pull requests#156658
Closed
JonathanBrouwer wants to merge 32 commits into
Closed
Conversation
…r` is found This commit adds a diagnostic suggestion to help users who forget to call `.collect()` when they have an iterator and the function or variable expects a `String`. The logic checks if the expected type is `std::string::String` and if the found type implements the `Iterator` trait, if so the compiler provides a suggestion to add `.collect()` Includes also a UI test to verify if the suggestion appears correctly
Co-authored-by: Qai Juang <qaijuang@gmail.com>
For now, this is a 1-to-1 copy of `LayoutData`, but this will change.
It was always set to `Variants::Single`.
Enum variants always have `Arbitrary` layout, so the enum isn't needed.
This field is only used during layout calculations, so re-synthetized `LayoutData`s for enum variants can use a dummy value instead.
Reusing the alignment of the enclosing enum in `LayoutData::for_variant` doesn't appear to cause any issues.
It has a single call site.
It's always `None`.
It was only used by rustdoc and doesn't seem like it was necessary there. No tests fail at least.
This works, but I couldn't find any test cases for it.
`LintExpectationId` has two variants, `Unstable` and `Stable`. There are some places where both variants are possible, but there are also places where only one of `Unstable` or `Stable` is possible. This commit encodes this into the type system by introducing new types `UnstableLintExpectationId` and `StableLintExpectationId`. The variants of `LintExpectationId` now enclose these. This makes it clearer what values are possible where. Other things of note: - `LintLevelsProvider` gets an associated type and some method changes. - `LintContext` gets an associated type. - `LevelSpec` is made generic. `UnstableLevelSpec` and `StableLevelSpec` typedefs are added. - The unstable types are now guaranteed by the type system to never be stably hashed. Previously this was a runtime check.
I find these make the code harder to understand.
Describing things that took me a while to work out.
Remove redundant information in `rustc_abi::Variants` Follow-up to rust-lang#151040; partially addresses rust-lang#113988. Replaces the nested `LayoutData` in `Variants::Multiple` by a new, smaller `VariantLayout` struct, and adjust `LayoutData::for_variant`and the layout algorithm in consequence. This PR is best reviewed commit-by-commit.
…notriddle Remove driver_lint_caps It was only used by rustdoc and doesn't seem like it was necessary there. No tests fail at least. r? rust-lang/rustdoc
…ing, r=estebank compiler: suggest `.collect()` when `String` is expected and `Iterator` is found This commit adds a diagnostic suggestion to help users who forget to call `.collect()` when they have an iterator and the function or variable expects a `String`. The logic checks if the expected type is `std::string::String` and if the found type implements the `Iterator` trait, if so the compiler provides a suggestion to add `.collect()` Includes also a UI test to verify if the suggestion appears correctly
…-1, r=saethlin Emit retags in codegen to support BorrowSanitizer (part 1) Tracking issue: rust-lang#154760 [Zulip Thread](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Staging.20for.20emitting.20retags.20in.20codegen/with/593004012) This is the first of several PRs that will add experimental support for emitting retags as function calls in codegen. Each PR will be a minimal, improved slice of the changes in rust-lang#155965. This PR contains all of the changes that will affect codegen backends. It adds methods to `IntrinsicCallBuilderMethods` for emitting each kind of retag call. cc: @RalfJung
… r=GuillaumeGomez Split `LintExpectationId`s This PR makes clearer where stable and unstable `LintExpectationIds` can occur, plus a few other small cleanups. Details in individual commits. r? @GuillaumeGomez
suggest hex escapes for C-style escapes Fixes rust-lang#148884.
…=mejrs Test EII UI tests with prefer-dynamic Tracking issue: rust-lang#125418 Remove `no-prefer-dynamic` from the EII UI tests now that rust-lang#153648 fixed exporting EII declaration aliases from dylibs. Fixes rust-lang#151271. Tested with: ```sh python3 x.py test tests/ui/eii --force-rerun ```
…uillaumeGomez rustdoc: add test case for `-Drustdoc::` and `--cap-lints` This works, but I couldn't find any test cases for it.
…est, r=mu001999 Add regression test for issue rust-lang#41261 Adds a regression test for rust-lang#41261.
…r, r=JohnTitor rename unexpected_try_recover function While reading the code, the doc comment and the name of the function `unexpected_try_recover` confused me. The doc said it tries to recover if it is a closing delimiter but I see no recovering code and the function always return an error. So I change the name of the function to `unexpected_err` and change the return value to `Diag<'a>`. I also update the doc comment.
…=Kivooeo minor `rustc_mir_transform` cleanup Some minor things I noticed here and there while reading though code
Contributor
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
May 17, 2026
Rollup of 11 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-2
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for e961a81 failed: CI. Failed job:
|
Contributor
|
This pull request was unapproved due to being closed. |
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.
Successful merges:
rustc_abi::Variants#151742 (Remove redundant information inrustc_abi::Variants).collect()whenStringis expected andIteratoris found #156121 (compiler: suggest.collect()whenStringis expected andIteratoris found)LintExpectationIds #156596 (SplitLintExpectationIds)-Drustdoc::and--cap-lints#156616 (rustdoc: add test case for-Drustdoc::and--cap-lints)rustc_mir_transformcleanup #156636 (minorrustc_mir_transformcleanup)r? @ghost
Create a similar rollup