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

improve type const mismatch errors #79032

Merged
merged 3 commits into from
Nov 17, 2020
Merged

improve type const mismatch errors #79032

merged 3 commits into from
Nov 17, 2020

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Nov 13, 2020

Doesn't completely remove check_generic_arg_count as that would have required some more complex changes but
instead checks type and const params in only one step. Also moved the help added by @JulianKnodt in #75611 to generic_arg_mismatch_err.

r? @varkor cc @petrochenkov

@lcnr lcnr added F-const_generics `#![feature(const_generics)]` D-verbose Diagnostics: Too much output caused by a single piece of incorrect code. F-min_const_generics labels Nov 13, 2020
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 13, 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.

Implementation looks good to me, and the diagnostics improvements are really nice, thanks! I just have one suggestion about a diagnostic tweak.

compiler/rustc_typeck/src/astconv/generics.rs Outdated Show resolved Hide resolved
@varkor
Copy link
Member

varkor commented Nov 16, 2020

r=me after squashing.

@lcnr
Copy link
Contributor Author

lcnr commented Nov 16, 2020

@bors r=varkor rollup

@bors
Copy link
Contributor

bors commented Nov 16, 2020

📌 Commit 69b43c2 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 Nov 16, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 16, 2020
Rollup of 11 pull requests

Successful merges:

 - rust-lang#74989 (Implement `Index` and `IndexMut` for arrays)
 - rust-lang#76339 (Test structural matching for all range types)
 - rust-lang#77691 (Rename/Deprecate LayoutErr in favor of LayoutError)
 - rust-lang#78364 (Update RELEASES.md for 1.48.0)
 - rust-lang#78678 (Add tests and improve rendering of cfgs on traits)
 - rust-lang#78714 (Simplify output capturing)
 - rust-lang#78769 (Remove unneeded lifetimes in array/mod.rs)
 - rust-lang#78903 (BTreeMap: test chaotic ordering & other bits & bobs)
 - rust-lang#79032 (improve type const mismatch errors)
 - rust-lang#79061 (Make all rustdoc functions and structs crate-private)
 - rust-lang#79087 (Update E0744 about control flow in `const` contexts to accurately describe when the error is triggered and why)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 835faa5 into rust-lang:master Nov 17, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 17, 2020
@lcnr lcnr deleted the arg-count branch November 17, 2020 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-verbose Diagnostics: Too much output caused by a single piece of incorrect code. 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.

6 participants