about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-03-21libsyntax: Remove `@const` from the languagePatrick Walton-1/+13
2013-03-21librustc: Forbid destructors from being attached to any structs that might ↵Patrick Walton-0/+1
contain non-Owned fields. r=nmatsakis
2013-03-21auto merge of #5407 : jbclements/rust/add-assert-eq-macro, r=jbclementsbors-81/+60
Adds an assert_eq! macro that asserts that its two arguments are equal. Error messages can therefore be somewhat more informative than a simple assert, because the error message includes "expected" and "given" values.
2013-03-21Un-renamed trim and substr functions.Marvin Löbel-6/+6
2013-03-21Switched over substr and trim functions in str to be non-allocating, ↵Marvin Löbel-5/+8
temporary renamed them to better track use-sites
2013-03-21back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNIQ -> ↵Marvin Löbel-9/+9
slice_unique
2013-03-21renamed str::view -> slice_DBG_BRWDMarvin Löbel-11/+11
renamed str::slice -> slice_DBG_UNIQ changed vec slice method -> to_owned() renamed vec view method -> slice_V_DBG_BRWD
2013-03-20change some uses of fail_unless to assert_eqJohn Clements-81/+50
2013-03-20libsyntax: Never use `::<>` in the type grammarPatrick Walton-8/+6
2013-03-20add assert_eq! macroJohn Clements-0/+10
the assert_eq! macro compares its arguments and fails if they're not equal. It's more informative than fail_unless!, because it explicitly writes the given and expected arguments on failure.
2013-03-20auto merge of #5434 : apasel422/rust/deriving, r=nikomatsakisbors-1271/+1358
This is the first step in refactoring the deriving code in libsyntax. No code is changed, just rearranged.
2013-03-20Refactor the self-info so that the def-id is carried in ty_self()Niko Matsakis-1/+1
and the fn_ctxt doesn't need any self_info field at all. Step towards fixing `fn(&self)` (cc #4846) to have a distinct lifetime.
2013-03-20auto merge of #5443 : alexcrichton/rust/less-bad-copy, r=catamorphismbors-68/+69
Removes a lot of instances of `/*bad*/ copy` throughout libsyntax/librustc. On the plus side, this shaves about 2s off of the runtime when compiling `librustc` with optimizations. Ideally I would have run a profiler to figure out which copies are the most critical to remove, but in reality there was a liberal amount of `git grep`s along with some spot checking and removing the easy ones.
2013-03-19auto merge of #5442 : pcwalton/rust/extern-block-restriction, r=pcwaltonbors-44/+92
r? @graydon
2013-03-20syntax: Removing some bad copiesAlex Crichton-68/+69
2013-03-19libsyntax: Forbid `use` (and most other things) within `extern { ... }` blocksPatrick Walton-32/+54
2013-03-19syntax: split deriving module into submodules for each traitAndrew Paseltiner-977/+1062
2013-03-19auto merge of #5436 : alexcrichton/rust/assert-message, r=pcwaltonbors-0/+5
This would close #2761. I figured that if you're supplying your own custom message, you probably don't mind the stringification of the condition to not be in the message.
2013-03-19syntax: move ext/deriving.rs to ext/deriving/mod.rsAndrew Paseltiner-0/+2
2013-03-19libsyntax: Accept the new `[T, ..N]` style for vec.Patrick Walton-4/+10
2013-03-19libsyntax: Accept `static` instead of `const` for globalsPatrick Walton-6/+16
2013-03-19librustc: Enforce privacy for static methods.Patrick Walton-3/+13
This starts moving a bunch of privacy checks into the privacy checking phase and out of resolve.
2013-03-19auto merge of #5426 : nikomatsakis/rust/issue-4846-lifetimes-in-expl-self, ↵bors-24/+90
r=pcwalton (this will be needed for snapshotting at some point) r? @pcwalton
2013-03-19Allow custom messages on assert statementsAlex Crichton-0/+5
2013-03-19auto merge of #5433 : lucab/rust/lucab/cfgspec, r=graydonbors-0/+16
All current meta items types (word, name-value, list) are now properly parsed by rustc --cfg command line. Fixes #2399
2013-03-19Make driver::driver::parse_cfgspecs parse any variety of meta_itemLuca Bruno-0/+16
All current meta items types (word, name-value, list) are now properly parsed by rustc --cfg command line. Fixes #2399 Signed-off-by: Luca Bruno <lucab@debian.org>
2013-03-18Fix pretty printer for fixed length vectors.Luqman Aden-4/+3
2013-03-18Now actually allow using constants in those constant expressions for [T * n].Luqman Aden-3/+6
2013-03-18Allow constant expressions in [Type * n].Luqman Aden-21/+8
2013-03-18librustc: Make the compiler ignore purity.Patrick Walton-41/+75
For bootstrapping purposes, this commit does not remove all uses of the keyword "pure" -- doing so would cause the compiler to no longer bootstrap due to some syntax extensions ("deriving" in particular). Instead, it makes the compiler ignore "pure". Post-snapshot, we can remove "pure" from the language. There are quite a few (~100) borrow check errors that were essentially all the result of mutable fields or partial borrows of `@mut`. Per discussions with Niko I think we want to allow partial borrows of `@mut` but detect obvious footguns. We should also improve the error message when `@mut` is erroneously reborrowed.
2013-03-18libsyntax: Stop parsing old lifetimes, except for the ones on data type ↵Patrick Walton-0/+11
declarations.
2013-03-18librustc: Convert all uses of old lifetime notation to new lifetime ↵Patrick Walton-6/+12
notation. rs=delifetiming
2013-03-18Make &self permit explicit lifetimes, but don't really use themNiko Matsakis-24/+90
(this will be needed for snapshotting at some point).
2013-03-16auto merge of #5374 : z0w0/rust/rustdoc-explicit-self, r=z0w0bors-2/+3
2013-03-16syntax: Fix fun_to_str testZack Corr-1/+1
2013-03-15auto merge of #5359 : luqmana/rust/inline-asm, r=pcwaltonbors-7/+47
Continuation of #5317. Actually use operands properly now, including any number of output operands. Which means you can do things like call printf: ```Rust fn main() { unsafe { do str::as_c_str(~"The answer is %d.\n") |c| { let a = 42; asm!("mov $0, %rdi\n\t\ mov $1, %rsi\n\t\ xorl %eax, %eax\n\t\ call _printf" : : "r"(c), "r"(a) : "rdi", "rsi", "eax" : "volatile","alignstack" ); } } } ``` ``` % rustc foo.rs % ./foo The answer is 42. ``` Or just add 2 numbers: ```Rust fn add(a: int, b: int) -> int { let mut c = 0; unsafe { asm!("add $2, $0" : "=r"(c) : "0"(a), "r"(b) ); } c } fn main() { io::println(fmt!("%d", add(1, 2))); } ``` ``` % rustc foo.rs % ./foo 3 ``` Multiple outputs! ```Rust fn addsub(a: int, b: int) -> (int, int) { let mut c = 0; let mut d = 0; unsafe { asm!("add $4, $0\n\t\ sub $4, $1" : "=r"(c), "=r"(d) : "0"(a), "1"(a), "r"(b) ); } (c, d) } fn main() { io::println(fmt!("%?", addsub(5, 1))); } ``` ``` % rustc foo.rs % ./foo (6, 4) ``` This also classifies inline asm as RvalueStmtExpr instead of the somewhat arbitrary kind I made it initially. There are a few XXX's regarding what to do in the liveness and move passes.
2013-03-15auto merge of #5404 : bstrie/rust/decopy, r=pcwaltonbors-1/+1
Also turn `copy` into `.clone()` in much of run-pass.
2013-03-15Fix type_use for inline asm.Luqman Aden-2/+2
2013-03-15Tidy.Luqman Aden-1/+1
2013-03-15Implicitly use addr_of for output operands in asm.Luqman Aden-0/+7
2013-03-15Actually pass inline asm operands around.Luqman Aden-7/+40
2013-03-15impl Clone for ~T, ~[T], ~strBen Striegel-1/+1
2013-03-15Update test case to conform to new restrictions on castingJohn Clements-3/+2
2013-03-15Test case fixup (old one tested the old bad behavior).John Clements-12/+12
2013-03-15add nonempty encoding for spansJohn Clements-1/+1
Before this change, encoding an object containing a codemap::span using the JSON encodeng produced invalid JSON, for instance: [{"span":,"global":false,"idents":["abc"]}] Since the decoder for codemap::span's ignores its argument, I conjecture that this will not damage decoding, and should improve it for many decoders.
2013-03-14rustdoc: Document explicit self in methods. Closes #5254Zack Corr-1/+2
2013-03-13libsyntax: Remove a use of deprecated Encodable from libsyntax. rs=burningtreePatrick Walton-1/+1
2013-03-13test: Fix tests. rs=testsPatrick Walton-2/+1
2013-03-13librustc: Don't require the "static" keyword to define a static methodPatrick Walton-10/+10
2013-03-13librustc: Remove implicit self from the language, except for old-style drop ↵Patrick Walton-1/+15
blocks.