Skip to content

Improve error messages for generics with default parameters#121416

Merged
bors merged 3 commits intorust-lang:masterfrom
veera-sivarajan:bugfix-120785
Mar 1, 2024
Merged

Improve error messages for generics with default parameters#121416
bors merged 3 commits intorust-lang:masterfrom
veera-sivarajan:bugfix-120785

Conversation

@veera-sivarajan
Copy link
Copy Markdown
Contributor

Fixes #120785

Issue: Previously, all type parameters with default types were deliberately ignored to simplify error messages. For example, an error message for Box type would display Box<T> instead of Box<T, _>. But, this resulted in unclear error message when a concrete type was used instead of the default type.

Fix: This PR fixes it by checking if a concrete type is specified after a default type to display the entire type name or the simplified type name.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Unclear error when on mismatched type parameter with a default value

6 participants