Skip to content
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

TaKO8Ki
Copy link
Member

@TaKO8Ki TaKO8Ki commented May 17, 2022

closes #93198

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 17, 2022
@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 17, 2022
@oli-obk
Copy link
Contributor

oli-obk commented May 20, 2022

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()
Copy link
Contributor

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

@TaKO8Ki TaKO8Ki force-pushed the fix-misleading-cannot-infer-type-for-type-parameter-error branch from be6448b to 0ed8d91 Compare May 20, 2022 05:50
@TaKO8Ki TaKO8Ki force-pushed the fix-misleading-cannot-infer-type-for-type-parameter-error branch from 0ed8d91 to 3d0f9fb Compare May 20, 2022 14:04
@oli-obk
Copy link
Contributor

oli-obk commented May 20, 2022

@bors r+ rollup

Thanks for doing all these changes!

@bors
Copy link
Contributor

bors commented May 20, 2022

📌 Commit 3d0f9fb has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 20, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request May 20, 2022
…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
@bors bors merged commit 76f662c into rust-lang:master May 20, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 20, 2022
@TaKO8Ki TaKO8Ki deleted the fix-misleading-cannot-infer-type-for-type-parameter-error branch June 3, 2022 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading cannot infer type for type parameter
5 participants