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

Add support for relating slices in super_relate_consts #64858

Merged
merged 5 commits into from
Sep 29, 2019

Conversation

BenLewis-Seequent
Copy link

This allows passing strings as generic arguments.

Fixes #63773
Fixes #60813

r? @varkor

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 27, 2019
src/librustc/ty/relate.rs Outdated Show resolved Hide resolved
@varkor
Copy link
Member

varkor commented Sep 28, 2019

cc @yodaldevoid, who looked into the issue previously — you might have some thoughts.

src/librustc/ty/relate.rs Outdated Show resolved Hide resolved
@varkor
Copy link
Member

varkor commented Sep 28, 2019

Thanks @Skinny121, this looks good!

@bors r+

@bors
Copy link
Contributor

bors commented Sep 28, 2019

📌 Commit 5cb0039 has been approved by varkor

@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 Sep 28, 2019
@yodaldevoid
Copy link
Contributor

yodaldevoid commented Sep 28, 2019

Good job fixing this! I don't know if you went through all of the const generics issues, but this might fix a couple more than you noted.

@BenLewis-Seequent
Copy link
Author

@yodaldevoid I think this PR only fixes the two cases I mentioned.

#63322, #62579, and #62395 are similar but are for different types than strings/slices.

LL | let _: ConstString<"Hello"> = ConstString::<"World">;
| ^^^^^^^^^^^^^^^^^^^^^^ expected `"Hello"`, found `"World"`
|
= note: expected type `ConstString<>`
Copy link
Contributor

Choose a reason for hiding this comment

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

btw @varkor, this is a rather unfortunate diagnostic... do we have an issue for that?

Copy link
Author

Choose a reason for hiding this comment

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

There is a case for it: #61395.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah excellent, thanks!

@varkor
Copy link
Member

varkor commented Sep 29, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Sep 29, 2019

📌 Commit 54bad93 has been approved by varkor

Centril added a commit to Centril/rust that referenced this pull request Sep 29, 2019
Add support for relating slices in `super_relate_consts`

This allows passing strings as generic arguments.

Fixes rust-lang#63773
Fixes rust-lang#60813

r? @varkor
Centril added a commit to Centril/rust that referenced this pull request Sep 29, 2019
Add support for relating slices in `super_relate_consts`

This allows passing strings as generic arguments.

Fixes rust-lang#63773
Fixes rust-lang#60813

r? @varkor
bors added a commit that referenced this pull request Sep 29, 2019
Rollup of 6 pull requests

Successful merges:

 - #64691 (Point at definition when misusing ADT)
 - #64735 (Add long error explanation for E0533)
 - #64825 (Point at enclosing match when expecting `()` in arm)
 - #64858 (Add support for relating slices in `super_relate_consts`)
 - #64894 (syntax: fix dropping of attribute on first param of non-method assocated fn)
 - #64898 (fixed typo)

Failed merges:

r? @ghost
@bors bors merged commit 54bad93 into rust-lang:master Sep 29, 2019
@varkor varkor added the F-const_generics `#![feature(const_generics)]` label Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
8 participants