Removed Ord, PartialOrd.
Ordering Spans don't make sense.
// option. All files in the project carrying such notice may not be copied,
// modified, or distributed except according to those terms.
-use std::cmp::Ordering;
use std::fmt;
use std::hash::{Hash, Hasher};
use std::ptr;
@@ -174,28 +173,6 @@ impl<'i> PartialEq for Span<'i> {
impl<'i> Eq for Span<'i> {}
-impl<'i> PartialOrd for Span<'i> {
- fn partial_cmp(&self, other: &Span<'i>) -> Option<Ordering> {
- if ptr::eq(self.input, other.input) {
- match self.start.partial_cmp(&other.start) {
- Some(Ordering::Equal) => self.end.partial_cmp(&other.end),
- ordering => ordering
- }
- } else {
- None
- }
- }
-}
-
-impl<'i> Ord for Span<'i> {
- fn cmp(&self, other: &Span<'i>) -> Ordering {
- self.partial_cmp(other).expect(
- "cannot compare spans from \
- different inputs"
- )
- }
-}
-
impl<'i> Hash for Span<'i> {
fn hash<H: Hasher>(&self, state: &mut H) {
(self.input as *const [u8]).hash(state);
