mention the opaque when its hidden type cannot be inferred - #162172
Merged
rust-bors[bot] merged 1 commit intoSep 11, 2026
Conversation
when the hidden type of an opaque was never constrained, typeck reported E0282 with only the shared cannot infer type label. nothing in the output said an opaque was involved, so the error read like an ordinary local inference failure. the unconstrained hidden type arm now adds a note naming the opaque as the source of the ambiguity. fixes rust-lang#146231
Contributor
Author
|
@rustbot reroll |
Member
|
@bors r+ rollup |
Contributor
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 11, 2026
Rollup of 10 pull requests Successful merges: - #162270 (Update `windows-bindgen` to 0.100.0) - #162492 (Revert "Rollup merge of #157518 - CAD97:xdg_basedir, r=aapoalas") - #162607 (Basic cleanup in `rustc_transmute`) - #162619 (Add test for the missing Clone requirement for Cow slices) - #162172 (mention the opaque when its hidden type cannot be inferred) - #162514 (Simplify diagnostic levels) - #162546 (Use lld by default on `loongarch64-unknown-linux-gnu` nightly) - #162564 (yeet StabilityLevel) - #162613 (iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items) - #162616 (regression test for async main diagnostic)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 11, 2026
Rollup merge of #162172 - Albab-Hasan:opaque-hidden-type-inference-note, r=chenyukang mention the opaque when its hidden type cannot be inferred when the hidden type of an opaque was never constrained, typeck reported `E0282` with only the shared cannot infer type label. nothing in the output said an opaque was involved, so the error read like an ordinary local inference failure. the unconstrained hidden type arm now adds a note naming the opaque as the source of the ambiguity. fixes #146231 r? @lcnr
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.
when the hidden type of an opaque was never constrained, typeck reported
E0282with only the shared cannot infer type label. nothing in the output said an opaque was involved, so the error read like an ordinary local inference failure.the unconstrained hidden type arm now adds a note naming the opaque as the source of the ambiguity.
fixes #146231
r? @lcnr