about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-05-10auto merge of #6223 : alexcrichton/rust/issue-6183, r=pcwaltonbors-23/+197
Closes #6183. The first commit changes the compiler's method of treating a `for` loop, and all the remaining commits are just dealing with the fallout. The biggest fallout was the `IterBytes` trait, although it's really a whole lot nicer now because all of the `iter_bytes_XX` methods are just and-ed together. Sadly there was a huge amount of stuff that's `cfg(stage0)` gated, but whoever lands the next snapshot is going to have a lot of fun deleting all this code!
2013-05-10auto merge of #6329 : sonwow/rust/issue-6306, r=ILyoanbors-4/+4
Fix for #6306
2013-05-10auto merge of #6356 : dotdash/rust/strinterner, r=pcwaltonbors-319/+374
&str can be turned into @~str on demand, using to_owned(), so for strings, we can create a specialized interner that accepts &str for intern() and find() but stores and returns @~str.
2013-05-10Fix deriving(IterBytes) to use the new for-loop protocolAlex Crichton-11/+15
2013-05-10syntax: Use the new `for` protocolAlex Crichton-12/+182
2013-05-10Move core::task::local_data to core::local_dataYoungsoo Son-4/+4
2013-05-09back-ticksLenny222-1/+1
2013-05-09Use a specialized string interner to reduce the need for owned stringsBjörn Steinbrink-319/+374
&str can be turned into @~str on demand, using to_owned(), so for strings, we can create a specialized interner that accepts &str for intern() and find() but stores and returns @~str.
2013-05-09auto merge of #6345 : seanmoon/rust/fix-typos, r=sanxiynbors-1/+1
Hi there, Really enjoying Rust. Noticed a few typos so I searched around for a few more--here's some fixes. Ran `make check` and got `summary of 24 test runs: 4868 passed; 0 failed; 330 ignored`. Thanks! Sean
2013-05-09libsyntax: rename vec::each(var) to var.eachYoungmin Yoo-1/+1
2013-05-08libcore: Fix more merge fallout.Patrick Walton-5/+29
2013-05-08librustc: Fix merge fallout.Patrick Walton-8/+4
2013-05-08librustc: Stop parsing modes and remove them entirely from the languagePatrick Walton-10/+7
2013-05-08test: Fix tests and the pipe compilerPatrick Walton-4/+5
2013-05-08librustc: Remove mutable fields from the language.Patrick Walton-36/+40
They're still parsed though, to get through bootstrapping.
2013-05-09Fix typosSean Moon-1/+1
2013-05-08auto merge of #6267 : huonw/rust/syntax-deriving-generaliseder, r=nikomatsakisbors-777/+1193
This "finishes" the generic deriving code (which I started in #5640), in the sense it supports everything that I can think of being useful. (Including lifetimes and type parameters on methods and traits, arguments and return values of (almost) any type, static methods.) It closes #6149, but met with #6257, so the following doesn't work: ```rust #[deriving(TotalEq)] struct Foo<'self>(&'self int); ``` (It only fails for `TotalOrd`, `TotalEq` and `Clone`, since they are the only ones that call a method directly on sub-elements of the type, which means that the auto-deref interferes with the pointer.) It also makes `Rand` (chooses a random variant, fills the fields with random values, including recursively for recursive types) and `ToStr` (`x.to_str()` is the same as `fmt!("%?", x)`) derivable, as well as converting IterBytes to the generic code (which made the code 2.5x shorter, more robust and added support for tuple structs). ({En,De}codable are trickier, so I'll convert them over later.)
2013-05-07auto merge of #6271 : pnkfelix/rust/issue6009-condition-pub-priv-variants, ↵bors-0/+15
r=graydon @brson: r? [please ignore the other one that was accidentally based off master due to back-button-bugs in github.com] My goal is to resolve the question of whether we want to encourage (by example) consistent use of pub to make identifiers publicly-accessible, even in syntax extensions. (If people don't want that, then we can just let this pull request die.) This is part one of two. Part two, whose contents should be clear from the FIXME's in this commit, would land after this gets incorporated into a snapshot. (The eventual goal is to address issue #6009 , which was implied by my choice of branch name, but not mentioned in the pull request, so github did not notice it.)
2013-05-07auto merge of #6245 : youknowone/rust/match-range-static, r=graydonbors-2/+8
Fix unintended error problem of: ```` static s: int = 1; static e: int = 42; fn main() { match 7 { s..e => (), ^~ error: expected `=>` but found `..` _ => (), } } ````
2013-05-06Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freezeNiko Matsakis-0/+36
2013-05-06Step one for 'proper' pub condition: support pub keyword in form.Felix S. Klock II-0/+15
2013-05-07libsyntax: add #[deriving(Rand, ToStr)].Huon Wilson-0/+196
The former fills each field of a struct or enum variant with a random value (and picks a random enum variant). The latter makes the .to_str method have the same output as fmt!("%?", ..).
2013-05-07libsyntax: convert #[deriving(IterBytes)] to generic derivingHuon Wilson-223/+61
2013-05-07libsyntax: extend generic deriving code to handle almost all possible traits.Huon Wilson-554/+936
This adds support for static methods, and arguments of most types, traits with type parameters, methods with type parameters (and lifetimes for both), as well as making the code more robust to support deriving on types with lifetimes (i.e. 'self).
2013-05-06Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freezeNiko Matsakis-6/+6
2013-05-06refinement to technique used to not run regionckNiko Matsakis-1/+7
2013-05-06Add assert_approx_eq! macroBrendan Zabarauskas-0/+36
2013-05-05Fix two more write guard failuresNiko Matsakis-1/+1
2013-05-05Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freezeNiko Matsakis-708/+456
Conflicts: src/libcore/core.rc src/libcore/hashmap.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/num/float.rs src/libcore/num/int-template.rs src/libcore/num/num.rs src/libcore/num/strconv.rs src/libcore/num/uint-template.rs src/libcore/ops.rs src/libcore/os.rs src/libcore/prelude.rs src/libcore/rt/mod.rs src/libcore/unstable/lang.rs src/librustc/driver/session.rs src/librustc/middle/astencode.rs src/librustc/middle/borrowck/check_loans.rs src/librustc/middle/borrowck/gather_loans.rs src/librustc/middle/borrowck/loan.rs src/librustc/middle/borrowck/preserve.rs src/librustc/middle/liveness.rs src/librustc/middle/mem_categorization.rs src/librustc/middle/region.rs src/librustc/middle/trans/base.rs src/librustc/middle/trans/inline.rs src/librustc/middle/trans/reachable.rs src/librustc/middle/typeck/check/_match.rs src/librustc/middle/typeck/check/regionck.rs src/librustc/util/ppaux.rs src/libstd/arena.rs src/libstd/ebml.rs src/libstd/json.rs src/libstd/serialize.rs src/libstd/std.rc src/libsyntax/ast_map.rs src/libsyntax/parse/parser.rs src/test/compile-fail/borrowck-uniq-via-box.rs src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs src/test/run-pass/borrowck-nested-calls.rs
2013-05-05auto merge of #6208 : sanxiyn/rust/accurate-span, r=sanxiynbors-6/+6
2013-05-06Fix span testsSeo Sanghyeon-2/+2
2013-05-05Allow non-literal static range pattern for match armsJeong YunWon-2/+8
Fix unintended error problem of: static s: int = 1; static e: int = 42; fn main() { match 7 { s..e => (), ^~ error: expected `=>` but found `..` _ => (), } }
2013-05-04Register snapshotsBrian Anderson-66/+0
2013-05-04auto merge of #6230 : thestinger/rust/whitespace, r=catamorphismbors-7/+0
I just had `git apply` fix most of them and then did a quick skim over the diff to fix a few cases where it did the wrong thing (mostly replacing tabs with 4 spaces, when someone's editor had them at 8 spaces).
2013-05-03auto merge of #6229 : catamorphism/rust/warning-police, r=catamorphismbors-4/+3
2013-05-03auto merge of #6219 : dotdash/rust/fmt, r=graydonbors-4/+2
Only the first portion has to be owned, as it acts as the buffer for the constructed string. The remaining strings can be static.
2013-05-03add gitattributes and fix whitespace issuesDaniel Micay-7/+0
2013-05-03syntax: Warning policeTim Chevalier-4/+3
2013-05-03rustc: Handle struct patterns where the expected type is an enumTim Chevalier-3/+3
Previously, rustc would ICE if you matched on an enum-typed thing with a structure pattern. Error out correctly.
2013-05-03auto merge of #6046 : brson/rust/io, r=graydonbors-1/+1
r? @pcwalton Sorry this is so big, and sorry the first commit is just titled 'wip'. Some interesting bits * [LocalServices](https://github.com/brson/rust/commit/f9069baa70ea78117f2087fe6e359fb2ea0ae16a) - This is the set of runtime capabilities that *all* Rust code should expect access to, including the local heap, GC, logging, unwinding. * [impl Reader, etc. for Option](https://github.com/brson/rust/commit/5fbb0949a53a6ac51c6d9b187ef4c464e52ae536) - Constructors like `File::open` return Option<FileStream>. This lets you write I/O code without ever unwrapping an option. This series adds a lot of [documentation](https://github.com/brson/rust/blob/io/src/libcore/rt/io/mod.rs#L11) to `core::rt::io`.
2013-05-03Avoid needless creation of unique strings in fmt!()Björn Steinbrink-4/+2
Only the first portion has to be owned, as it acts as the buffer for the constructed string. The remaining strings can be static.
2013-05-02Merge remote-tracking branch 'brson/io' into incomingBrian Anderson-1/+1
Conflicts: mk/rt.mk src/libcore/run.rs
2013-05-02librustc: Update the serializer to work properly with INHTWAMA, removing ↵Patrick Walton-121/+332
mutable fields in the process
2013-05-02fix numerous dynamic borrow failuresNiko Matsakis-1/+1
2013-05-03More accurate spansSeo Sanghyeon-4/+4
2013-05-03Use static stringsJeong YunWon-39/+32
2013-05-02More cases of [cfg(test)] instead of [test].Felix S. Klock II-1/+1
2013-05-02Remove 'Local Variable' commentsBrendan Zabarauskas-202/+0
2013-05-01syntax: fix up dynamic borrow errors in libsyntaxNiko Matsakis-10/+10
2013-05-01auto merge of #6148 : erickt/rust/remove-drop, r=pcwaltonbors-313/+115
The drop block has been deprecated for quite some time. This patch series removes support for parsing it and all the related machinery that made drop work. As a side feature of all this, I also added the ability to annote fields in structs. This allows comments to be properly associated with an individual field. However, I didn't update `rustdoc` to integrate these comment blocks into the documentation it generates.