about summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2013-05-14syntax: Remove #[allow(vecs_implicitly_copyable)]Alex Crichton-136/+137
2013-05-14Fix cosmetics for fail!() callsMarvin Löbel-1/+1
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-10/+10
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-12librustc: Make `self` and `static` into keywordsPatrick Walton-27/+24
2013-05-11Warning policeTim Chevalier-5/+3
2013-05-11auto merge of #6389 : sonwow/rust/issue-3356, r=bstriebors-8/+8
Fix for #3356
2013-05-10auto merge of #6223 : alexcrichton/rust/issue-6183, r=pcwaltonbors-23/+33
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-10renamed str::from_slice to str::to_ownedYoungsoo Son-1/+1
2013-05-10renamed vec::from_slice to vec::to_ownedYoungsoo Son-7/+7
2013-05-10auto merge of #6356 : dotdash/rust/strinterner, r=pcwaltonbors-247/+246
&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/+18
2013-05-09Use a specialized string interner to reduce the need for owned stringsBjörn Steinbrink-247/+246
&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-08libcore: Fix more merge fallout.Patrick Walton-5/+28
2013-05-08librustc: Fix merge fallout.Patrick Walton-8/+4
2013-05-08test: Fix tests and the pipe compilerPatrick Walton-4/+5
2013-05-08librustc: Remove mutable fields from the language.Patrick Walton-15/+9
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-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-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-197/+284
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-04Register snapshotsBrian Anderson-11/+0
2013-05-04auto merge of #6230 : thestinger/rust/whitespace, r=catamorphismbors-5/+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 #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-5/+0
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-117/+278
mutable fields in the process
2013-05-03Use static stringsJeong YunWon-1/+1
2013-05-02Remove 'Local Variable' commentsBrendan Zabarauskas-67/+0
2013-05-01allow parsing attributes on struct fieldsErick Tryzelaar-1/+2
2013-05-01rustc: remove the rest of dropErick Tryzelaar-1/+0
Removes: ast::struct_def::dtor syntax::ast::ii_dtor syntax::visit::fk_dtor syntax::ast_map::node_dtor syntax:struct_dtor
2013-04-30Merge remote-tracking branch 'brson/io'Brian Anderson-1/+1
Conflicts: src/libcore/task/local_data_priv.rs
2013-04-30new borrow checker (mass squash)Niko Matsakis-62/+71
2013-04-30adapt to snapshotNiko Matsakis-11/+0
2013-04-29librustc: Forbid type implementations on typedefs.Patrick Walton-1/+44
2013-04-29librustc: Change labels to use the lifetime notation `'`.Patrick Walton-5/+18
2013-04-29test: Fix tests.Patrick Walton-1/+3
2013-04-29librustc: Remove the concept of modes from the compiler.Patrick Walton-17/+15
This commit does not remove `ty::arg`, although that should be possible to do now.
2013-04-29librustc: Remove `ptr::addr_of`.Patrick Walton-5/+3
2013-04-28change stage1,stage2,stage2 into not(stage0)John Clements-3/+1
With luck, this will allow rust to compile itself without --cfg flags again...