Skip to content

Commit 5de4e87

Browse files
committed
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.
2 parents 417ff8a + 89ef637 commit 5de4e87

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/libcore/cmp.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,6 @@
1414
//! implement comparison operators. Rust programs may implement `PartialOrd` to overload the `<`,
1515
//! `<=`, `>`, and `>=` operators, and may implement `PartialEq` to overload the `==` and `!=`
1616
//! operators.
17-
//!
18-
//! For example, to define a type with a customized definition for the PartialEq operators, you
19-
//! could do the following:
20-
//!
21-
//! ```
22-
//! # #![feature(core)]
23-
//! struct FuzzyNum {
24-
//! num: i32,
25-
//! }
26-
//!
27-
//! impl PartialEq for FuzzyNum {
28-
//! // Our custom eq allows numbers which are near each other to be equal! :D
29-
//! fn eq(&self, other: &FuzzyNum) -> bool {
30-
//! (self.num - other.num).abs() < 5
31-
//! }
32-
//! }
33-
//!
34-
//! // Now these binary operators will work when applied!
35-
//! assert!(FuzzyNum { num: 37 } == FuzzyNum { num: 34 });
36-
//! assert!(FuzzyNum { num: 25 } != FuzzyNum { num: 57 });
37-
//! ```
3817
3918
#![stable(feature = "rust1", since = "1.0.0")]
4019

0 commit comments

Comments
 (0)