Skip to content

Improve error message for APIT with explicit generic arguments #65614

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 21, 2019

Conversation

varkor
Copy link
Member

@varkor varkor commented Oct 20, 2019

This is disallowed with type or const generics. cc #61410.

@varkor varkor added the F-const_generics `#![feature(const_generics)]` label Oct 20, 2019
@rust-highfive
Copy link
Contributor

Some changes occurred in diagnostic error codes

cc @GuillaumeGomez

@rust-highfive
Copy link
Contributor

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 20, 2019
@varkor varkor changed the title Improve error message for APIT with explicit generic parameters Improve error message for APIT with explicit generic arguments Oct 20, 2019
@varkor varkor force-pushed the apit-explicit-generics branch from 8016331 to 547259f Compare October 20, 2019 00:22
--> $DIR/synthetic-param.rs:23:5
|
LL | Foo::func::<u8>(42);
| ^^^^^^^^^^^^^^^

error[E0632]: cannot provide explicit type parameters when `impl Trait` is used in argument position.
error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
--> $DIR/synthetic-param.rs:26:5
|
LL | Bar::<i8>::func::<u8>(42);
Copy link
Member Author

@varkor varkor Oct 20, 2019

Choose a reason for hiding this comment

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

This span is not very good. I'll file a follow up issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

Filed #65642.

This is disallowed with type or const generics.
@varkor varkor force-pushed the apit-explicit-generics branch from 547259f to 2f7c9a2 Compare October 20, 2019 00:40
@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 20, 2019

📌 Commit 2f7c9a2 has been approved by matthewjasper

@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 Oct 20, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 20, 2019
…tthewjasper

Improve error message for APIT with explicit generic arguments

This is disallowed with type or const generics. cc rust-lang#61410.
bors added a commit that referenced this pull request Oct 20, 2019
Rollup of 8 pull requests

Successful merges:

 - #65314 (rustdoc: forward -Z options to rustc)
 - #65592 (clarify const_prop ICE protection comment)
 - #65603 (Avoid ICE when include! is used by stdin crate)
 - #65614 (Improve error message for APIT with explicit generic arguments)
 - #65629 (Remove `borrowck_graphviz_postflow` from test)
 - #65633 (Remove leading :: from paths in doc examples)
 - #65638 (Rename the default argument 'def' to 'default')
 - #65639 (Fix parameter name in documentation)

Failed merges:

r? @ghost
@bors bors merged commit 2f7c9a2 into rust-lang:master Oct 21, 2019
# for free to join this conversation on GitHub. Already have an account? # 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.

4 participants