-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Omit suffixes (e. g. 1_i32
) in const generic compilation errors
#99255
Comments
I would say this is fairly minor, but if they should be omitted then they should only be omitted if they match (i32 and i32). |
So const generics always have a type, so they should always match, I think. Or else we'd have hit en error earlier along the lines of "expected i32, found u32". |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jul 20, 2022
…t-generic-suffixes, r=petrochenkov feat: omit suffixes in const generics (e.g. `1_i32`) Closes rust-lang#99255
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Jul 21, 2022
…t-generic-suffixes, r=petrochenkov feat: omit suffixes in const generics (e.g. `1_i32`) Closes rust-lang#99255
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Jul 21, 2022
…t-generic-suffixes, r=petrochenkov feat: omit suffixes in const generics (e.g. `1_i32`) Closes rust-lang#99255
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Jul 21, 2022
…t-generic-suffixes, r=petrochenkov feat: omit suffixes in const generics (e.g. `1_i32`) Closes rust-lang#99255
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Jul 22, 2022
…t-generic-suffixes, r=petrochenkov feat: omit suffixes in const generics (e.g. `1_i32`) Closes rust-lang#99255
Logarithmus
added a commit
to Logarithmus/rust
that referenced
this issue
Jul 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm working on a library for compile time dimensional analysis. It uses const generics. On unit mismatch I get errors like this:
As you can see,
rustc
includes this_i32
type suffix into each const generic parameter. I think it's redundant & only makes compilation errors longer (which is important especially if you have complex combinations of units), because if you really want to learn the type of const generic parameter, you can just look atstruct
definition in source code.I'd like error message to look like this:
The text was updated successfully, but these errors were encountered: