summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-03-11librustc: Replace all uses of `fn()` with `&fn()`. rs=defunPatrick Walton-42/+42
2013-03-11Implement vector destructuring from tailSeo Sanghyeon-31/+56
2013-03-09Don't print addr_of(addr_of(e)) as `&&e`, which means something else.Jed Davis-0/+5
2013-03-09Remove @ast::Region and replace with @ast::Lifetime.Niko Matsakis-160/+117
Modify pretty-printer to emit lifetimes and fix a few minor parser bugs that this uncovered.
2013-03-08auto merge of #5278 : brson/rust/logplusplus, r=brsonbors-8/+32
r? `log` can polymorphically log anything, but debug!, etc. requires a format string. With this patch you can equivalently write `debug!(foo)` or `debug!("%?", foo)`. I'm doing this because I was trying to remove `log` (replacing it with nothing, at least temporarily), but there are a number of logging statements that just want to print an arbitrary value and don't care about the format string. I'm not entirely convinced this is a good change, since it overloads the implementation of these macros and makes their usage slightly more nuanced.
2013-03-08Fix dvec-related fallout in testsAlex Crichton-3/+3
2013-03-08syntax: Remove uses of DVecAlex Crichton-39/+29
2013-03-07test: Fix tests.Patrick Walton-2/+5
2013-03-07librustc: Stop parsing `assert`.Patrick Walton-13/+10
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-55/+55
2013-03-07librustc: Remove record patterns from the compilerPatrick Walton-40/+12
2013-03-07libsyntax: Remove struct literal expressions from the compilerPatrick Walton-64/+5
2013-03-07librustc: Remove structural record types from the compilerPatrick Walton-23/+2
2013-03-07libsyntax: Stop parsing structural record typesPatrick Walton-8/+7
2013-03-07Make debug!, etc. macros not require a format stringBrian Anderson-8/+32
The one thing `log` can still do is polymorphically log anything, but debug!, etc. require a format string. With this patch you can equivalently write `debug!(foo)` or `debug!("%?", foo)`
2013-03-07add deriving_eq for tokensJohn Clements-273/+2
2013-03-06auto merge of #5255 : jbclements/rust/remove-parse-value-ident, r=graydonbors-40/+21
After the removal of the "restricted keyword" feature in 0c82c00dc4f49aeb9b57c92c9a40ae35d8a1ee29 , there's no longer any difference between parse_ident() and parse_value_ident(), and therefore no difference between parse parse_path_without_tps() and parse_value_path(). I've collapsed all of these, removing the redundant functions and eliminating the need for two higher-order arguments.
2013-03-06patch up pretty printing of things with both lifetime and type parametersNiko Matsakis-0/+1
2013-03-06Improve error messages when illegal lifetimes are usedNiko Matsakis-0/+4
2013-03-06Permit either foo/&self or foo<'self>Niko Matsakis-9/+33
2013-03-06Add manual &self/ and &static/ and /&self declarations thatNiko Matsakis-23/+22
are currently inferred. New rules are coming that will require them to be explicit. All add some explicit self declarations.
2013-03-06Fix a bug with region-parameterized enums etc where trans consideredNiko Matsakis-3/+9
them to be non-monomorphic. Merely having lifetime parameters is not enough to qualify for that status. Fixes #5243.
2013-03-06finish removing parse_value_identJohn Clements-15/+7
2013-03-06removed unused abstraction over paths and value_pathsJohn Clements-25/+14
2013-03-05core: convert vec::{last,last_opt} to return referencesErick Tryzelaar-3/+3
2013-03-05auto merge of #5234 : pcwalton/rust/equiv, r=pcwaltonbors-2/+5
r? @nikomatsakis
2013-03-05libsyntax: Separate multiple inherited traits with `+`Patrick Walton-2/+5
2013-03-05auto merge of #5231 : jbclements/rust/better-macro-error-message, r=graydonbors-5/+13
Macro invocations with path separators (e.g. foo::bar!()) now produce a sensible error message, rather than an assertion failure. Also added compile-fail test case. Fixes #5218 ?
2013-03-05Update region inference for traits so that a method withNiko Matsakis-1/+9
explicit self doesn't incorrectly cause the entire trait to be tagged as being region-parameterized. Fixes #5224.
2013-03-05auto merge of #5212 : thestinger/rust/iter, r=graydonbors-14/+14
A small step towards fixing #2827
2013-03-05auto merge of #5179 : alexcrichton/rust/default-warn-unused-import, r=graydonbors-80/+5
I've found that unused imports can often start cluttering a project after a long time, and it's very useful to keep them under control. I don't like how Go forces a compiler error by default and it can't be changed, but I certainly want to know about them so I think that a warn is a good default. Now that the `unused_imports` lint option is a bit smarter, I think it's possible to change the default level to warn. This commit also removes all unused imports throughout the compiler and libraries (500+). The only odd things that I ran into were that some `use` statements had to have `#[cfg(notest)]` or `#[cfg(test)]` based on where they were. The ones with `notest` were mostly in core for modules like `cmp` whereas `cfg(test)` was for tests that weren't part of a normal `mod test` module.
2013-03-04simplified msg (TMI on old one)John Clements-2/+2
2013-03-04better error message for macros with MOD_SEPsJohn Clements-5/+13
2013-03-04libsyntax: Implement `#[deriving_clone]`Patrick Walton-16/+288
2013-03-04Adding missing imports for tests, and gate off othersAlex Crichton-14/+4
2013-03-04Remove unused imports throughout src/Alex Crichton-66/+1
2013-03-03libsyntax: deny deprecated_self in libsyntaxErick Tryzelaar-6/+10
2013-03-03libsyntax: add &self to extensionsErick Tryzelaar-24/+34
2013-03-03libsyntax: add &self to parser methodsErick Tryzelaar-261/+303
2013-03-03replace option::iter with a BaseIter implDaniel Micay-14/+14
2013-03-02auto merge of #5203 : erickt/rust/incoming, r=brsonbors-7/+8
My merges for #5143 missed a couple other copies. This patch corrects this, and gets stage0 to compile libsyntax with `#[deny(vecs_implicitly_copyable)]`. stage1 still fails though.
2013-03-02librustc: Stop parsing `fn@`, `fn~`, and `fn&`Patrick Walton-71/+6
2013-03-02libsyntax: Remove `fn@`, `fn~`, and `fn&` from libsyntax. rs=defunPatrick Walton-194/+181
2013-03-02librustc: Forbid chained imports and fix the logic for one-level renaming ↵Patrick Walton-5/+5
imports
2013-03-02libsyntax: add some more explicit copies for vecs_implicitly_copyable)Erick Tryzelaar-7/+8
2013-03-02Merge remote-tracking branch 'remotes/origin/incoming' into incomingErick Tryzelaar-29/+21
2013-03-02auto merge of #5137 : yjh0502/rust/empty_struct, r=nikomatsakisbors-11/+7
The fix is straight-forward, but there are several changes while fixing the issue. 1) disallow `mut` keyword when making a new struct In code base, there are following code, ```rust struct Foo { mut a: int }; let a = Foo { mut a: 1 }; ``` This is because of structural record, which is deprecated corrently (see issue #3089) In structural record, `mut` keyword should be allowd to control mutability. But without structural record, we don't need to allow `mut` keyword while constructing struct. 2) disallow structural records in parser level This is related to 1). With structural records, there is an ambiguity between empty block and empty struct To solve the problem, I change parser to stop parsing structural records. I think this is not a problem, because structural records are not compiled already. Misc. issues There is an ambiguity between empty struct vs. empty match stmt. with following code, ```rust match x{} {} ``` Two interpretation is possible, which is listed blow ```rust match (x{}) {} // matching with newly-constructed empty struct (match x{}) {} // matching with empty enum(or struct) x // and then empty block ``` It seems that there is no such code in rust code base, but there is one test which uses empty match statement: https://github.com/mozilla/rust/blob/incoming/src/test/run-pass/issue-3037.rs All other cases could be distinguished with look-ahead, but this can't be. One possible solution is wrapping with parentheses when matching with an uninhabited type. ```rust enum what { } fn match_with_empty(x: what) -> ~str { match (x) { //use parentheses to remove the ambiguity } } ```
2013-03-02auto merge of #5193 : sethpink/rust/struct-tup-pp, r=catamorphismbors-16/+12
- Removed space between struct name and parentheses - Fixed indentation of the rest of the file (missing end) - Don't print parentheses for structs with no fields - Added test
2013-03-01Merge remote-tracking branch 'remotes/origin/incoming' into incomingErick Tryzelaar-18/+29
2013-03-02Remove REC, change related tests/docsJihyun Yu-11/+7