-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Move uses of enum
to bitflags!
where appropriate
#14207
Labels
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Comments
Happy to work on this, took a stab at it a while ago using EnumSet, keen for round 2. |
@richo Great! Let me know if I can help, and I'd be happy to review a PR once it's ready. |
I'm going to close this for now, since |
lnicola
pushed a commit
to lnicola/rust
that referenced
this issue
Mar 13, 2023
Respect $CARGO_HOME when looking up toolchains. Some people set `$CARGO_HOME` to a location other than `~/.cargo` (`$XDG_DATA_DIR/cargo`, in my case), and I'd be a little nicer if the rust-analyzer extension and server respect that value when looking up toolchains, instead of having us configure all of `$CARGO`, `$RUSTC` ... manually. The new implementation still defaults to `~/.cargo` if `$CARGO_HOME` is unset, pretty much like cargo itself does (as documented in https://doc.rust-lang.org/cargo/guide/cargo-home.html), so the change is backwards compatible for most people except those who has configured `$CARGO_HOME` explicitly. I considered using https://crates.io/crates/home as suggested by https://doc.rust-lang.org/cargo/guide/cargo-home.html, but decided to put int on hold because i) we need mirror impl in node, ii) I thought the consistency matters more and iii) the new implementation shouldn't be worse than the current one (i.e. switching to `home` improvement is rather orthogonal and could be done in another PR). If you have any directions on this, please let me know.
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Feb 20, 2025
…not implement `Copy` (rust-lang#14207) Fix rust-lang#14201 changelog: [`unnecessary_map_or`]: do not consume the comparison value if it does not implement `Copy`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Where an
enum
has been used to represent C-style flags (which are then|
-ed together and represented as some flavor ofuint
), we should now be using thebitflags!
macro, which provides stronger type safety guarantees at no cost.This gist gives a rough grep of the code base where
enum
s with custom discriminants are being used. Some of these are genuinelyenum
s, while others are being used as flags and should be converted to usebitflags!
instead.The text was updated successfully, but these errors were encountered: