about summary refs log tree commit diff
path: root/src/libsyntax/ast_util.rs
AgeCommit message (Collapse)AuthorLines
2014-09-12Remove largely unused context from Visitor.Eduard Burtescu-40/+36
2014-08-29Register new snapshotsAlex Crichton-8/+0
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-0/+8
2014-08-18Forbid extern statics from appearing in patternsJakub Wieczorek-15/+0
Fixes #16149.
2014-08-14librustc: Implement simple `where` clauses.Patrick Walton-2/+8
These `where` clauses are accepted everywhere generics are currently accepted and desugar during type collection to the type parameter bounds we have today. A new keyword, `where`, has been added. Therefore, this is a breaking change. Change uses of `where` to other identifiers. [breaking-change]
2014-08-14librustc: Stop assuming that implementations and traits only containPatrick Walton-37/+38
methods. This paves the way to associated items by introducing an extra level of abstraction ("impl-or-trait item") between traits/implementations and methods. This new abstraction is encoded in the metadata and used throughout the compiler where appropriate. There are no functional changes; this is purely a refactoring.
2014-08-07Temporary bootstrapping hack: introduce syntax for r egion bounds like `'b:'a`,Niko Matsakis-1/+1
meaning `'b outlives 'a`. Syntax currently does nothing but is needed for full fix to #5763. To use this syntax, the issue_5763_bootstrap feature guard is required.
2014-08-06AST refactoring: merge PatWild and PatWildMulti into one variant with a flag.Felix S. Klock II-1/+1
2014-07-20Implement new mod import sugarJakub Wieczorek-1/+1
Implements RFC #168.
2014-07-19Register new snapshotsAlex Crichton-64/+9
2014-07-18librustc: Implement unboxed closures with mutable receiversPatrick Walton-8/+21
2014-07-15use trait rather than fnsJohn Clements-21/+81
please note the snapshot-waiting unpleasantness. I'm unable to use the traditional #[cfg(stage0)] mechanism to swap the new style in for later compiler stages, because macros invocations in method positions cause the parser to choke before cfg can strip it out. Parenthetical note: this problem wouldn't arise with an interleaved parsing/expansion....
2014-07-13refactor Method definition to make space for macrosJohn Clements-20/+55
This change propagates to many locations, but because of the Macro Exterminator (or, more properly, the invariant that it protects), macro invocations can't occur downstream of expansion. This means that in librustc and librustdoc, extracting the desired field can simply assume that it can't be a macro invocation. Functions in ast_util abstract over this check.
2014-07-09libsyntax: Remove uses of advance.Luqman Aden-5/+5
2014-07-09Fix all the test falloutCorey Richardson-4/+4
2014-07-09syntax: doc comments all the thingsCorey Richardson-7/+7
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-7/+7
[breaking-change]
2014-07-03Simplify PatIdent to contain an Ident rather than a PathJohn Clements-7/+3
Rationale: for what appear to be historical reasons only, the PatIdent contains a Path rather than an Ident. This means that there are many places in the code where an ident is artificially promoted to a path, and---much more problematically--- a bunch of elements from a path are simply thrown away, which seems like an invitation to some really nasty bugs. This commit replaces the Path in a PatIdent with a SpannedIdent, which just contains an ident and a span.
2014-06-26Remove unnecessary to_string callsPiotr Jawniak-3/+3
This commit removes superfluous to_string calls from various places
2014-06-25auto merge of #15160 : alexcrichton/rust/remove-f128, r=brsonbors-1/+0
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-15/+4
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-24Remove the quad_precision_float feature gateAlex Crichton-1/+0
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
2014-06-17librustc: Make addresses of immutable statics insignificant unlessPatrick Walton-0/+13
`#[inline(never)]` is used. Closes #8958. This can break some code that relied on the addresses of statics being distinct; add `#[inline(never)]` to the affected statics. [breaking-change]
2014-06-14rustc: Obsolete the `@` syntax entirelyAlex Crichton-1/+1
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
2014-06-13libsyntax: Allow `+` to separate trait bounds from objects.Patrick Walton-0/+1
RFC #27. After a snapshot, the old syntax will be removed. This can break some code that looked like `foo as &Trait:Send`. Now you will need to write `foo as (&Trait+Send)`. Closes #12778. [breaking-change]
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-21/+21
2014-06-06Move Def out of syntax crate, where it does not belongNiko Matsakis-27/+0
2014-05-29auto merge of #14483 : ahmedcharles/rust/patbox, r=alexcrichtonbors-1/+1
2014-05-28Add AST node for pattern macrosKeegan McAllister-0/+1
2014-05-27Rename PatUniq to PatBox. Fixes part of #13910.Ahmed Charles-1/+1
2014-05-27std: Rename strbuf operations to stringRicho Healey-9/+9
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-6/+6
[breaking-change]
2014-05-23syntax: Clean out obsolete syntax parsingAlex Crichton-0/+1
All of these features have been obsolete since February 2014, where most have been obsolete since 2013. There shouldn't be any more need to keep around the parser hacks after this length of time.
2014-05-14Removed unnecessary arguments for walk_* functionsMichael Darakananda-4/+3
2014-05-13syntax: Print suffixed token literals correctlyAlex Crichton-0/+3
Previously, literals "1i" were printed as "1". This fixes the numeric-method-autoexport test for pretty printing.
2014-05-13syntax: Fix printing INT64_MINAlex Crichton-5/+16
Integers are always parsed as a u64 in libsyntax, but they're stored as i64. The parser and pretty printer both printed an i64 instead of u64, sometimes introducing an extra negative sign.
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-13/+17
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-1/+1
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-01auto merge of #13724 : nikomatsakis/rust/expr-use-visitor, r=pnkfelixbors-1/+24
Pre-step towards issue #12624 and others: Introduce ExprUseVisitor, remove the moves computation. ExprUseVisitor is a visitor that walks the AST for a function and calls a delegate to inform it where borrows, copies, and moves occur. In this patch, I rewrite the gather_loans visitor to use ExprUseVisitor, but in future patches, I think we could rewrite regionck, check_loans, and possibly other passes to use it as well. This would refactor the repeated code between those places that tries to determine where copies/moves/etc occur. r? @alexcrichton
2014-04-26syntax: ViewItemUse no longer contains multiple view paths.Kang Seonghoon-12/+10
it reflected the obsolete syntax `use a, b, c;` and did not make past the parser (though it was a non-fatal error so we can continue). this legacy affected many portions of rustc and rustdoc as well, so this commit cleans them up altogether.
2014-04-24auto merge of #13671 : dcrewi/rust/lint-directives-on-use-items, r=alexcrichtonbors-2/+10
Fixes #10534
2014-04-24Pre-step towards issue #12624 and others: Introduce ExprUseVisitor, remove theNiko Matsakis-1/+24
moves computation. ExprUseVisitor is a visitor that walks the AST for a function and calls a delegate to inform it where borrows, copies, and moves occur. In this patch, I rewrite the gather_loans visitor to use ExprUseVisitor, but in future patches, I think we could rewrite regionck, check_loans, and possibly other passes to use it as well. This would refactor the repeated code between those places that tries to determine where copies/moves/etc occur.
2014-04-22Apply lint attrs to individual "use" declarationsDavid Creswick-2/+10
Fixes #10534
2014-04-22add support for quadruple precision floating pointDaniel Micay-1/+1
This currently requires linking against a library like libquadmath (or libgcc), because compiler-rt barely has any support for this and most hardware does not yet have 128-bit precision floating point. For this reason, it's currently hidden behind a feature gate. When compiler-rt is updated to trunk, some tests can be added for constant evaluation since there will be support for the comparison operators. Closes #13381
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-1/+1
2014-04-13libsyntax: update helper to stringify TyU* and TyI* to take into account ↵Kevin Butler-14/+30
having a value. Fixes #13359.
2014-04-10auto merge of #13440 : huonw/rust/strbuf, r=alexcrichtonbors-2/+3
libstd: Implement `StrBuf`, a new string buffer type like `Vec`, and port all code over to use it. Rebased & tests-fixed version of https://github.com/mozilla/rust/pull/13269
2014-04-10Renamed ast::Purity to ast::FnStyle and ast::ImpureFn to ast::NormalFn and ↵Kasey Carrothers-1/+1
updated associated variable and function names.
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-2/+3
port all code over to use it.
2014-04-08Register new snapshotsAlex Crichton-1/+1