about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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-02Remove REC, change related tests/docsJihyun Yu-11/+7
2013-03-01auto merge of #5165 : brson/rust/unstable, r=brsonbors-2/+2
r? This probably isn't controversial, but I want somebody else to sign off on it.
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-01Avoid calling to_vec() unnecessarily in parser.Niko Matsakis-17/+27
Also, rename the OptVec-to-vector conversion method to opt_vec::take_vec() and convert from a method into a fn because I fear strange bugs.
2013-03-01Rename core::private to core::unstable. #4743Brian Anderson-2/+2
2013-03-01librustc: "APL2" -> "ASL2". rs=license-fixPatrick Walton-1/+1
2013-03-01Merge remote branch 'sevrak/issue-5164' into incomingPatrick Walton-1/+2
2013-02-28Remove legacy object creation mode, and convert remaining uses of itNiko Matsakis-114/+117
2013-02-28Fix implicit leaks of imports throughout librariesAlex Crichton-15/+56
Also touch up use of 'pub' and move some tests around so the tested functions don't have to be 'pub'
2013-02-28librustc: Mark all type implementations public. rs=impl-publicityPatrick Walton-2/+2
2013-02-28Fix license attribute on cratessevrak-1/+2
2013-02-27auto merge of #5155 : bstrie/rust/dedrop, r=pcwaltonbors-1/+5
This removes all but 6 uses of `drop {}` from the entire codebase. Removing any of the remaining uses causes various non-trivial bugs; I'll start reporting them once this gets merged.
2013-02-27auto merge of #5141 : nikomatsakis/rust/region-syntax-expl-lifetimes, ↵bors-488/+802
r=nikomatsakis 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 r? @graydon
2013-02-27Introduce lifetime declarations into the lists of type parameters.Niko Matsakis-488/+802
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-27Turn old `drop` blocks into `Drop` traitsBen Striegel-1/+5
2013-02-27librustc: Forbid `pub` or `priv` before trait implementationsPatrick Walton-59/+73
2013-02-27libsyntax: Forbid mutable vectors. rs=demutingPatrick Walton-0/+15
2013-02-27libsyntax: Forbid `~mut` and `~const`. rs=demutingPatrick Walton-2/+6
2013-02-26auto merge of #5120 : jbclements/rust/macros-have-scope, r=pcwaltonbors-127/+604
r? After this patch, macros declared in a module, function, or block can only be used inside of that module, function or block, with the exception of modules declared with the #[macro_escape] attribute; these modules allow macros to escape, and can be used as a limited macro export mechanism. This pull request also includes miscellaneous comments, lots of new test cases, a few renamings, and a few as-yet-unused data definitions for hygiene.
2013-02-26typo-fixing and name-changesJohn Clements-15/+13
2013-02-26Macros now leave scopeJohn Clements-111/+586
Macro scope is now delimited by function, block, and module boundaries, except for modules that are marked with #[macro_escape], which allows macros to escape.
2013-02-26Adds (more) test cases for auto_encode.John Clements-16/+20
2013-02-26libsyntax: Stop parsing `~mut`Patrick Walton-1/+13
2013-02-26libsyntax: Remove a mutable field from the tests. rs=demutingPatrick Walton-4/+4
2013-02-25Stop parsing capture clausesBen Striegel-38/+20
2013-02-22libsyntax: Remove all mutable fields from libsyntax. rs=demutingPatrick Walton-5/+5
2013-02-22libsyntax: De-mut the parser. rs=demutingPatrick Walton-333/+332
2013-02-22libsyntax: De-mut the macro parser. rs=demutingPatrick Walton-12/+12
2013-02-22libsyntax: De-mut the pipe compilerPatrick Walton-37/+39
2013-02-22auto merge of #5081 : brson/rust/pipes, r=pcwaltonbors-21/+23
r?
2013-02-21auto merge of #5077 : jbclements/rust/increase-monomorphization-depth-limit, ↵bors-21/+75
r=catamorphism It appears that using deriving_eq/auto_encode on ASTs bumps up against the "gee this looks like infinite unfolding" limit of 10 in monomorphization. Increasing it to 30 seems to solve this problem for me.... Also, commenting and a few renames.
2013-02-21auto merge of #5076 : pcwalton/rust/demuting, r=pcwaltonbors-14/+14
2013-02-21core: Extract comm from pipes. #4742Brian Anderson-21/+23
2013-02-21auto merge of #5075 : luqmana/rust/derec, r=catamorphismbors-1/+1
Now only `lib core/pipes.rs` has `#[allow(structural_records)]`. That can be removed after a snapshot.
2013-02-21auto merge of #5059 : Kimundi/rust/incoming, r=catamorphismbors-3/+3
compiles-as-is, but needs a snapshot to remove the `stage0`ed extfmt export in core. Closes #4750
2013-02-21Cleanup, commenting, trivial renamingJohn Clements-21/+75
2013-02-21librustc: De-mut some of transPatrick Walton-14/+14
2013-02-21Remove the last bits of structural records from tests/rustc/rusti/rustpkg.Luqman Aden-1/+1
2013-02-21auto merge of #5068 : sethpink/rust/derive-eq-tuple-struct, r=catamorphismbors-14/+89
Previously an unimplemented error was thrown when using #[deriving_eq] on tuple-like struct definitions.
2013-02-21auto merge of #5071 : luqmana/rust/derec, r=pcwaltonbors-224/+315
Rid libsyntax of records and get rid of the last piece in `librustc/front/test.rs`.
2013-02-21librustc: Separate the rest of the trait bounds with `+` and stop parsing ↵Patrick Walton-3/+14
space-separated ones. rs=plussing
2013-02-21Moved core::extfmt to core::private::extfmtMarvin Löbel-3/+3
Needs a snapshot to remove stage0 extfmt export in core
2013-02-21Get rid of structural records in libsyntax and the last bit in librustc.Luqman Aden-224/+315
2013-02-21Implement #[deriving_eq] on tuple like structsSeth Pink-14/+89
2013-02-20librustc: Separate most trait bounds with '+'. rs=plussingPatrick Walton-21/+21
2013-02-20librustc: Get rid of structural records save for front/test.rs.Luqman Aden-2/+2
2013-02-19auto merge of #4999 : erickt/rust/incoming, r=brsonbors-333/+369
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 SyntaxExtensions's key to a @~strErick Tryzelaar-31/+31