paholg / typenum

Compile time numbers in Rust.
https://crates.io/crates/typenum
Other
518 stars 46 forks source link

please support Type Level Rust readability / usability improvements issue #202

Closed bionicles closed 11 months ago

bionicles commented 11 months ago

Hi @paholg I really love your crate here and built something cool with it but sadly the errors are so unreadable in the context of hlist of typenum I was compelled to make a Rustc git issue about it.

Figured i'd open one here just to give a link so you could contribute to that.

https://github.com/rust-lang/rust/issues/118676

Here is a repo with a reproduction of the issue and the readme explains the workarounds tried (like tnfilt etc) https://github.com/bionicles/broadcastable

Happy Holidays and keep it up!

Bion

paholg commented 11 months ago

The type output by the Rust compiler is the type. The compiler can't know what your "desired alias" is.

There is this project, linked to in typenum's readme, to help with typenum's error messages specifically: https://github.com/auxoncorp/tnfilt

bionicles commented 11 months ago

yeah, i know rustc is just writing the type, the same thing happens to my hlists.

I just wish we could use what you call desired aliases, to make these errors more readable.

when i tried tnfilt, it deleted all the colorization of the terminal output, so that's not a really satisfying solution, and their crate isn't maintained since 2019 even if it does technically work, it's a bit weird to need to run everything through some package just to have readable errors, that qualifies as a "hack" in my book

anyway i didn't mean it as any negative comment about typenum, sorry if it came off that way, just more of an enhancement idea to make type level rust better for the rust 2024 edition.

thanks for your awesome crates, typenum is boss!