Use more deriving(IterBytes) in libsyntax.

This commit is contained in:
Ben Blum
2013-06-21 20:01:17 -04:00
parent 5784c0912f
commit 75b80bad63
5 changed files with 93 additions and 242 deletions

View File

@@ -19,7 +19,6 @@ use visit;
use std::hashmap::HashMap;
use std::int;
use std::option;
use std::to_bytes;
use std::cast;
use std::local_data;
@@ -194,14 +193,6 @@ pub fn is_call_expr(e: @expr) -> bool {
match e.node { expr_call(*) => true, _ => false }
}
// This makes def_id hashable
impl to_bytes::IterBytes for def_id {
#[inline]
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
self.crate.iter_bytes(lsb0, f) && self.node.iter_bytes(lsb0, f)
}
}
pub fn block_from_expr(e: @expr) -> blk {
let blk_ = default_block(~[], option::Some::<@expr>(e), e.id);
return spanned {node: blk_, span: e.span};