-
Notifications
You must be signed in to change notification settings - Fork 64
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
x::Atom::none() should be made const fn #210
Comments
Not possible at the moment. impl base::Xid for Atom {
const fn none() -> Self { Atom { res_id: 0 } }
fn resource_id(&self) -> u32 { self.res_id }
}
See rust-lang/rust#71971 for tracking. |
Is it needed as a trait method? Can every struct/type have a const version of |
In fact, I checked out the repo locally, grepped, and haven't found any single trait-usage of |
I'd say no, but I can't change this without breaking semver. I'd need to make a version 2. I forgot to mention that you can use x::ATOM_NONE for static initialization. |
Use case: I wanted to initialize a global (static) variable with a "none" atom.
The text was updated successfully, but these errors were encountered: