Skip to content

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
@varkor
Copy link
Contributor

varkor commented Sep 28, 2019

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

@varkor
Copy link
Contributor

varkor commented Sep 28, 2019

Thanks @Skinny121, this looks good!

@bors r+

@bors
Copy link
Collaborator

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
Contributor

varkor commented Sep 29, 2019

@bors r+

@bors
Copy link
Collaborator

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
Development

Successfully merging this pull request may close these issues.

[Const generics] thread 'rustc' panicked at 'no errors encountered even though delay_span_bug issued' ICE with const generics over a &'static str
8 participants