Closed
Conversation
When encountering an inference error where a return type must be known, like when calling `Iterator::sum::<T>()` without specifying `T`, look for all `T` that would satisfy `Sum<S>`. If only one, suggest it. ``` error[E0283]: type annotations needed --> $DIR/cannot-infer-iterator-sum-return-type.rs:4:9 | LL | let sum = v | ^^^ ... LL | .sum(); // `sum::<T>` needs `T` to be specified | --- type must be known at this point | = note: cannot satisfy `_: Sum<i32>` help: the trait `Sum` is implemented for `i32` --> $SRC_DIR/core/src/iter/traits/accum.rs:LL:COL ::: $SRC_DIR/core/src/iter/traits/accum.rs:LL:COL | = note: in this macro invocation note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL = note: this error originates in the macro `integer_sum_product` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider giving `sum` an explicit type, where the type for type parameter `S` is specified | LL | let sum: i32 = v | +++++ ```
Code that previously used `QueryStackFrame` now uses `TaggedQueryKey` directly. Code that previously used `Spanned<QueryStackFrame>` now uses `QueryStackFrame`, which includes a span.
These types have been unused since polymorphization was removed in <rust-lang#133883>.
When single impl can satisfy inference error, suggest type When encountering an inference error where a return type must be known, like when calling `Iterator::sum::<T>()` without specifying `T`, look for all `T` that would satisfy `Sum<S>`. If only one, suggest it. ``` error[E0283]: type annotations needed --> $DIR/cannot-infer-iterator-sum-return-type.rs:4:9 | LL | let sum = v | ^^^ ... LL | .sum(); // `sum::<T>` needs `T` to be specified | --- type must be known at this point | = note: cannot satisfy `_: Sum<i32>` help: the trait `Sum` is implemented for `i32` --> $SRC_DIR/core/src/iter/traits/accum.rs:LL:COL ::: $SRC_DIR/core/src/iter/traits/accum.rs:LL:COL | = note: in this macro invocation note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL = note: this error originates in the macro `integer_sum_product` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider giving `sum` an explicit type, where the type for type parameter `S` is specified | LL | let sum: i32 = v | +++++ ``` Fix rust-lang#100802.
Move query-stack-frame spans into `QueryStackFrame` - Follow-up to rust-lang#153907 (comment). --- Code that previously used `QueryStackFrame` now uses `TaggedQueryKey` directly. Code that previously used `Spanned<QueryStackFrame>` now uses `QueryStackFrame`, which includes a span. This ends up bringing QueryStackFrame closer to the expectations of the code that actually consumes query cycles, and also avoids the awkward and misleading `respan` calls and `node` field accesses that had been required by `Spanned`. r? nnethercote
Remove unused types `UnusedGenericParams` and `FiniteBitSet` - These types have been unused since polymorphization was removed in <rust-lang#133883>.
Member
Author
|
Rollup of everything. @bors r+ rollup=never p=5 |
Contributor
This comment has been minimized.
This comment has been minimized.
Contributor
|
💔 Test for 8698863 failed: CI. Failed job:
|
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
PR #153727, which is a member of this rollup, was unapproved. |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
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:
QueryStackFrame#153998 (Move query-stack-frame spans intoQueryStackFrame)UnusedGenericParamsandFiniteBitSet#154026 (Remove unused typesUnusedGenericParamsandFiniteBitSet)r? @ghost
Create a similar rollup