about summary refs log tree commit diff
path: root/src/libsyntax/attr.rs
AgeCommit message (Collapse)AuthorLines
2013-08-03remove obsolete `foreach` keywordDaniel Micay-2/+2
this has been replaced by `for`
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-2/+2
2013-07-20syntax: modernise attribute handling in syntax::attr.Huon Wilson-228/+218
This does a number of things, but especially dramatically reduce the number of allocations performed for operations involving attributes/ meta items: - Converts ast::meta_item & ast::attribute and other associated enums to CamelCase. - Converts several standalone functions in syntax::attr into methods, defined on two traits AttrMetaMethods & AttributeMethods. The former is common to both MetaItem and Attribute since the latter is a thin wrapper around the former. - Deletes functions that are unnecessary due to iterators. - Converts other standalone functions to use iterators and the generic AttrMetaMethods rather than allocating a lot of new vectors (e.g. the old code would have to allocate a new vector to use functions that operated on &[meta_item] on &[attribute].) - Moves the core algorithm of the #[cfg] matching to syntax::attr, similar to find_inline_attr and find_linkage_metas. This doesn't have much of an effect on the speed of #[cfg] stripping, despite hugely reducing the number of allocations performed; presumably most of the time is spent in the ast folder rather than doing attribute checks. Also fixes the Eq instance of MetaItem_ to correctly ignore spaces, so that `rustc --cfg 'foo(bar)'` now works.
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-3/+5
2013-07-17librustc: Add a lint mode for unnecessary `copy` and remove a bunch of them.Patrick Walton-1/+1
2013-07-12Remove the global 'vec::to_owned' functionAlex Crichton-2/+1
2013-07-07remove some method resolve workaroundsDaniel Micay-1/+1
2013-07-04Remove vec::{filter, filtered, filter_map, filter_mapped}, replaced by ↵Huon Wilson-10/+3
iterators.
2013-06-25Remove extraCorey Richardson-1/+1
2013-06-25great renaming propagation: syntaxCorey Richardson-5/+3
2013-06-23vec: remove BaseIter implementationDaniel Micay-4/+4
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-21vec: rm old_iter implementations, except BaseIterDaniel Micay-1/+1
The removed test for issue #2611 is well covered by the `std::iterator` module itself. This adds the `count` method to `IteratorUtil` to replace `EqIter`.
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-1/+1
2013-06-14add IteratorUtil to the preludeDaniel Micay-1/+0
2013-06-13Revert "std: convert {vec,str}::to_owned to methods."Brian Anderson-1/+1
This fixes the strange random crashes in compile-fail tests. This reverts commit 96cd61ad034cc9e88ab6a7845c3480dbc1ea62f3. Conflicts: src/librustc/driver/driver.rs src/libstd/str.rs src/libsyntax/ext/quote.rs
2013-06-13Use @str instead of @~str in libsyntax and librustc. Fixes #5048.Huon Wilson-21/+21
This almost removes the StringRef wrapper, since all strings are Equiv-alent now. Removes a lot of `/* bad */ copy *`'s, and converts several things to be &'static str (the lint table and the intrinsics table). There are many instances of .to_managed(), unfortunately.
2013-06-12std: convert {vec,str}::to_owned to methods.Huon Wilson-1/+1
2013-06-09std: remove fold[lr] in favour of iteratorsHuon Wilson-1/+2
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+1
2013-05-22librustc: Change `std` to `extra` throughout libsyntax and librustcPatrick Walton-2/+2
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-0/+2
to libextra
2013-05-20Remove all unnecessary allocations (as flagged by lint)Alex Crichton-3/+3
2013-05-10renamed vec::from_slice to vec::to_ownedYoungsoo Son-1/+1
2013-05-02Remove 'Local Variable' commentsBrendan Zabarauskas-10/+0
2013-04-27only use #[no_core] in libcoreDaniel Micay-3/+0
2013-04-19syntax: de-mode and prepare for de-modeing rustcAlex Crichton-4/+4
2013-04-03rename Linear{Map,Set} => Hash{Map,Set}Daniel Micay-2/+2
2013-04-03hashmap: rm linear namespaceDaniel Micay-1/+1
2013-03-31Fix warningsBrian Anderson-1/+0
2013-03-29Add AbiSet and integrate it into the AST.Niko Matsakis-21/+0
I believe this patch incorporates all expected syntax changes from extern function reform (#3678). You can now write things like: extern "<abi>" fn foo(s: S) -> T { ... } extern "<abi>" mod { ... } extern "<abi>" fn(S) -> T The ABI for foreign functions is taken from this syntax (rather than from an annotation). We support the full ABI specification I described on the mailing list. The correct ABI is chosen based on the target architecture. Calls by pointer to C functions are not yet supported, and the Rust type of crust fns is still *u8.
2013-03-27derive Eq and Clone impls where applicableAndrew Paseltiner-8/+1
2013-03-22librustc: Remove `pure` from libsyntax and librustc.Patrick Walton-4/+4
2013-03-13librustc: Don't accept `as Trait` anymore; fix all occurrences of it.Patrick Walton-1/+1
2013-03-13Remove `++` mode from the compiler (it is parsed as `+` mode)Niko Matsakis-3/+3
and obsolete `-` mode altogether (it *was* parsed as `+` mode).
2013-03-05core: convert vec::{last,last_opt} to return referencesErick Tryzelaar-1/+1
2013-03-04Remove unused imports throughout src/Alex Crichton-2/+0
2013-02-26libsyntax: add some explicit refsErick Tryzelaar-5/+4
2013-02-25libsyntax: progress on making syntax::visit vecs_implicitly_copyable-freeErick Tryzelaar-18/+20
2013-02-25libsyntax: convert visit to pass ty_params by referenceErick Tryzelaar-2/+2
2013-02-25libsyntax: add explicit modes where required to copy strs/vecsErick Tryzelaar-3/+3
2013-02-25libsyntax: Convert ast::attribute_ to store a @meta_itemErick Tryzelaar-7/+8
2013-02-19convert ast::meta_items to take @~strsErick Tryzelaar-9/+9
2013-02-19convert syntax::attr to use @~strsErick Tryzelaar-73/+69
2013-02-19libsyntax and librustc: minor cleanupErick Tryzelaar-2/+2
2013-02-19libsyntax: change attr:get_attr_name to take a refErick Tryzelaar-7/+6
2013-02-17syntax: Implement recursive sorting of meta items. Closes #607Zack Corr-10/+20
2013-02-15libsyntax: Get rid of uses of `move` and don't parse it.Luqman Aden-1/+1
2013-02-14librustc: Replace `impl Type : Trait` with `impl Trait for Type`. ↵Patrick Walton-1/+1
rs=implflipping
2013-02-13Remove die!, raplace invocations with fail! Issue #4524 pt 3Nick Desaulniers-1/+1
2013-02-08libsyntax/attr.rs: switch from oldmap to LinearSetDaniel Micay-5/+3