about summary refs log tree commit diff
path: root/src/libsyntax/util
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-14 16:22:19 +0000
committerbors <bors@rust-lang.org>2018-07-14 16:22:19 +0000
commit0db03e635a5e38ebc7635637b870b8fbcc8a7e46 (patch)
tree44b2d1b1a644231eefcff62a9eb9018ab4d7d1c5 /src/libsyntax/util
parent1731f0af22af16c461b2b7abe58988b8549b2de6 (diff)
parent7d142c1e53165fea78314117f59e13257d7bf85d (diff)
downloadrust-0db03e635a5e38ebc7635637b870b8fbcc8a7e46.tar.gz
rust-0db03e635a5e38ebc7635637b870b8fbcc8a7e46.zip
Auto merge of #51829 - petrochenkov:noideq, r=eddyb
Remove most of `PartialEq` and `Hash` impls from AST and HIR structures

Continuation of https://github.com/rust-lang/rust/pull/49326, prerequisite for removing `PartialEq` for `Ident`.
Diffstat (limited to 'src/libsyntax/util')
-rw-r--r--src/libsyntax/util/parser.rs20
-rw-r--r--src/libsyntax/util/parser_testing.rs8
2 files changed, 3 insertions, 25 deletions
diff --git a/src/libsyntax/util/parser.rs b/src/libsyntax/util/parser.rs
index 15d910b33b0..67bc6f947b5 100644
--- a/src/libsyntax/util/parser.rs
+++ b/src/libsyntax/util/parser.rs
@@ -11,12 +11,10 @@ use parse::token::{Token, BinOpToken};
 use symbol::keywords;
 use ast::{self, BinOpKind};
 
-use std::cmp::Ordering;
-
 /// Associative operator with precedence.
 ///
 /// This is the enum which specifies operator precedence and fixity to the parser.
-#[derive(Debug, PartialEq, Eq)]
+#[derive(PartialEq, Debug)]
 pub enum AssocOp {
     /// `+`
     Add,
@@ -70,7 +68,7 @@ pub enum AssocOp {
     Colon,
 }
 
-#[derive(Debug, PartialEq, Eq)]
+#[derive(PartialEq, Debug)]
 pub enum Fixity {
     /// The operator is left-associative
     Left,
@@ -230,7 +228,7 @@ pub const PREC_POSTFIX: i8 = 60;
 pub const PREC_PAREN: i8 = 99;
 pub const PREC_FORCE_PAREN: i8 = 100;
 
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+#[derive(Debug, Clone, Copy)]
 pub enum ExprPrecedence {
     Closure,
     Break,
@@ -280,18 +278,6 @@ pub enum ExprPrecedence {
     Async,
 }
 
-impl PartialOrd for ExprPrecedence {
-    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
-        Some(self.order().cmp(&other.order()))
-    }
-}
-
-impl Ord for ExprPrecedence {
-    fn cmp(&self, other: &Self) -> Ordering {
-        self.order().cmp(&other.order())
-    }
-}
-
 impl ExprPrecedence {
     pub fn order(self) -> i8 {
         match self {
diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs
index 42cd7c8faa5..46b7f2d7bda 100644
--- a/src/libsyntax/util/parser_testing.rs
+++ b/src/libsyntax/util/parser_testing.rs
@@ -63,14 +63,6 @@ pub fn string_to_item (source_str : String) -> Option<P<ast::Item>> {
     })
 }
 
-/// Parse a string, return a stmt
-pub fn string_to_stmt(source_str : String) -> Option<ast::Stmt> {
-    let ps = ParseSess::new(FilePathMapping::empty());
-    with_error_checking_parse(source_str, &ps, |p| {
-        p.parse_stmt()
-    })
-}
-
 /// Parse a string, return a pat. Uses "irrefutable"... which doesn't
 /// (currently) affect parsing.
 pub fn string_to_pat(source_str: String) -> P<ast::Pat> {