Skip to content
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

Remove std::bool::{Bool, all_values} #12473

Merged
merged 1 commit into from
Feb 25, 2014
Merged

Conversation

brendanzab
Copy link
Member

These were never used outside of the tests.

@alexcrichton
Copy link
Member

I'm a little sad to see these go, I would rather see them as an inherent implementation on the bool type itself. I agree that they're used very rarely, but being able to say foo.and(bar) may have a use case somewhere...

@brendanzab
Copy link
Member Author

I suggested changing the names of the operator traits in #12315, but it was almost universally shot down. I am going to add a Boolean trait in libnum. For now, bitand, bitor, bitxor and not can be used.

@brendanzab
Copy link
Member Author

Here is my proposed trait. I was going to put it in num-rs for now, but can add it along with this PR if you like.

@brendanzab
Copy link
Member Author

Added the Boolean trait to num-rs: https://github.com/bjz/num-rs/blob/master/src/math/algebra.rs#L579

@huonw
Copy link
Member

huonw commented Feb 23, 2014

👍 from me.

These were never used outside of the tests
bors added a commit that referenced this pull request Feb 25, 2014
These were never used outside of the tests.
@bors bors closed this Feb 25, 2014
@bors bors merged commit 6efa3c6 into rust-lang:master Feb 25, 2014
@brendanzab brendanzab deleted the remove-bool branch February 25, 2014 11:43
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2022
…ykril

fix: avoid adding enum parens in use path

close rust-lang#12420
dingxiangfei2009 pushed a commit to dingxiangfei2009/rust that referenced this pull request Jul 28, 2024
…endoo

Fix handling of `Deref` in `assigning_clones`

The `assigning_clones` lint had a special case for producing a bit nicer code for mutable references:
```rust
fn clone_function_lhs_mut_ref(mut_thing: &mut HasCloneFrom, ref_thing: &HasCloneFrom) {
    *mut_thing = Clone::clone(ref_thing);
}
//v
fn clone_function_lhs_mut_ref(mut_thing: &mut HasCloneFrom, ref_thing: &HasCloneFrom) {
    Clone::clone_from(mut_thing, ref_thing);
}
```
However, this could [break](rust-lang/rust-clippy#12437) when combined with `Deref`.

This PR removes the special case, so that the generated code should work more generally. Later we can improve the detection of `Deref` and put the special case back in a way that does not break code.

Fixes: rust-lang/rust-clippy#12437

r? `@blyxyas`

changelog: [`assigning_clones`]: change applicability to `Unspecified` and fix a problem with `Deref`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants