summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-12-24Test fixes and rebase problemsAlex Crichton-1/+0
Note that this removes a number of run-pass tests which are exercising behavior of the old runtime. This functionality no longer exists and is thoroughly tested inside of libgreen and libnative. There isn't really the notion of "starting the runtime" any more. The major notion now is "bootstrapping the initial task".
2013-12-24green: Rip the bandaid off, introduce libgreenAlex Crichton-2/+2
This extracts everything related to green scheduling from libstd and introduces a new libgreen crate. This mostly involves deleting most of std::rt and moving it to libgreen. Along with the movement of code, this commit rearchitects many functions in the scheduler in order to adapt to the fact that Local::take now *only* works on a Task, not a scheduler. This mostly just involved threading the current green task through in a few locations, but there were one or two spots where things got hairy. There are a few repercussions of this commit: * tube/rc have been removed (the runtime implementation of rc) * There is no longer a "single threaded" spawning mode for tasks. This is now encompassed by 1:1 scheduling + communication. Convenience methods have been introduced that are specific to libgreen to assist in the spawning of pools of schedulers.
2013-12-22auto merge of #11064 : huonw/rust/vec-sort, r=alexcrichtonbors-3/+1
This uses quite a bit of unsafe code for speed and failure safety, and allocates `2*n` temporary storage. [Performance](https://gist.github.com/huonw/5547f2478380288a28c2): | n | new | priority_queue | quick3 | |-------:|---------:|---------------:|---------:| | 5 | 200 | 155 | 106 | | 100 | 6490 | 8750 | 5810 | | 10000 | 1300000 | 1790000 | 1060000 | | 100000 | 16700000 | 23600000 | 12700000 | | sorted | 520000 | 1380000 | 53900000 | | trend | 1310000 | 1690000 | 1100000 | (The times are in nanoseconds, having subtracted the set-up time (i.e. the `just_generate` bench target).) I imagine that there is still significant room for improvement, particularly because both priority_queue and quick3 are doing a static call via `Ord` or `TotalOrd` for the comparisons, while this is using a (boxed) closure. Also, this code does not `clone`, unlike `quick_sort3`; and is stable, unlike both of the others.
2013-12-22std::vec: make the sorting closure use `Ordering` rather than just beingHuon Wilson-5/+1
(implicitly) less_eq.
2013-12-20auto merge of #11077 : alexcrichton/rust/crate-id, r=cmrbors-0/+24
Right now the --crate-id and related flags are all process *after* the entire crate is parsed. This is less than desirable when used with makefiles because it means that just to learn the output name of the crate you have to parse the entire crate (unnecessary). This commit changes the behavior to lift the handling of these flags much sooner in the compilation process. This allows us to not have to parse the entire crate and only have to worry about parsing the crate attributes themselves. The related methods have all been updated to take an array of attributes rather than a crate. Additionally, this ceases duplication of the "what output are we producing" logic in order to correctly handle things in the case of --test. Finally, this adds tests for all of this functionality to ensure that it does not regress.
2013-12-21std::vec: add a sugary .sort() method for plain Ord sorting.Huon Wilson-0/+4
This moves the custom sorting to `.sort_by`.
2013-12-20auto merge of #11075 : alexcrichton/rust/issue-10392, r=brsonbors-2/+7
We decided in the 12/10/13 weekly meeting that trailing commas should be accepted pretty much anywhere. They are currently not allowed in struct patterns, and this commit adds support for that. Closes #10392
2013-12-20rustc: Improve crate id extractionAlex Crichton-0/+24
Right now the --crate-id and related flags are all process *after* the entire crate is parsed. This is less than desirable when used with makefiles because it means that just to learn the output name of the crate you have to parse the entire crate (unnecessary). This commit changes the behavior to lift the handling of these flags much sooner in the compilation process. This allows us to not have to parse the entire crate and only have to worry about parsing the crate attributes themselves. The related methods have all been updated to take an array of attributes rather than a crate. Additionally, this ceases duplication of the "what output are we producing" logic in order to correctly handle things in the case of --test. Finally, this adds tests for all of this functionality to ensure that it does not regress.
2013-12-20extra: remove sort in favour of the std method.Huon Wilson-3/+1
Fixes #9676.
2013-12-19auto merge of #11070 : ezyang/rust/better-errors, r=alexcrichtonbors-5/+14
On the advice of @huonw, I've just replaced item_span outright. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
2013-12-19Accept trailing commas in struct patternsAlex Crichton-2/+7
We decided in the 12/10/13 weekly meeting that trailing commas should be accepted pretty much anywhere. They are currently not allowed in struct patterns, and this commit adds support for that. Closes #10392
2013-12-19Rename pkgid to crate_idCorey Richardson-1/+3
Closes #11035
2013-12-19Generalize item_span into node_span, which works on more types.Edward Z. Yang-5/+14
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
2013-12-18auto merge of #10915 : alexcrichton/rust/fixes, r=ILyoanbors-0/+6
Just a little cleanup.
2013-12-17auto merge of #10972 : metajack/rust/pkgid-with-name, r=alexcrichtonbors-51/+77
This change extends the pkgid attribute to allow of explicit crate names, instead of always inferring them based on the path. This means that if your GitHub repo is called `rust-foo`, you can have your pkgid set your library name to `foo`. You'd do this with a pkgid attribute like `github.com/somewhere/rust-foo#foo:1.0`. This is half of the fix for #10922.
2013-12-17Change pkgid parser to allow overriding the inferred crate name.Jack Moffitt-51/+77
Previously the a pkgid of `foo/rust-bar#1.0` implied a crate name of `rust-bar` and didn't allow this to be overridden. Now you can override the inferred crate name with `foo/rust-bar#bar:1.0`.
2013-12-17auto merge of #11005 : sanxiyn/rust/mut, r=alexcrichtonbors-35/+28
There is no `~mut T` and `[mut T]` any more.
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)!`.