about summary refs log tree commit diff
path: root/src/libsyntax/attr.rs
AgeCommit message (Collapse)AuthorLines
2014-02-02libsyntax: De-`@str` literal strings in the ASTPatrick Walton-19/+26
2014-02-02libsyntax: Introduce an `InternedString` type to reduce `@str` in thePatrick Walton-36/+47
compiler and use it for attributes
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-20/+20
2014-01-03librustc: De-`@mut` the span handlerPatrick Walton-3/+2
2014-01-01syntax::diagnostic: Remove unnecessary traitsklutzy-3/+3
This removes trait `handler` and `span_handler`, and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
2013-12-29Rename PkgId to CrateIdLuis de Bethencourt-1/+1
2013-12-29Rename pkgid variablesLuis de Bethencourt-2/+2
2013-12-22std::vec: make the sorting closure use `Ordering` rather than just beingHuon Wilson-5/+1
(implicitly) less_eq.
2013-12-21std::vec: add a sugary .sort() method for plain Ord sorting.Huon Wilson-0/+4
This moves the custom sorting to `.sort_by`.
2013-12-20extra: remove sort in favour of the std method.Huon Wilson-3/+1
Fixes #9676.
2013-12-19Rename pkgid to crate_idCorey Richardson-1/+1
Closes #11035
2013-12-10Make crate hash stable and externally computable.Jack Moffitt-0/+8
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.
2013-11-28Register new snapshotsAlex Crichton-2/+2
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-15/+13
2013-10-29Assorted cleanups suggested by reviewers.Jed Davis-2/+1
2013-10-29Lint non-FFI-safe enums.Jed Davis-0/+19
2013-10-29Add parser for `#[repr(...)]`; nothing uses it yet.Jed Davis-1/+95
Also export enum attrs into metadata, and add a convenient interface for obtaining the repr hint from either a local or remote definition.
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-11/+11
Who doesn't like a massive renaming?
2013-10-09option: rewrite the API to use compositionDaniel Micay-1/+1
2013-10-08add new enum ast::StrStyle as field to ast::lit_strBenjamin Herr-3/+3
For the benefit of the pretty printer we want to keep track of how string literals in the ast were originally represented in the source code. This commit changes parser functions so they don't extract strings from the token stream without at least also returning what style of string literal it was. This is stored in the resulting ast node for string literals, obviously, for the package id in `extern mod = r"package id"` view items, for the inline asm in `asm!()` invocations. For `asm!()`'s other arguments or for `extern "Rust" fn()` items, I just the style of string, because it seemed disproportionally cumbersome to thread that information through the string processing that happens with those string literals, given the limited advantage raw string literals would provide in these positions. The other syntax extensions don't seem to store passed string literals in the ast, so they also discard the style of strings they parse.
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-1/+1
Closes #9467
2013-09-30syntax: Remove usage of fmt!Alex Crichton-12/+12
2013-09-26rustdoc: Render stability attributesAlex Crichton-1/+1
Closes #8965
2013-09-12std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-2/+2
2013-09-04Implement support for indicating the stability of items.Huon Wilson-0/+38
There are 6 new compiler recognised attributes: deprecated, experimental, unstable, stable, frozen, locked (these levels are taken directly from Node's "stability index"[1]). These indicate the stability of the item to which they are attached; e.g. `#[deprecated] fn foo() { .. }` says that `foo` is deprecated. This comes with 3 lints for the first 3 levels (with matching names) that will detect the use of items marked with them (the `unstable` lint includes items with no stability attribute). The attributes can be given a short text note that will be displayed by the lint. An example: #[warn(unstable)]; // `allow` by default #[deprecated="use `bar`"] fn foo() { } #[stable] fn bar() { } fn baz() { } fn main() { foo(); // "warning: use of deprecated item: use `bar`" bar(); // all fine baz(); // "warning: use of unmarked item" } The lints currently only check the "edges" of the AST: i.e. functions, methods[2], structs and enum variants. Any stability attributes on modules, enums, traits and impls are not checked. [1]: http://nodejs.org/api/documentation.html [2]: the method check is currently incorrect and doesn't work.
2013-09-02libsyntax: Remove obsolete fixme.Luqman Aden-1/+0
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-2/+2
2013-08-12Forbid pub/priv where it has no effectAlex Crichton-3/+3
Closes #5495
2013-08-11libsyntax: Update from `@Object` to `@mut Object` as requiredNiko Matsakis-1/+1
2013-08-10std: Transform.find_ -> .findErick Tryzelaar-2/+2
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-2/+2
cc #5898
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-1/+1
cc #7887
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-1/+1
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-1/+1
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
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.