Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically derived #12929

Merged
merged 2 commits into from
Mar 16, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc/middle/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ static other_attrs: &'static [&'static str] = &[
"crate_map", "cfg", "doc", "export_name", "link_section",
"no_mangle", "static_assert", "unsafe_no_drop_flag", "packed",
"simd", "repr", "deriving", "unsafe_destructor", "link", "phase",
"macro_export", "must_use",
"macro_export", "must_use", "automatically_derived",

//mod-level
"path", "link_name", "link_args", "macro_escape", "no_implicit_prelude",
Expand Down
20 changes: 0 additions & 20 deletions src/libstd/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,6 @@ totalord_impl!(uint)

totalord_impl!(char)

/// Compares (a1, b1) against (a2, b2), where the a values are more significant.
pub fn cmp2<A:TotalOrd,B:TotalOrd>(
a1: &A, b1: &B,
a2: &A, b2: &B) -> Ordering
{
match a1.cmp(a2) {
Less => Less,
Greater => Greater,
Equal => b1.cmp(b2)
}
}

/**
Return `o1` if it is not `Equal`, otherwise `o2`. Simulates the
lexical ordering on a type `(int, int)`.
Expand Down Expand Up @@ -206,14 +194,6 @@ mod test {
assert_eq!(12.cmp(-5), Greater);
}

#[test]
fn test_cmp2() {
assert_eq!(cmp2(1, 2, 3, 4), Less);
assert_eq!(cmp2(3, 2, 3, 4), Less);
assert_eq!(cmp2(5, 2, 3, 4), Greater);
assert_eq!(cmp2(5, 5, 5, 4), Greater);
}

#[test]
fn test_int_totaleq() {
assert!(5.equals(&5));
Expand Down
12 changes: 4 additions & 8 deletions src/libsyntax/ext/deriving/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ use codemap;
use codemap::Span;
use opt_vec;
use parse::token::InternedString;
use parse::token;

use std::vec_ng::Vec;
use std::vec_ng;
Expand Down Expand Up @@ -399,19 +398,16 @@ impl<'a> TraitDef<'a> {
cx.path_all(self.span, false, vec!( type_ident ), self_lifetimes,
opt_vec::take_vec(self_ty_params)), None);

let doc_attr = cx.attribute(
let attr = cx.attribute(
self.span,
cx.meta_name_value(self.span,
InternedString::new("doc"),
ast::LitStr(token::intern_and_get_ident(
"Automatically derived."),
ast::CookedStr)));
cx.meta_word(self.span,
InternedString::new("automatically_derived")));
let opt_trait_ref = Some(trait_ref);
let ident = ast_util::impl_pretty_name(&opt_trait_ref, self_type);
cx.item(
self.span,
ident,
vec_ng::append(vec!(doc_attr), self.attributes.as_slice()),
vec_ng::append(vec!(attr), self.attributes.as_slice()),
ast::ItemImpl(trait_generics, opt_trait_ref,
self_type, methods.map(|x| *x)))
}
Expand Down