Modernization and default generation#205
Conversation
This bumps the minimum required Rust version to 1.30.
This bumps the minimum required Rust version to 1.31.
This commit enables the bitflag!() macro to receive a default() stuffix which specifies which flags are included in the default. It generates both an impl of the Default trait as well as a const fn default for use in constant contexts. This bumps the minimum required Rust version to 1.33.
Prefer "use bitflags::bitflags;" to "#[macro_use] extern crate bitflags;".
Modern rust doesn't require "extern crate foo;", therefore we can simplify a number of things.
|
Thanks for the PR @npmccallum! I think we should consider the modernization effort independently of the new For the |
|
@npmccallum do you plan to continue working on this? If not, I'd try to extract the modernization part and open a new PR for that. |
|
@konsumlamm go ahead! |
|
Thanks for working on this @npmccallum! Things have steadily moved forwards here and your modernization changes have made their way through. I'll go ahead and close this one for now. As for |
This PR contains five patches. Four do modernization work. One implements a new
default()suffix feature.I pursued modernization first because it simplified the macro structure before adding a new macro feature.
My main interest is the
default()suffix feature. The existing methods for doingimpl Defaulthave served us fairly well. However, their main drawback is that we don't have the opportunity to generate aconst fn default()for use in constant contexts.