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 help note to unconstrained const parameter #76401

Merged
merged 1 commit into from
Sep 9, 2020

Conversation

JulianKnodt
Copy link
Contributor

@JulianKnodt JulianKnodt commented Sep 6, 2020

Resolves #68366, since it is currently intended behaviour.
If demonstrating T -> U is injective, there should be an additional word that it is not yet supported.

r? @lcnr

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 6, 2020
@lcnr
Copy link
Contributor

lcnr commented Sep 6, 2020

Can you add https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=51d59876e3827706e44f9891bf73dfe8 as a test?

I am not sure how well the error message reads in that case

@jyn514 jyn514 added A-const-generics Area: const generics (parameters and arguments) A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 7, 2020
Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

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

LGTM with nit fixed

compiler/rustc_typeck/src/impl_wf_check.rs Outdated Show resolved Hide resolved
@lcnr
Copy link
Contributor

lcnr commented Sep 7, 2020

cc @varkor on the final wording here

I think this is already quite helpful and I don't know how to improve this.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 7, 2020

📌 Commit a1fcdff374551c213f986f226505f64cb26a011e 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 Sep 7, 2020
@bors
Copy link
Contributor

bors commented Sep 7, 2020

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Sep 7, 2020

📌 Commit a1fcdff374551c213f986f226505f64cb26a011e has been approved by lcnr

@jyn514
Copy link
Member

jyn514 commented Sep 7, 2020

@bors r=lcnr

It got reset when @JulianKnodt pushed the fixes to my nit (whoops)

@bors
Copy link
Contributor

bors commented Sep 7, 2020

📌 Commit ee55c1f has been approved by lcnr

"expressions using a const parameter must map each value to a distinct output value",
);
err.note(
"proving the result of expressions other than the parameter are unique is not supported",
Copy link
Member

Choose a reason for hiding this comment

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

I think the meaning of this comment may not be entirely clear to someone unfamiliar with the constraints of const generics, but I'm not sure of better wording yet. I'll have a think about it.

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 9, 2020
Rollup of 10 pull requests

Successful merges:

 - rust-lang#76162 (Make duration_since documentation more clear)
 - rust-lang#76355 (remove public visibility previously needed for rustfmt)
 - rust-lang#76374 (Improve ayu doc source line number contrast)
 - rust-lang#76379 (rustbuild: Remove `Mode::Codegen`)
 - rust-lang#76389 (Fix HashMap visualizers in Visual Studio (Code))
 - rust-lang#76396 (Fix typo in tracking issue template)
 - rust-lang#76401 (Add help note to unconstrained const parameter)
 - rust-lang#76402 (Update linker-plugin-lto.md to contain up to rust 1.46)
 - rust-lang#76403 (Fix documentation for TyCtxt::all_impls)
 - rust-lang#76498 (Update cargo)

Failed merges:

 - rust-lang#76458 (Add drain_filter method to HashMap and HashSet)

r? `@ghost`
@bors bors merged commit 1083833 into rust-lang:master Sep 9, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 9, 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) A-diagnostics Area: Messages for errors, warnings, and lints 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.

Const generics unconstrained generics
7 participants