summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-12-17Remove obsolete mutability from ast::TySeo Sanghyeon-35/+28
2013-12-16auto merge of #10994 : ktt3ja/rust/issue-10956, r=alexcrichtonbors-0/+4
Types used inside live struct or enum are now marked live. Fix #10956 and #10993.
2013-12-16AST Visitor now walks enum discriminant expressionKiet Tran-0/+4
2013-12-15Register new snapshotsAlex Crichton-7/+1
Understand 'pkgid' in stage0. As a bonus, the snapshot now contains now metadata (now that those changes have landed), and the snapshot download is half as large as it used to be!
2013-12-15Forbid multiple imports in use statementsAlex Crichton-0/+6
Closes #10911
2013-12-15libsyntax: Implement the new `box` syntax for unique pointers.Patrick Walton-7/+25
2013-12-15librustc: Remove identifiers named `box`, since it's about to become a keyword.Patrick Walton-9/+12
2013-12-14auto merge of #10935 : sanxiyn/rust/fk-anon, r=pcwaltonbors-7/+5
2013-12-13auto merge of #10698 : metajack/rust/dep-info, r=alexcrichtonbors-1/+19
This isn't super useful for libraries yet without #10593. Fixes #7633.
2013-12-12Add --dep-info to write Makefile-compatible dependency info.Jack Moffitt-0/+4
When --dep-info is given, rustc will write out a `$input_base.d` file in the output directory that contains Makefile compatible dependency information for use with tools like make and ninja.
2013-12-12Remove fk_anonSeo Sanghyeon-7/+5
2013-12-11auto merge of #10897 : boredomist/rust/remove-self-lifetime, r=brsonbors-81/+82
Also remove all instances of 'self within the codebase. This fixes #10889. To make reviewing easier the following files were modified with more than a dumb text replacement: - `src/test/compile-fail/lifetime-no-keyword.rs` - `src/test/compile-fail/lifetime-obsoleted-self.rs` - `src/test/compile-fail/regions-free-region-ordering-incorrect.rs` - `src/libsyntax/parse/lexer.rs`
2013-12-11Make 'self lifetime illegal.Erik Price-81/+82
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-11auto merge of #10891 : ↵bors-271/+161
chris-morgan/rust/macroize-(or-should-that-be-macroify)-syntax--parse--token-so-that-we-don't-make-mistakes-and-to-reduce-the-maintenance-burden, r=huonw I also renumbered things at the same time; ``in`` was shifted into its alphabetical position and the reserved keywords were reordered (a couple of them were out of order). Unused special identifiers are also removed in the second part.
2013-12-11auto merge of #10808 : kballard/rust/use-braces, r=alexcrichtonbors-2/+21
This fixes #10806.
2013-12-10Support imports of the form `use {foo,bar}`Kevin Ballard-2/+21
This fixes #10806.
2013-12-10auto merge of #10833 : sfackler/rust/mut-pat, r=brsonbors-1/+16
Previously, if you wanted to bind a field mutably or by ref, you had to do something like Foo { x: ref mut x }. You can now just do Foo { ref mut x }. Closes #6137
2013-12-11Separate strict/reserved keywords, derive bounds.Chris Morgan-11/+29
It's twenty lines longer, but makes for clearer separation of strict and reserved keywords (probably a good thing) and removes another moving part (the definitions of `(STRICT|RESERVED)_KEYWORD_(START|FINAL)`).
2013-12-11Remove the following unused special identifiers:Chris Morgan-107/+67
- underscore ("_") - unary ("unary") - not_fn ("!") - idx_fn ("[]") - unary_minus_fn ("unary-") - item ("item") - block ("block") - stmt ("stmt") - pat ("pat") - expr ("expr") - ty ("ty") - ident ("ident") - path ("path") - descrim ("descrim") - clownshoe_stack_shim ("__rust_stack_shim") - blk ("blk") - c_abi ("C") (And, of course, renumber everything to match.)
2013-12-10Fix missing code map entry for uses of `include_str!`.Jack Moffitt-1/+15
2013-12-10auto merge of #10593 : metajack/rust/pkgid-hash, r=brsonbors-0/+171
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.
2013-12-10Make crate hash stable and externally computable.Jack Moffitt-0/+171
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.
2013-12-11Deduplicate in syntax::parse::token with a macro.Chris Morgan-271/+183
I also renumbered things at the same time; ``in`` was shifted into its alphabetical position and the reserved keywords were reordered (a couple of them were out of order).
2013-12-10Allow ref and mut modifiers for short form field patternsSteven Fackler-1/+16
Previously, if you wanted to bind a field mutably or by ref, you had to do something like Foo { x: ref mut x }. You can now just do Foo { ref mut x }. Closes #6137
2013-12-09Check the privacy of implemented traitsAlex Crichton-18/+25
This bug showed up because the visitor only visited the path of the implemented trait via walk_path (with no corresponding visit_path function). I have modified the visitor to use visit_path (which is now overridable), and the privacy visitor overrides this function and now properly checks for the privacy of all paths. Closes #10857
2013-12-10Extend allocation lint for boxing expressionsSeo Sanghyeon-12/+12
2013-12-08Fix comment on ast::DefStructKiet Tran-3/+8
2013-12-08Remove dead codesKiet Tran-159/+3
2013-12-08Add dead-code warning passKiet Tran-40/+9
2013-12-07auto merge of #10844 : huonw/rust/deriving-expn-info, r=alexcrichtonbors-230/+297
Previously something like struct NotEq; #[deriving(Eq)] struct Error { foo: NotEq } would just point to the `foo` field, with no mention of the `deriving(Eq)`. With this patch, the compiler creates a note saying "in expansion of #[deriving(Eq)]" pointing to the Eq. (includes some cleanup/preparation; the commit view might be nicer, to filter out the noise of the first one.)
2013-12-06Link rustllvm statically, and distribute a static snapshotAlex Crichton-0/+1
In order to keep up to date with changes to the libraries that `llvm-config` spits out, the dependencies to the LLVM are a dynamically generated rust file. This file is now automatically updated whenever LLVM is updated to get kept up-to-date. At the same time, this cleans out some old cruft which isn't necessary in the makefiles in terms of dependencies. Closes #10745 Closes #10744
2013-12-07syntax::deriving: indicate from which trait type errors (etc) ariseHuon Wilson-4/+22
using the expansion info. Previously something like struct NotEq; #[deriving(Eq)] struct Error { foo: NotEq } would just point to the `foo` field, with no mention of the `deriving(Eq)`. With this patch, the compiler creates a note saying "in expansion of #[deriving(Eq)]" pointing to the Eq.
2013-12-07syntax: print expansion info from #[attribute] macros in the correctHuon Wilson-3/+27
format. Previously, any attempt to use this information from inside something like #[deriving(Foo)] would result in it printing like `deriving(Foo)!`.
2013-12-07syntax::deriving: add the cx and span to the TraitDef to reduce duplication.Huon Wilson-226/+251
2013-12-05auto merge of #10665 : cmr/rust/doc_lint, r=alexcrichtonbors-0/+1
Because the root module isn't actually an item, we need to do some hackish handling of it. Closes #10656.
2013-12-06Check crate root for docs in missing_doc lint.Corey Richardson-0/+1
Because the root module isn't actually an item, we need to do some hackish handling of it. Closes #10656.
2013-12-05Forbid keywords as lifetime parameters names.Léo Testard-1/+11
2013-12-04Rename extra::json::*::init() constructors to *::new()Kevin Ballard-1/+1
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-6/+6
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-12-04auto merge of #10792 : kballard/rust/parse_sugary_call_expr-comments, ↵bors-8/+8
r=alexcrichton The comments on this function date back from when it was used for `for` expressions in addition to `do` expressions.
2013-12-04std::str: remove from_utf8.Huon Wilson-4/+4
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
2013-12-03Fix the comments for libsyntax::parse::parser::parse_sugary_call_exprKevin Ballard-8/+8
The comments on this function date back from when it was used for `for` expressions in addition to `do` expressions.
2013-12-03auto merge of #10747 : alexcrichton/rust/snapshots, r=cmrbors-1/+0
This registers new snapshots after the landing of #10528, and then goes on to tweak the build process to build a monolithic `rustc` binary for use in future snapshots. This mainly involved dropping the dynamic dependency on `librustllvm`, so that's now built as a static library (with a dynamically generated rust file listing LLVM dependencies). This currently doesn't actually make the snapshot any smaller (24MB => 23MB), but I noticed that the executable has 11MB of metadata so once progress is made on #10740 we should have a much smaller snapshot. There's not really a super-compelling reason to distribute just a binary because we have all the infrastructure for dealing with a directory structure, but to me it seems "more correct" that a snapshot compiler is just a `rustc` binary.
2013-12-03Register new snapshotsAlex Crichton-1/+0
2013-12-02Add a macro to check if logging at a given label is enabledPhilipp Brüschweiler-0/+7
This is useful when the information that is needed to do useful logging is expensive to produce.
2013-12-01auto merge of #10750 : Blei/rust/no-at-struct-field, r=alexcrichtonbors-19/+19
2013-12-01auto merge of #10676 : eddyb/rust/ast-box-in-enums, r=cmrbors-406/+398
**Note**: I only tested on top of my #10670 PR, size reductions come from both change sets. With this, [more enums are shrinked](https://gist.github.com/eddyb/08fef0dfc6ff54e890bc), the most significant one being `ast_node`, from 104 bytes (master) to 96 (#10670) and now to 32 bytes. My own testcase requires **200MB** less when compiling (not including the other **200MB** gained in #10670), and rustc-stage2 is down by about **130MB**. I believe there is more to gain by fiddling with the enums' layouts.
2013-12-01ast: Remove one `@` and fix the falloutPhilipp Brüschweiler-19/+19
2013-11-30auto merge of #10528 : alexcrichton/rust/static-linking-v2, r=pcwaltonbors-1/+2
In this series of commits, I've implemented static linking for rust. The scheme I implemented was the same as my [mailing list post](https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html). The commits have more details to the nitty gritty of what went on. I've rebased this on top of my native mutex pull request (#10479), but I imagine that it will land before this lands, I just wanted to pre-emptively get all the rebase conflicts out of the way (becuase this is reorganizing building librustrt as well). Some contentious points I want to make sure are all good: * I've added more "compiler chooses a default" behavior than I would like, I want to make sure that this is all very clearly outlined in the code, and if not I would like to remove behavior or make it clearer. * I want to make sure that the new "fancy suite" tests are ok (using make/python instead of another rust crate) If we do indeed pursue this, I would be more than willing to write up a document describing how linking in rust works. I believe that this behavior should be very understandable, and the compiler should never hinder someone just because linking is a little fuzzy.
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-406/+398
critical enum sizes.