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 FIXME for generic_arg_infer in create_substs_for_ast_path #91847

Merged
merged 2 commits into from
Dec 13, 2021

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Dec 13, 2021

Fixes a FIXME, does some general refactoring of this fn, and also fixes a bug where we would use a const params defaults instead of an inference var (playground)
(lot of stuff in one PR but it was all so close together...)

r? @lcnr

Fixes #91614

@BoxyUwU BoxyUwU added the A-const-generics Area: const generics (parameters and arguments) label Dec 13, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 13, 2021
@lcnr
Copy link
Contributor

lcnr commented Dec 13, 2021

❤️
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 13, 2021

📌 Commit 6c79595 has been approved by lcnr

@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 Dec 13, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 13, 2021
…lcnr

Fix FIXME for `generic_arg_infer` in `create_substs_for_ast_path`

Fixes a FIXME, does some general refactoring of this fn, and also fixes a bug where we would use a const params defaults instead of an inference var ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=19456f65ea5dc3fcaa9b696f842ab380))
(lot of stuff in one PR but it was all so close together...)

r? `@lcnr`

Fixes rust-lang#91614
LL | let y = Mask::<_, _>::splat(false);
| - ^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `T`
| |
| consider giving `y` the explicit type `Mask<_, LANES>`, where the type parameter `T` is specified
Copy link
Member

@fmease fmease Dec 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| consider giving `y` the explicit type `Mask<_, LANES>`, where the type parameter `T` is specified
| consider giving `y` the explicit type `Mask<T, LANES>`, where the type parameter `T` is specified

Shouldn't the _ be T for the suggestion to make sense (in isolation)? It says consider giving […] the explicit type […], where the type parameter T is specified. In this case , it might not be ambiguous. However, when more type parameters are involved it would be. I remember there was some part in rustc which could handle this generically.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea this error message is sort of weird (especially how it is _ for the type and LANES for the const despite both being inference var)

@camelid camelid added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 13, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 13, 2021
…askrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#91699 (Add `-webkit-appearance: none` to search input)
 - rust-lang#91846 (rustdoc: Reduce number of arguments for `run_test` a bit)
 - rust-lang#91847 (Fix FIXME for `generic_arg_infer` in `create_substs_for_ast_path`)
 - rust-lang#91849 (GATs outlives lint: Try to prove bounds)
 - rust-lang#91855 (Stabilize const_cstr_unchecked)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f8de2f5 into rust-lang:master Dec 13, 2021
@rustbot rustbot added this to the 1.59.0 milestone Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) 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.

Mask::<_,_>::splat(false) breaks #![feature(generic_arg_infer)]
7 participants