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

Rollup of 20 pull requests #35908

Merged
merged 47 commits into from
Aug 23, 2016
Merged
Changes from 2 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b9762f8
Update E0033 to the new error format
munyari Aug 8, 2016
80beeb3
Add additional error note
munyari Aug 11, 2016
a37e90a
Make E0033 tests fit in 100 cols
munyari Aug 14, 2016
2c190ad
Update block codes' flags
GuillaumeGomez Aug 19, 2016
f551674
Add new error code tests
GuillaumeGomez Aug 19, 2016
5d02b03
New format for E0426
tvladyslav Aug 19, 2016
f796112
Fix typos in unix/rwlock.rs
apasel422 Aug 20, 2016
825fd11
replace `Rem` example with something more evocative
matthew-piziak Aug 20, 2016
ff44f08
Update E0424 to the new error format
kyrias Aug 20, 2016
1dfc5db
replace `Index` example with something more evocative of indexing
matthew-piziak Aug 20, 2016
9bb8b65
Update E0503 to the new format
wesleywiser Aug 21, 2016
738b91e
Update lib.rs
shyamsundarb-arch Aug 21, 2016
8b18e78
replace `println!` statements with `assert!`ions in `std::ptr` examples
matthew-piziak Aug 21, 2016
18445cd
Fix "Furthermore" Typo in String Docs
CryZe Aug 21, 2016
5310d11
add example for `Rc::would_unwrap`
matthew-piziak Aug 21, 2016
17f9937
rustc: Fix outdated comment
petrochenkov Aug 21, 2016
4b6477f
Minor type in CONTRIBUTING.md
alevy Aug 22, 2016
a5a5c10
Add reference to `Self` in traits chapter (book)
munyari Aug 22, 2016
1d78f9e
Add sublime-rust to CONFIGS.md.
terrynsun Aug 22, 2016
820c810
Updated E0054 to new format
Aug 22, 2016
a4c6307
Updated E0432 to new format
Aug 22, 2016
8fdc531
Updated E0423 to new format
Aug 22, 2016
cdb4af8
Remove E0455 test (for now)
GuillaumeGomez Aug 22, 2016
3da5f93
Correct failing book test
munyari Aug 22, 2016
38f0bca
replace `Mul` example with something more evocative of multiplication
matthew-piziak Aug 20, 2016
9f88f8a
replace `BitAnd` example with something more evocative of bitwise AND
matthew-piziak Aug 18, 2016
bfbdff0
Updated error message E0388
Aug 5, 2016
ab73421
Rollup merge of #35360 - medzin:E0388, r=jonathandturner
Aug 22, 2016
f46438c
Rollup merge of #35526 - munyari:e0033, r=jonathandturner
Aug 22, 2016
b695049
Rollup merge of #35809 - matthew-piziak:bitwise-and-example, r=Guilla…
Aug 22, 2016
40f40e6
Rollup merge of #35817 - wesleywiser:fix_35703, r=jonathandturner
Aug 22, 2016
5523db8
Rollup merge of #35820 - knight42:update-error-msg, r=jonathandturner
Aug 22, 2016
025c5e7
Rollup merge of #35824 - GuillaumeGomez:err_codes, r=jonathandturner
Aug 22, 2016
ae83225
Rollup merge of #35835 - crypto-universe:E0426, r=jonathandturner
Aug 22, 2016
cc51d1c
Rollup merge of #35841 - kyrias:new-error-E0424, r=GuillaumeGomez
Aug 22, 2016
7c2fba6
Rollup merge of #35842 - apasel422:typo, r=GuillaumeGomez
Aug 22, 2016
0c84ac1
Rollup merge of #35858 - shyaamsundhar:patch-1, r=GuillaumeGomez
Aug 22, 2016
21c3287
Rollup merge of #35860 - matthew-piziak:mul-example, r=GuillaumeGomez
Aug 22, 2016
61f62ec
Rollup merge of #35861 - matthew-piziak:rem-example, r=GuillaumeGomez
Aug 22, 2016
36b8322
Rollup merge of #35864 - matthew-piziak:index-example, r=GuillaumeGomez
Aug 22, 2016
19f30d3
Rollup merge of #35878 - matthew-piziak:ptr-assertions, r=GuillaumeGomez
Aug 22, 2016
b560f5a
Rollup merge of #35879 - CryZe:patch-2, r=apasel422
Aug 22, 2016
375695c
Rollup merge of #35881 - matthew-piziak:rc-would-unwrap-example, r=Gu…
Aug 22, 2016
252f3c5
Rollup merge of #35882 - petrochenkov:patch-2, r=eddyb
Aug 22, 2016
766b04e
Rollup merge of #35889 - alevy:patch-1, r=GuillaumeGomez
Aug 22, 2016
d5deb11
Rollup merge of #35891 - munyari:book, r=steveklabnik
Aug 22, 2016
8ea2936
Rollup merge of #35901 - terrynsun:configs, r=steveklabnik
Aug 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions src/libcore/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,26 +694,41 @@ not_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
///
/// # Examples
///
/// A trivial implementation of `BitAnd`. When `Foo & Foo` happens, it ends up
/// calling `bitand`, and therefore, `main` prints `Bitwise And-ing!`.
/// In this example, the `BitAnd` trait is implemented for a `BooleanVector`
/// struct.
///
/// ```
/// use std::ops::BitAnd;
///
/// struct Foo;
///
/// impl BitAnd for Foo {
/// type Output = Foo;
///
/// fn bitand(self, _rhs: Foo) -> Foo {
/// println!("Bitwise And-ing!");
/// self
/// #[derive(Debug)]
/// struct BooleanVector {
/// value: Vec<bool>,
/// };
///
/// impl BitAnd for BooleanVector {
/// type Output = Self;
///
/// fn bitand(self, rhs: Self) -> Self {
/// BooleanVector {
/// value: self.value
/// .iter()
/// .zip(rhs.value.iter())
/// .map(|(x, y)| *x && *y)
/// .collect(),
/// }
/// }
/// }
///
/// fn main() {
/// Foo & Foo;
/// impl PartialEq for BooleanVector {
/// fn eq(&self, other: &Self) -> bool {
/// self.value == other.value
/// }
/// }
///
/// let bv1 = BooleanVector { value: vec![true, true, false, false] };
/// let bv2 = BooleanVector { value: vec![true, false, true, false] };
/// let expected = BooleanVector { value: vec![true, false, false, false] };
/// assert_eq!(bv1 & bv2, expected);
/// ```
#[lang = "bitand"]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down