diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-04-20 21:15:53 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-04-20 21:15:53 -0400 |
| commit | 5de4e87f27597f8676271a507bdd4290c666c84b (patch) | |
| tree | c8a7517100622cac24a4076c7c0936ce9d0a82bb /src/libcore | |
| parent | 417ff8a4048a9938269e370d267ccea526b10d66 (diff) | |
| parent | 89ef6371e09519f595b3c9a090aa5aa48f0fe2b1 (diff) | |
| download | rust-5de4e87f27597f8676271a507bdd4290c666c84b.tar.gz rust-5de4e87f27597f8676271a507bdd4290c666c84b.zip | |
Rollup merge of #24628 - steveklabnik:gh24173, r=alexcrichton
Fixes #24173 These docs could all use examples, so for now, let's just remove the bad one, and when I go over this whole module I'll put in better ones.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/cmp.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index efe1179621d..dd59ceff577 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -14,27 +14,6 @@ //! implement comparison operators. Rust programs may implement `PartialOrd` to overload the `<`, //! `<=`, `>`, and `>=` operators, and may implement `PartialEq` to overload the `==` and `!=` //! operators. -//! -//! For example, to define a type with a customized definition for the PartialEq operators, you -//! could do the following: -//! -//! ``` -//! # #![feature(core)] -//! struct FuzzyNum { -//! num: i32, -//! } -//! -//! impl PartialEq for FuzzyNum { -//! // Our custom eq allows numbers which are near each other to be equal! :D -//! fn eq(&self, other: &FuzzyNum) -> bool { -//! (self.num - other.num).abs() < 5 -//! } -//! } -//! -//! // Now these binary operators will work when applied! -//! assert!(FuzzyNum { num: 37 } == FuzzyNum { num: 34 }); -//! assert!(FuzzyNum { num: 25 } != FuzzyNum { num: 57 }); -//! ``` #![stable(feature = "rust1", since = "1.0.0")] |
