derive Eq and Clone impls where applicable

This commit is contained in:
Andrew Paseltiner
2013-03-26 08:04:54 -04:00
parent f7f6013a62
commit f02ee42a86
11 changed files with 21 additions and 303 deletions

View File

@@ -19,7 +19,6 @@ use codemap::BytePos;
use diagnostic::span_handler;
use parse::comments::{doc_comment_style, strip_doc_comment_decoration};
use core::cmp;
use core::either::Either;
use core::vec;
use core::hashmap::linear::LinearSet;
@@ -325,6 +324,7 @@ pub fn foreign_abi(attrs: &[ast::attribute])
};
}
#[deriving(Eq)]
pub enum inline_attr {
ia_none,
ia_hint,
@@ -332,13 +332,6 @@ pub enum inline_attr {
ia_never,
}
impl cmp::Eq for inline_attr {
fn eq(&self, other: &inline_attr) -> bool {
((*self) as uint) == ((*other) as uint)
}
fn ne(&self, other: &inline_attr) -> bool { !(*self).eq(other) }
}
/// True if something like #[inline] is found in the list of attrs.
pub fn find_inline_attr(attrs: &[ast::attribute]) -> inline_attr {
// FIXME (#2809)---validate the usage of #[inline] and #[inline(always)]