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

suggest turbofish syntax for uninferred const arguments #77758

Merged
merged 1 commit into from
Nov 26, 2020

Conversation

Stupremee
Copy link
Member

When not providing a const generic value, and it can not be inferred, the following suggestion is suggested:
image

Resolves #76737

r? @varkor

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @varkor (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive
Copy link
Collaborator

⚠️ Warning ⚠️

  • These commits modify submodules.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 9, 2020
@Stupremee
Copy link
Member Author

Stupremee commented Oct 9, 2020

How do I revert the submodule change? 😅

Edit: Fixed it

@Stupremee Stupremee force-pushed the turbofish-help-for-const branch from 71f72fd to 59fc704 Compare October 9, 2020 18:03
@varkor varkor added A-const-generics Area: const generics (parameters and arguments) F-const_generics `#![feature(const_generics)]` labels Oct 9, 2020
Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

Thanks, this is a good start! I'd really like it if the missing type and missing const handling could be unified so we get good error messages in both cases (and don't have to do so much special casing), so it would be great if you could see if this is doable!

@varkor varkor added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 10, 2020
@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 9, 2020
@Dylan-DPC-zz
Copy link

@Stupremee any updates?

@Stupremee
Copy link
Member Author

No sorry. But I think I can do it in the next few days.

@jyn514 jyn514 added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 14, 2020
@Stupremee Stupremee force-pushed the turbofish-help-for-const branch from d1df5ef to c4e13f7 Compare November 15, 2020 19:44
@alex
Copy link
Member

alex commented Nov 15, 2020

Looks like there's an expected test output that needs to be updated.

Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

I think with the requested changes, and fixing the broken tests, it should be good to go.

@Stupremee Stupremee force-pushed the turbofish-help-for-const branch from c4e13f7 to edcb226 Compare November 17, 2020 09:17
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

If @varkor thinks the current state is good enough I am also fine with merging this as is.

@varkor
Copy link
Member

varkor commented Nov 18, 2020

@Stupremee: could you squash the commits into one?

@Stupremee Stupremee force-pushed the turbofish-help-for-const branch from 60fc911 to 4379a43 Compare November 18, 2020 18:23
@alex
Copy link
Member

alex commented Nov 26, 2020

Looks squashed, ready for bors?

@varkor
Copy link
Member

varkor commented Nov 26, 2020

@alex: thanks, I missed this!

@Stupremee: thanks for your work on this!

@bors r+

@bors
Copy link
Contributor

bors commented Nov 26, 2020

📌 Commit 4379a43 has been approved by varkor

@bors
Copy link
Contributor

bors commented Nov 26, 2020

🌲 The tree is currently closed for pull requests below priority 500, this pull request will be tested once the tree is reopened

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 26, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 26, 2020
…as-schievink

Rollup of 10 pull requests

Successful merges:

 - rust-lang#77758 (suggest turbofish syntax for uninferred const arguments)
 - rust-lang#79000 (Move lev_distance to rustc_ast, make non-generic)
 - rust-lang#79362 (Lower patterns before using the bound variable)
 - rust-lang#79365 (Upgrades the coverage map to Version 4)
 - rust-lang#79402 (Fix typos)
 - rust-lang#79412 (Clean up rustdoc tests by removing unnecessary features)
 - rust-lang#79413 (Fix persisted doctests on Windows / when using workspaces)
 - rust-lang#79420 (Fixes a word typo in librustdoc)
 - rust-lang#79421 (Fix docs formatting for `thir::pattern::_match`)
 - rust-lang#79428 (Fixup compiler docs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9b2117d into rust-lang:master Nov 26, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 26, 2020
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) F-const_generics `#![feature(const_generics)]` 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.

Suggest turbofish for uninferred const arguments
10 participants