about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/cmp/ord.rs
AgeCommit message (Collapse)AuthorLines
2015-12-15Move built-in syntax extensions to a separate crateSeo Sanghyeon-135/+0
2015-08-29Allow #[derive()] to generate unsafe trait implsMichael Layzell-0/+1
2015-08-03syntax: Implement #![no_core]Alex Crichton-10/+2
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-05-22Let MultiItemDecorator take `&Annotatable` (fixes #25683)Manish Goregaokar-2/+2
2015-05-17Allow #[derive()] to generate unsafe methodsManish Goregaokar-0/+1
2015-05-12RebasingNick Cameron-1/+1
2015-04-30WIP refactor expansion of decorators and move derive to MultiDecoratorNick Cameron-4/+4
2015-04-21syntax: Remove uses of #[feature(slice_patterns)]Erick Tryzelaar-2/+2
2015-04-15syntax: Change deriving methods to take a `&mut FnMut(P<Item>)`Erick Tryzelaar-6/+5
This allows #[derive(...)]` to create more than one impl
2015-04-15syntax: Rename deriving/cmp/* to match their current namesErick Tryzelaar-140/+44
2015-04-01Fallout in libsyntaxNiko Matsakis-1/+1
2015-03-03Switched to Box::new in many places.Felix S. Klock II-8/+8
Many of the modifications putting in `Box::new` calls also include a pointer to Issue 22405, which tracks going back to `box <expr>` if possible in the future. (Still tried to use `Box<_>` where it sufficed; thus some tests still have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.) Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-02-24rustc_resolve: use the visitor model more, remove redundant repeated lookups.Eduard Burtescu-1/+1
2015-02-07Don't use std:: paths in syntax extensions when compiling a #![no_std] crateKeegan McAllister-5/+5
Fixes #16803. Fixes #14342. Fixes half of #21827 -- slice syntax is still broken.
2015-02-07Use path helper macros in derivingKeegan McAllister-4/+4
2015-01-25Associated types support for deriving::generic::TraitDefDzmitry Malyshau-1/+2
2015-01-17s/deriving/derives in Comments/DocsEarl St Sauver-4/+4
There are a large number of places that incorrectly refer to deriving in comments, instead of derives. Fixes #20984
2015-01-05rollup merge of #20482: kmcallister/macro-reformAlex Crichton-2/+2
Conflicts: src/libflate/lib.rs src/libstd/lib.rs src/libstd/macros.rs src/libsyntax/feature_gate.rs src/libsyntax/parse/parser.rs src/libsyntax/show_span.rs src/test/auxiliary/macro_crate_test.rs src/test/compile-fail/lint-stability.rs src/test/run-pass/intrinsics-math.rs src/test/run-pass/tcp-connect-timeouts.rs
2015-01-05Modernize macro_rules! invocationsKeegan McAllister-2/+2
macro_rules! is like an item that defines a macro. Other items don't have a trailing semicolon, or use a paren-delimited body. If there's an argument for matching the invocation syntax, e.g. parentheses for an expr macro, then I think that applies more strongly to the *inner* delimiters on the LHS, wrapping the individual argument patterns.
2015-01-05syntax: remove remaining boxed closuresJorge Aparicio-4/+4
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-1/+1
2014-12-19libsyntax: use `#[deriving(Copy)]`Jorge Aparicio-2/+1
2014-12-13libsyntax: use unboxed closuresJorge Aparicio-5/+7
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+2
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-12-05Utilize fewer reexportsCorey Farwell-3/+4
In regards to: https://github.com/rust-lang/rust/issues/19253#issuecomment-64836729 This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::* and Result::*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+2
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-07Update Partial/Total Eq/Ord terminologyJorge Aparicio-4/+4
2014-11-07syntax: Use UFCS in the expansion of `#[deriving(PartialOrd)]`Jorge Aparicio-4/+25
2014-09-14syntax: fix fallout from using ptr::P.Eduard Burtescu-12/+11
2014-07-11Removed dead structures after changes to PartialOrd/Ord derivings.Felix S. Klock II-41/+6
Remove the `NonMatchesExplode` variant now that no deriving impl uses it. Removed `EnumNonMatching` entirely. Remove now irrelevant `on_matching` field and `HandleNonMatchingEnums` type. Removed unused `EnumNonMatchFunc` type def. Drive-by: revise `EnumNonMatchCollapsedFunc` doc. Made all calls to `expand_enum_method_body` go directly to `build_enum_match_tuple`. Alpha-rename `enum_nonmatch_g` back to `enum_nonmatch_f` to reduce overall diff noise. Inline sole call of `some_ordering_const`. Inline sole call of `ordering_const`. Removed a bunch of code that became dead after the above changes.
2014-07-11`O(n*k)` code-size deriving on enums (better than previous `O(n^k)`).Felix S. Klock II-3/+39
In the above formulas, `n` is the number of variants, and `k` is the number of self-args fed into deriving. In the particular case of interest (namely `PartialOrd` and `Ord`), `k` is always 2, so we are basically comparing `O(n)` versus `O(n^2)`. Also, the stage is set for having *all* enum deriving codes go through `build_enum_match_tuple` and getting rid of `build_enum_match`. Also, seriously attempted to clean up the code itself. Added a bunch of comments attempting to document what I learned as I worked through the original code and adapted it to this new strategy.
2014-07-11Revise the `const_nonmatching` flag with more info about author's intent.Felix S. Klock II-2/+2
In particular, I want authors of deriving modes to understand what they are opting into (namely quadratic code size or worse) when they select NonMatchesExplode.
2014-06-29Implement RFC#28: Add PartialOrd::partial_cmpSteven Fackler-5/+99
I ended up altering the semantics of Json's PartialOrd implementation. It used to be the case that Null < Null, but I can't think of any reason for an ordering other than the default one so I just switched it over to using the derived implementation. This also fixes broken `PartialOrd` implementations for `Vec` and `TreeMap`. RFC: 0028-partial-cmp
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-4/+7
2014-06-10Fix more misspelled comments and strings.Joseph Crail-1/+1
2014-06-02syntax: Remove use of `pub use` globsklutzy-0/+1
`quote_expr!` now injects two more (priv) `use` globs. This may cause extra unused_imports warning.
2014-05-28rustc: Accept PartialOrd/PartialOrdEq for Eq/OrdAlex Crichton-1/+1
This is a transitionary step towards completing #12517. This change modifies the compiler to accept Partial{Ord,Eq} as deriving modes which will currently expand to implementations of PartialOrd and PartialEq (synonyms for Eq/Ord). After a snapshot, all of deriving(Eq, Ord) will be removed, and after a snapshot of that, TotalEq/TotalOrd will be renamed to Eq/Ord.
2014-04-23auto merge of #13704 : edwardw/rust/doc-hidden, r=alexcrichtonbors-3/+6
Closes #13698
2014-04-23Fix other bugs with new closure borrowingAlex Crichton-1/+3
This fixes various issues throughout the standard distribution and tests.
2014-04-23Honor hidden doc attribute of derivable trait methodsEdward Wang-3/+6
Closes #13698
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-2/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-1/+1
Closes #12771
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-0/+2
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-7/+7
2014-02-21syntax: Allow syntax extensions to have attributesErick Tryzelaar-0/+1
2014-02-13Tweak ItemDecorator APISteven Fackler-2/+3
The old method of building up a list of items and threading it through all of the decorators was unwieldy and not really scalable as non-deriving ItemDecorators become possible. The API is now that the decorator gets an immutable reference to the item it's attached to, and a callback that it can pass new items to. If we want to add syntax extensions that can modify the item they're attached to, we can add that later, but I think it'll have to be separate from ItemDecorator to avoid strange ordering issues.
2014-02-08Update deriving to pass around the `cx` linearlyNiko Matsakis-3/+2
2014-02-08Fixed error starting with uppercasemr.Shu-2/+2
Error messages cleaned in librustc/middle Error messages cleaned in libsyntax Error messages cleaned in libsyntax more agressively Error messages cleaned in librustc more aggressively Fixed affected tests Fixed other failing tests Last failing tests fixed
2014-02-08syntax: convert deriving to take &mut ExtCtxt.Huon Wilson-2/+2
2014-01-28syntax: make deriving have slightly less cryptic error messages.Huon Wilson-6/+2
This unfortunately changes an error like error: mismatched types: expected `&&NotClone` but found `&NotClone` into error: type `NotClone` does not implement any method in scope named `clone`