summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-11-30auto merge of #10727 : erickt/rust/json, r=huonwbors-4/+5
This PR does some small modernizations to the json library. First is to remove the `@` boxes, second is to rename the constructors to `new`.
2013-11-29extra: missed a couple `@` in jsonErick Tryzelaar-1/+1
2013-11-29Add generation of static libraries to rustcAlex Crichton-1/+2
This commit implements the support necessary for generating both intermediate and result static rust libraries. This is an implementation of my thoughts in https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html. When compiling a library, we still retain the "lib" option, although now there are "rlib", "staticlib", and "dylib" as options for crate_type (and these are stackable). The idea of "lib" is to generate the "compiler default" instead of having too choose (although all are interchangeable). For now I have left the "complier default" to be a dynamic library for size reasons. Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a dynamic object. I chose this for size reasons, but also because you're probably not going to be embedding the rustc compiler anywhere any time soon. Other than the options outlined above, there are a few defaults/preferences that are now opinionated in the compiler: * If both a .dylib and .rlib are found for a rust library, the compiler will prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option * If generating a "lib", the compiler will generate a dynamic library. This is overridable by explicitly saying what flavor you'd like (rlib, staticlib, dylib). * If no options are passed to the command line, and no crate_type is found in the destination crate, then an executable is generated With this change, you can successfully build a rust program with 0 dynamic dependencies on rust libraries. There is still a dynamic dependency on librustrt, but I plan on removing that in a subsequent commit. This change includes no tests just yet. Our current testing infrastructure/harnesses aren't very amenable to doing flavorful things with linking, so I'm planning on adding a new mode of testing which I believe belongs as a separate commit. Closes #552
2013-11-29extra: json::Encoder should take a &mut io::WriterErick Tryzelaar-3/+4
2013-11-29extra: Rename json constructors into *::initErick Tryzelaar-1/+1
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-6/+6
2013-11-28Register new snapshotsAlex Crichton-143/+138
2013-11-27Be more strict about doc commentsCorey Richardson-4/+2
Previously, `//// foo` and `/*** foo ***/` were accepted as doc comments. This changes that, so that only `/// foo` and `/** foo ***/` are accepted. This confuses many newcomers and it seems weird. Also update the manual for these changes, and modernify the EBNF for comments. Closes #10638
2013-11-27Freeze the AST by removing a couple of unused @mut ~[T] from token_tree.Eduard Burtescu-14/+25
2013-11-26auto merge of #10670 : eddyb/rust/node-u32, r=alexcrichtonbors-46/+42
### Rationale There is no reason to support more than 2³² nodes or names at this moment, as compiling something that big (even without considering the quadratic space usage of some analysis passes) would take at least **64GB**. Meanwhile, some can't (or barely can) compile rustc because it requires almost **1.5GB**. ### Potential problems Can someone confirm this doesn't affect metadata (de)serialization? I can't tell myself, I know nothing about it. ### Results Some structures have a size reduction of 25% to 50%: [before](https://gist.github.com/luqmana/3a82a51fa9c86d9191fa) - [after](https://gist.github.com/eddyb/5a75f8973d3d8018afd3). Sadly, there isn't a massive change in the memory used for compiling stage2 librustc (it doesn't go over **1.4GB** as [before](http://huonw.github.io/isrustfastyet/mem/), but I can barely see the difference). However, my own testcase (previously peaking at **1.6GB** in typeck) shows a reduction of **200**-**400MB**.
2013-11-27Shink NodeId, CrateNum, Name and Mrk down to 32 bits on x64.Eduard Burtescu-46/+42
2013-11-26Clean up SmallVector use a bitSteven Fackler-98/+34
2013-11-26Support multiple item macrosSteven Fackler-93/+118
Closes #4375
2013-11-26Add SmallVector to libsyntaxSteven Fackler-0/+214
2013-11-26test: Remove all remaining non-procedure uses of `do`.Patrick Walton-8/+8
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-192/+178
2013-11-26libsyntax: Remove the old-style borrowed closure type syntax from thePatrick Walton-1/+8
language.
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-17/+18
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-8/+8
2013-11-26rustc: Add lint for obsolete attributesklutzy-43/+1
This also moves `#[auto_{en,de}code]` checker from syntax to lint.
2013-11-26Take &Pat in visit_patSeo Sanghyeon-5/+5
2013-11-25Take &PatSeo Sanghyeon-1/+1
2013-11-25auto merge of #10628 : huonw/rust/3614, r=alexcrichtonbors-7/+18
Fixes #3614.
2013-11-25syntax: parse inner attributes on impls.Huon Wilson-7/+18
Fixes #3614.
2013-11-24auto merge of #10641 : cmr/rust/close_delims, r=alexcrichtonbors-9/+7
Currently, the parser doesn't give any context when it finds an unclosed delimiter and it's not EOF. Report the most recent unclosed delimiter, to help the user along. Closes #10636
2013-11-24auto merge of #10637 : luqmana/rust/nmt, r=cmrbors-23/+30
There's no need for it to be @mut.
2013-11-24Add a note for unclosed delimitersCorey Richardson-9/+7
Currently, the parser doesn't give any context when it finds an unclosed delimiter and it's not EOF. Report the most recent unclosed delimiter, to help the user along. Closes #10636
2013-11-24Add comments to ast, ast_map, ty, and pat_utilKiet Tran-0/+17
2013-11-24libextra: Remove @mut from term.Luqman Aden-23/+30
2013-11-22syntax: add a visit_ident method to the Visitor.Huon Wilson-3/+45
2013-11-21Remove ty_macSeo Sanghyeon-6/+1
2013-11-20auto merge of #10567 : sanxiyn/rust/bytepos, r=alexcrichtonbors-13/+15
2013-11-20auto merge of #10527 : eholk/rust/win64, r=alexcrichtonbors-0/+3
This was needed to access UEFI boot services in my new Boot2Rust experiment. I also realized that Rust functions declared as extern always use the C calling convention regardless of how they were declared, so this pull request fixes that as well.
2013-11-21Fix parsing testsSeo Sanghyeon-1/+1
2013-11-20Make BytePos 32-bitSeo Sanghyeon-12/+14
2013-11-19libsyntax: Change all uses of `&fn` to `||`.Patrick Walton-111/+139
2013-11-19auto merge of #10557 : huonw/rust/inline-deriving, r=pcwaltonbors-1/+27
ToStr, Encodable and Decodable are not marked as such, since they're already expensive, and lead to large methods, so inlining will bloat the metadata & the binaries. This means that something like #[deriving(Eq)] struct A { x: int } creates an instance like #[doc = "Automatically derived."] impl ::std::cmp::Eq for A { #[inline] fn eq(&self, __arg_0: &A) -> ::bool { match *__arg_0 { A{x: ref __self_1_0} => match *self { A{x: ref __self_0_0} => true && __self_0_0.eq(__self_1_0) } } } #[inline] fn ne(&self, __arg_0: &A) -> ::bool { match *__arg_0 { A{x: ref __self_1_0} => match *self { A{x: ref __self_0_0} => false || __self_0_0.ne(__self_1_0) } } } } (The change being the `#[inline]` attributes.)
2013-11-18libsyntax: Remove `~fn()` from the languagePatrick Walton-3/+11
2013-11-18Add Win64 calling convention.Eric Holk-0/+3
2013-11-18Use '..' as slice wildcard in vectorsBrian Anderson-15/+46
2013-11-18Use '..' as multi-field wildcard in enums and structs.Brian Anderson-1/+26
2013-11-19Mark some derived methods as #[inline].Huon Wilson-1/+27
ToStr, Encodable and Decodable are not marked as such, since they're already expensive, and lead to large methods, so inlining will bloat the metadata & the binaries. This means that something like #[deriving(Eq)] struct A { x: int } creates an instance like #[doc = "Automatically derived."] impl ::std::cmp::Eq for A { #[inline] fn eq(&self, __arg_0: &A) -> ::bool { match *__arg_0 { A{x: ref __self_1_0} => match *self { A{x: ref __self_0_0} => true && __self_0_0.eq(__self_1_0) } } } #[inline] fn ne(&self, __arg_0: &A) -> ::bool { match *__arg_0 { A{x: ref __self_1_0} => match *self { A{x: ref __self_0_0} => false || __self_0_0.ne(__self_1_0) } } } } (The change being the `#[inline]` attributes.)
2013-11-17auto merge of #10443 : alexcrichton/rust/meaninless-pub-priv, r=cmrbors-1/+1
Closes #10111
2013-11-17Forbid privacy in inner functionsAlex Crichton-1/+1
Closes #10111
2013-11-16auto merge of #10420 : sanxiyn/rust/path, r=cmrbors-4/+0
Fix #10283.
2013-11-13auto merge of #10277 : dcrewi/rust/missing-doc-and-visibility-rules, ↵bors-12/+20
r=alexcrichton Now the privacy pass returns enough information that other passes do not need to duplicate the visibility rules, and the missing_doc implementation is more consistent with other lint checks.
2013-11-13make missing_doc lint respect the visibility rulesDavid Creswick-12/+20
Previously, the `exported_items` set created by the privacy pass was incomplete. Specifically, it did not include items that had been defined at a private path but then `pub use`d at a public path. This commit finds all crate exports during the privacy pass. Consequently, some code in the reachable pass and in rustdoc is no longer necessary. This commit then removes the separate `MissingDocLintVisitor` lint pass, opting to check missing_doc lint in the same pass as the other lint checkers using the visibility result computed by the privacy pass. Fixes #9777.
2013-11-11Move std::rt::io to std::ioAlex Crichton-16/+16
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-79/+2
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-11-11Fix path parsingSeo Sanghyeon-4/+0