-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Unclear error when on mismatched type parameter with a default value #120785
Labels
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.
Comments
progval
added
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
Feb 8, 2024
@rustbot claim |
veera-sivarajan
added a commit
to veera-sivarajan/rust
that referenced
this issue
Feb 21, 2024
veera-sivarajan
added a commit
to veera-sivarajan/rust
that referenced
this issue
Feb 21, 2024
veera-sivarajan
added a commit
to veera-sivarajan/rust
that referenced
this issue
Feb 21, 2024
veera-sivarajan
added a commit
to veera-sivarajan/rust
that referenced
this issue
Feb 21, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Feb 23, 2024
…thercote Improve error messages for generics with default parameters Fixes rust-lang#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.
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Feb 28, 2024
…nethercote Improve error messages for generics with default parameters Fixes rust-lang#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.
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Mar 1, 2024
…nethercote Improve error messages for generics with default parameters Fixes rust-lang#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.
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Mar 1, 2024
…nethercote Improve error messages for generics with default parameters Fixes rust-lang#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.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 1, 2024
…nethercote Improve error messages for generics with default parameters Fixes rust-lang#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.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 1, 2024
…nethercote Improve error messages for generics with default parameters Fixes rust-lang#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.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 1, 2024
…nethercote Improve error messages for generics with default parameters Fixes rust-lang#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.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 1, 2024
…nethercote Improve error messages for generics with default parameters Fixes rust-lang#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.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 1, 2024
Rollup merge of rust-lang#121416 - veera-sivarajan:bugfix-120785, r=nnethercote Improve error messages for generics with default parameters Fixes rust-lang#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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Code
Current output
Desired output
or
Rationale and extra context
The current error message does not tell me the mismatch is in
WrapperWithMismatchedParameters
rather than inLooooooongObscureType
. It is also inconsistent with the error message I would get ifWrapperWithMismatchedParameters
has without the default types.Other cases
When removing the default for the first parameter (which is not the mismatched one) like this:
the error message is clearer:
Rust Version
Anything else?
playground
The text was updated successfully, but these errors were encountered: