-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix misleading cannot infer type for type parameter
error
#97109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix misleading cannot infer type for type parameter
error
#97109
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
Outdated
Show resolved
Hide resolved
Looks like there are more tests that need blessing. If they aren't available locally, maybe you need to rebase |
let var_origin = ty_vars.var_origin(ty_vid); | ||
if let TypeVariableOriginKind::TypeParameterDefinition(_, Some(def_id)) = | ||
var_origin.kind | ||
&& let Some(parent_def_id) = self.tcx.parent(def_id).as_local() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't have to happen in.this PR, but we could extend this to Node::ImplItem, too, so that we'd show it for associated functions
be6448b
to
0ed8d91
Compare
fix ci error emit err for `impl_item`
0ed8d91
to
3d0f9fb
Compare
@bors r+ rollup Thanks for doing all these changes! |
📌 Commit 3d0f9fb has been approved by |
…askrgr Rollup of 7 pull requests Successful merges: - rust-lang#97109 (Fix misleading `cannot infer type for type parameter` error) - rust-lang#97187 (Reverse condition in Vec::retain_mut doctest) - rust-lang#97201 (Fix typo) - rust-lang#97203 (Minor tweaks to rustc book summary formatting.) - rust-lang#97208 (Do not emit the lint `unused_attributes` for *inherent* `#[doc(hidden)]` associated items) - rust-lang#97215 (Add complexity estimation of iterating over HashSet and HashMap) - rust-lang#97220 (Add regression test for#81827) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
closes #93198