Closed
Conversation
…idity invariant docs
This speeds up incremental compile times when modifying rustc_lint.
I heard that `std::mem` sounds scary to some people, and how it’s described — “Basic functions for dealing with memory” — sounds even to me like something that should be avoided, not even because it would be unsafe, but because it is too low-level. Let’s fix that by telling people about what they can actually find in the module, without having to read all the individual item descriptions.
Previously, it was quite hard to get access to this output because it was printed to a buffer in memory and then discarded. This output is already hidden behind libtest's output capturing, we don't need to hide it twice.
When encountering an inference error when calling `.collect()` followed by `?`, detect the return type of the enclosing function and suggest `.collect::<Result<_, _>>()?` instead of `.collect::<Vec<_>>()?`: ``` error[E0283]: type annotations needed --> $DIR/question-mark-type-infer.rs:10:21 | LL | l.iter().map(f).collect()? | ^^^^^^^ cannot infer type of the type parameter `B` declared on the method `collect` | = note: cannot satisfy `_: FromIterator<Result<i32, ()>>` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL help: consider specifying the generic argument | LL | l.iter().map(f).collect::<Result<_, _>>()? | ++++++++++++++++ ``` On inference error in let binding, account for `?`: ``` error[E0282]: type annotations needed --> $DIR/question-mark-type-inference-in-chain.rs:31:9 | LL | let mut tags = lines.iter().map(|e| parse(e)).collect()?; | ^^^^^^^^ ... LL | tags.sort(); | ---- type must be known at this point | help: consider giving `tags` an explicit type | LL | let mut tags: Vec<_> = lines.iter().map(|e| parse(e)).collect()?; | ++++++++ ```
`CycleError` has one field containing a `(Span, QueryStackFrame<I>)` and another field containing a `QueryInfo`, which is a struct containing just a `Span` and a `QueryStackFrame<I>`. We already have the `Spanned` type for adding a span to something. This commit uses it for both fields in `CycleError`, removing the need for `QueryInfo`. Which is good for the following reasons. - Any type with `Info` in the name is suspect, IMO. - `QueryInfo` can no longer be confused with the similar `QueryJobInfo`. - The doc comment on `QueryInfo` was wrong; it didn't contain a query key.
It's unused.
…henkov Remove `QueryInfo`. `CycleError` has one field containing a `(Span, QueryStackFrame<I>)` and another field containing a `QueryInfo`, which is a struct containing just a `Span` and a `QueryStackFrame<I>`. We already have the `Spanned` type for adding a span to something. This commit uses it for both fields in `CycleError`, removing the need for `QueryInfo`. Which is good for the following reasons. - Any type with `Info` in the name is suspect, IMO. - `QueryInfo` can no longer be confused with the similar `QueryJobInfo`. - The doc comment on `QueryInfo` was wrong; it didn't contain a query key. r? @Mark-Simulacrum
MaybeUninit: mention common mistakes in assume_init docs; link to validity invariant docs Fixes rust-lang#150689 r? @tgross35
Add overview documentation for `std::mem`. I heard that `std::mem` sounds scary to some people, and how it’s described — “Basic functions for dealing with memory” — sounds even to me like something that should be avoided, not even because it would be unsafe, but because it is too low-level. Let’s fix that by telling people about what they can actually find in the module, without having to read all the individual item descriptions. The exact contents of the list are, of course, highly debatable, and I chose not to include any of the unstable or deprecated items, nor to include `Discriminant` as well as `discriminant`. I’m also not particularly happy with the wording of the introductory paragraph.
…mann rustc_mir_build only depends on rustc_lint_defs, not rustc_lint This speeds up incremental compile times when modifying rustc_lint.
…ieyouxu run_make_support: Print the command and output even if it succeeds Previously, it was quite hard to get access to this output because it was printed to a buffer in memory and then discarded. This output is already hidden behind libtest's output capturing, we don't need to hide it twice.
Provide better suggestions for inference errors on `.collect()?` When encountering an inference error when calling `.collect()` followed by `?`, detect the return type of the enclosing function and suggest `.collect::<Result<_, _>>()?` instead of `.collect::<Vec<_>>()?`: ``` error[E0283]: type annotations needed --> $DIR/question-mark-type-infer.rs:10:21 | LL | l.iter().map(f).collect()? | ^^^^^^^ cannot infer type of the type parameter `B` declared on the method `collect` | = note: cannot satisfy `_: FromIterator<Result<i32, ()>>` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL help: consider specifying the generic argument | LL | l.iter().map(f).collect::<Result<_, _>>()? | ++++++++++++++++ ``` On inference error in let binding, account for `?`: ``` error[E0282]: type annotations needed --> $DIR/question-mark-type-inference-in-chain.rs:31:9 | LL | let mut tags = lines.iter().map(|e| parse(e)).collect()?; | ^^^^^^^^ ... LL | tags.sort(); | ---- type must be known at this point | help: consider giving `tags` an explicit type | LL | let mut tags: Vec<_> = lines.iter().map(|e| parse(e)).collect()?; | ++++++++ ``` Address rust-lang#129269.
remove several redundant tests Remove the following tests: * `binding/match-naked-record.rs`: duplicate of `binding/match-naked-record-expr.rs` * `issues/issue-5192.rs`: duplicate of `box/unit/unique-object-move.rs` * `macros/unreachable.rs`: duplicate of `macros/unreachable-macro-panic.rs` * `issues/issue-4830.rs`: this used to test that a parsing error was emitted for obsolete `~` syntax, this was removed long ago * `moves/array-copy-move.rs`: this used to test that calling methods on a vec with type error elements did not ICE. It no longer makes sense since it contains no method call and the integers do not cause type errors anymore.
Member
Author
|
Rollup of everything. @bors r+ rollup=never p=5 |
Contributor
Merged
This comment has been minimized.
This comment has been minimized.
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 16, 2026
Rollup of 7 pull requests Successful merges: - #153639 (Remove `QueryInfo`.) - #153570 (MaybeUninit: mention common mistakes in assume_init docs; link to validity invariant docs) - #153793 (Add overview documentation for `std::mem`.) - #153922 (rustc_mir_build only depends on rustc_lint_defs, not rustc_lint) - #153923 (run_make_support: Print the command and output even if it succeeds) - #153925 (Provide better suggestions for inference errors on `.collect()?`) - #153928 (remove several redundant tests)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 157fa85 failed: CI. Failed job:
|
Member
Author
|
None of these PRs should affect
|
Member
Author
|
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:
QueryInfo. #153639 (RemoveQueryInfo.)std::mem. #153793 (Add overview documentation forstd::mem.).collect()?#153925 (Provide better suggestions for inference errors on.collect()?)r? @ghost
Create a similar rollup