Closed shepmaster closed 2 years ago
What about using #[non_exhaustive]
instead of _other
? See https://stackoverflow.com/a/70965787/1021920 for more information 😜
The code itself seems to have that hint, but the current minimum tested version of Rust is 1.34. Unless we're OK with bumping this in the next version, we'll need to gate the presence of _other
on a feature (rust_1_46 already exists) or just keep it regardless.
current minimum tested version of Rust is 1.34
Where do you get that information from? I can't find that in the readme or docs?
#[non_exhaustive]
was introduced in 1.40 so rust_1_46
should be okay to use, I guess?
Else one could use a build.rs
file to determine the rust version and detect the rust version which then sets the feature flag automatically.
In the end, it should be relativly easy to adapt the Debug
output, by using debug_struct
even without using #[non_exhaustive]
:
fmt.debug_struct("Location")
.field("file", &self.file)
.field("line", &self.line)
.field("column", &self.column)
.finish()
(btw. hello enet4 👋 :) )
current minimum tested version of Rust is 1.34
Where do you get that information from? I can't find that in the readme or docs?
It's in the compatibility page of the guide.
#[non_exhaustive]
was introduced in 1.40 sorust_1_46
should be okay to use, I guess? Else one could use abuild.rs
file to determine the rust version and detect the rust version which then sets the feature flag automatically.
I wouldn't go as far as to use build scripts for this.
In the end, it should be relativly easy to adapt the
Debug
output, by usingdebug_struct
even without using#[non_exhaustive]
:Sounds like you are ready to send in a PR. :)
(btw. hello enet4 👋 :) )
Hai 👋
https://github.com/dtolnay/rustversion could allow easily conditioning compilation on the Rust version without directly using a build script.
It's noise and looking at the
Debug
format is pretty common for quick debugging.