Skip to content

Commit a2231dc

Browse files
committed
auto merge of #9200 : lkuper/rust/libsyntax-cleanup, r=luqmana
2 parents 0dbd509 + 6ba2cb8 commit a2231dc

File tree

2 files changed

+2
-55
lines changed

2 files changed

+2
-55
lines changed

src/libsyntax/ast_util.rs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -519,20 +519,11 @@ impl Visitor<()> for IdVisitor {
519519
visit::walk_stmt(self, statement, env)
520520
}
521521

522-
// XXX: Default
523-
fn visit_arm(&mut self, arm: &Arm, env: ()) {
524-
visit::walk_arm(self, arm, env)
525-
}
526-
527522
fn visit_pat(&mut self, pattern: @Pat, env: ()) {
528523
(self.visit_callback)(pattern.id);
529524
visit::walk_pat(self, pattern, env)
530525
}
531526

532-
// XXX: Default
533-
fn visit_decl(&mut self, declaration: @Decl, env: ()) {
534-
visit::walk_decl(self, declaration, env)
535-
}
536527

537528
fn visit_expr(&mut self, expression: @Expr, env: ()) {
538529
{
@@ -545,11 +536,6 @@ impl Visitor<()> for IdVisitor {
545536
visit::walk_expr(self, expression, env)
546537
}
547538

548-
// XXX: Default
549-
fn visit_expr_post(&mut self, _: @Expr, _: ()) {
550-
// Empty!
551-
}
552-
553539
fn visit_ty(&mut self, typ: &Ty, env: ()) {
554540
(self.visit_callback)(typ.id);
555541
match typ.node {
@@ -612,31 +598,6 @@ impl Visitor<()> for IdVisitor {
612598
}
613599
}
614600

615-
// XXX: Default
616-
fn visit_ty_method(&mut self, type_method: &TypeMethod, env: ()) {
617-
visit::walk_ty_method(self, type_method, env)
618-
}
619-
620-
// XXX: Default
621-
fn visit_trait_method(&mut self, trait_method: &trait_method, env: ()) {
622-
visit::walk_trait_method(self, trait_method, env)
623-
}
624-
625-
// XXX: Default
626-
fn visit_struct_def(&mut self,
627-
struct_definition: @struct_def,
628-
identifier: Ident,
629-
generics: &Generics,
630-
node_id: NodeId,
631-
env: ()) {
632-
visit::walk_struct_def(self,
633-
struct_definition,
634-
identifier,
635-
generics,
636-
node_id,
637-
env)
638-
}
639-
640601
fn visit_struct_field(&mut self, struct_field: @struct_field, env: ()) {
641602
(self.visit_callback)(struct_field.node.id);
642603
visit::walk_struct_field(self, struct_field, env)

src/libsyntax/codemap.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ pub trait Pos {
3030
}
3131

3232
/// A byte offset
33-
#[deriving(Clone, Eq, IterBytes)]
33+
#[deriving(Clone, Eq, IterBytes, Ord)]
3434
pub struct BytePos(uint);
3535
/// A character offset. Because of multibyte utf8 characters, a byte offset
3636
/// is not equivalent to a character offset. The CodeMap will convert BytePos
3737
/// values to CharPos values as necessary.
38-
#[deriving(Eq,IterBytes)]
38+
#[deriving(Eq,IterBytes, Ord)]
3939
pub struct CharPos(uint);
4040

4141
// XXX: Lots of boilerplate in these impls, but so far my attempts to fix
@@ -46,13 +46,6 @@ impl Pos for BytePos {
4646
fn to_uint(&self) -> uint { **self }
4747
}
4848

49-
impl cmp::Ord for BytePos {
50-
fn lt(&self, other: &BytePos) -> bool { **self < **other }
51-
fn le(&self, other: &BytePos) -> bool { **self <= **other }
52-
fn ge(&self, other: &BytePos) -> bool { **self >= **other }
53-
fn gt(&self, other: &BytePos) -> bool { **self > **other }
54-
}
55-
5649
impl Add<BytePos, BytePos> for BytePos {
5750
fn add(&self, rhs: &BytePos) -> BytePos {
5851
BytePos(**self + **rhs)
@@ -70,13 +63,6 @@ impl Pos for CharPos {
7063
fn to_uint(&self) -> uint { **self }
7164
}
7265

73-
impl cmp::Ord for CharPos {
74-
fn lt(&self, other: &CharPos) -> bool { **self < **other }
75-
fn le(&self, other: &CharPos) -> bool { **self <= **other }
76-
fn ge(&self, other: &CharPos) -> bool { **self >= **other }
77-
fn gt(&self, other: &CharPos) -> bool { **self > **other }
78-
}
79-
8066
impl Add<CharPos,CharPos> for CharPos {
8167
fn add(&self, rhs: &CharPos) -> CharPos {
8268
CharPos(**self + **rhs)

0 commit comments

Comments
 (0)