about summary refs log tree commit diff
path: root/src/libsyntax/print/pprust.rs
AgeCommit message (Collapse)AuthorLines
2013-03-12Parse inline assembly.Luqman Aden-0/+8
2013-03-11auto merge of #5304 : jld/rust/const-adjustments, r=graydonbors-0/+5
These changes make const translation use adjustments (autodereference, autoreference, bare-fn-to-closure), like normal code does, replacing some ad-hoc logic that wasn't always right. As a convenient side-effect, explicit dereference (both of pointers and of newtypes) is also supported in const expressions. There is also a “bonus fix” for a bug in the pretty-printer exposed by one of the added tests.
2013-03-11librustc: Lint the old `drop` destructor notation offPatrick Walton-27/+2
2013-03-11librustc: Replace all uses of `fn()` with `&fn()`. rs=defunPatrick Walton-2/+2
2013-03-11Implement vector destructuring from tailSeo Sanghyeon-5/+11
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-33/+26
Modify pretty-printer to emit lifetimes and fix a few minor parser bugs that this uncovered.
2013-03-08syntax: Remove uses of DVecAlex Crichton-4/+3
2013-03-07librustc: Stop parsing `assert`.Patrick Walton-4/+0
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-4/+4
2013-03-07librustc: Remove record patterns from the compilerPatrick Walton-19/+0
2013-03-07libsyntax: Remove struct literal expressions from the compilerPatrick Walton-16/+0
2013-03-07librustc: Remove structural record types from the compilerPatrick Walton-14/+0
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-06Add manual &self/ and &static/ and /&self declarations thatNiko Matsakis-2/+2
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-1/+1
them to be non-monomorphic. Merely having lifetime parameters is not enough to qualify for that status. Fixes #5243.
2013-03-05libsyntax: Separate multiple inherited traits with `+`Patrick Walton-1/+4
2013-03-05Update region inference for traits so that a method withNiko Matsakis-1/+0
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-6/+6
A small step towards fixing #2827
2013-03-04Remove unused imports throughout src/Alex Crichton-4/+0
2013-03-03replace option::iter with a BaseIter implDaniel Micay-6/+6
2013-03-02librustc: Stop parsing `fn@`, `fn~`, and `fn&`Patrick Walton-11/+0
2013-03-02libsyntax: Remove `fn@`, `fn~`, and `fn&` from libsyntax. rs=defunPatrick Walton-3/+3
2013-03-02Merge remote-tracking branch 'remotes/origin/incoming' into incomingErick Tryzelaar-17/+13
2013-03-02auto merge of #5137 : yjh0502/rust/empty_struct, r=nikomatsakisbors-1/+1
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-02Remove REC, change related tests/docsJihyun Yu-1/+1
2013-03-02Fix some struct-tuple def prettyprint issuesSeth Pink-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-2/+5
2013-02-28Fix implicit leaks of imports throughout librariesAlex Crichton-2/+5
Also touch up use of 'pub' and move some tests around so the tested functions don't have to be 'pub'
2013-02-28Merge remote-tracking branch 'remotes/origin/incoming' into incomingErick Tryzelaar-52/+76
2013-02-27Introduce lifetime declarations into the lists of type parameters.Niko Matsakis-39/+63
Major changes are: - replace ~[ty_param] with Generics structure, which includes both OptVec<TyParam> and OptVec<Lifetime>; - the use of syntax::opt_vec to avoid allocation for empty lists; cc #4846
2013-02-26libsyntax: remove vecs_implicitly_copyable from the printerErick Tryzelaar-22/+23
2013-02-26libsyntax: change token::to_str to take &TokenErick Tryzelaar-2/+2
2013-02-25libsyntax: progress on making syntax::visit vecs_implicitly_copyable-freeErick Tryzelaar-34/+34
2013-02-25libsyntax: Convert ast::attribute_ to store a @meta_itemErick Tryzelaar-1/+1
2013-02-21Get rid of structural records in libsyntax and the last bit in librustc.Luqman Aden-4/+5
2013-02-20librustc: Separate most trait bounds with '+'. rs=plussingPatrick Walton-1/+1
2013-02-19auto merge of #4999 : erickt/rust/incoming, r=brsonbors-22/+40
This patch series is doing a couple things with the ultimate goal of removing `#[allow(vecs_implicitly_copyable)]`, although I'm not quite there yet. The main change is passing around `@~str`s in most places, and using `ref`s in others. As far as I could tell, there are no performance changes with these patches, and all the tests pass on my mac.
2013-02-19convert ast::meta_items to take @~strsErick Tryzelaar-3/+3
2013-02-19convert syntax::attr to use @~strsErick Tryzelaar-4/+4
2013-02-19libsyntax: make enum variants take refsErick Tryzelaar-17/+35
2013-02-19auto merge of #5002 : catamorphism/rust/one-tuples, r=graydonbors-0/+9
r? @graydon - This is for greater uniformity (for example, macros that generate tuples). rustc already supported 1-tuple patterns, but there was no way to construct a 1-tuple term. @graydon , as far as your comment on #4898 - it did turn out to be solvable inside the macro (since @luqmana already fixed it using structs instead), but I still think it's a good idea to allow 1-tuples, for uniformity. I don't think anyone is likely to trip over it, and I'm not too worried that it changes the amount of ambiguity.
2013-02-18rustc: For one-tuples, make parsing and printing the type workTim Chevalier-0/+3
and add a test to reflect-visit-data
2013-02-17libsyntax: Update view_item_use/import to reflect actual usageLuqman Aden-2/+2
2013-02-17syntax: Allow 1-tuple expressionsTim Chevalier-0/+6
This is for greater uniformity (for example, macros that generate tuples). rustc already supported 1-tuple patterns, but there was no way to construct a 1-tuple term.
2013-02-13Remove die!, raplace invocations with fail! Issue #4524 pt 3Nick Desaulniers-8/+8
2013-02-13libsyntax: Pretty print using the new impl syntax. r=brsonPatrick Walton-2/+4
2013-02-07librustc: Lots of de-muting. rs=demutingPatrick Walton-155/+170
2013-02-07Make ~fn non-copyable, make &fn copyable, split barefn/closure types,Niko Matsakis-54/+56
correct handling of moves for struct-record update. Part of #3678. Fixes #2828, #3904, #4719.