summary refs log tree commit diff
path: root/src/libsyntax/print
AgeCommit message (Collapse)AuthorLines
2013-03-31Fix warningsBrian Anderson-2/+1
2013-03-29Add AbiSet and integrate it into the AST.Niko Matsakis-17/+47
I believe this patch incorporates all expected syntax changes from extern function reform (#3678). You can now write things like: extern "<abi>" fn foo(s: S) -> T { ... } extern "<abi>" mod { ... } extern "<abi>" fn(S) -> T The ABI for foreign functions is taken from this syntax (rather than from an annotation). We support the full ABI specification I described on the mailing list. The correct ABI is chosen based on the target architecture. Calls by pointer to C functions are not yet supported, and the Rust type of crust fns is still *u8.
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-14/+14
2013-03-28Removing unused importsAlex Crichton-3/+3
2013-03-28auto merge of #5593 : luqmana/rust/inline-asm, r=catamorphismbors-6/+6
Clean things up a bit. Also, allow selecting intel syntax in addition to the default AT&T dialect.
2013-03-28librustc: Remove common fields and nested enums from the languagePatrick Walton-3/+0
2013-03-27auto merge of #5578 : erickt/rust/incoming, r=jbclements,ericktbors-28/+13
Hey folks, This patch series does some work on the json decoder, specifically with auto decoding of enums. Previously, we would take this code: ``` enum A { B, C(~str, uint) } ``` and would encode a value of this enum to either `["B", []]` or `["C", ["D", 123]]`. I've changed this to `"B"` or `["C", "D", 123]`. This matches the style of the O'Caml json library [json-wheel](http://mjambon.com/json-wheel.html). I've added tests to make sure all this work. In order to make this change, I added passing a `&[&str]` vec to `Decode::emit_enum_variant` so the json decoder can convert the name of a variant into it's position. I also changed the impl of `Encodable` for `Option<T>` to have the right upper casing. I also did some work on the parser, which allows for `fn foo<T: ::cmp::Eq>() { ... }` statements (#5572), fixed the pretty printer properly expanding `debug!("...")` expressions, and removed `ast::expr_vstore_fixed`, which doesn't appear to be used anymore.
2013-03-27libsyntax: use a struct for inline asm in ast.Luqman Aden-6/+6
2013-03-27auto merge of #5558 : nikomatsakis/rust/issue-4920-autoref-index-operator, ↵bors-3/+2
r=nikomatsakis Per discussion on IRC. r? @pcwalton
2013-03-27Fix pretty-printer test failure by carrying the bound lifetime names throughNiko Matsakis-3/+9
the types. Initially I thought it would be necessary to thread this data through not only the AST but the types themselves, but then I remembered that the pretty printer only cares about the AST. Regardless, I have elected to leave the changes to the types intact since they will eventually be needed. I left a few FIXMEs where it didn't seem worth finishing up since the code wasn't crucial yet.
2013-03-27syntax: Remove deprecated expr_vstore_fixedErick Tryzelaar-12/+3
2013-03-27syntax: fix pretty printing __log stmtsErick Tryzelaar-14/+8
2013-03-27syntax: pass some values around by referenceErick Tryzelaar-2/+2
2013-03-27remove sty_by_ref, though traces still remain due to dtorsNiko Matsakis-3/+2
2013-03-25rustdoc: Show puritySeo Sanghyeon-20/+11
2013-03-23libsyntax: Fix `static` in pretty printer. rs=burningtreePatrick Walton-10/+0
2013-03-22librustc: Remove the `const` declaration form everywherePatrick Walton-4/+4
2013-03-22auto merge of #5488 : pcwalton/rust/depure, r=pcwaltonbors-2/+2
2013-03-22librustc: Remove `pure` from libsyntax and librustc.Patrick Walton-2/+2
2013-03-22auto merge of #5483 : pcwalton/rust/static-syntax, r=graydonbors-1/+1
r? @nikomatsakis
2013-03-22syntax: replace uses of old deriving attribute with new oneAndrew Paseltiner-1/+1
2013-03-21librustc: Replace the `&static` bound with `'static`Patrick Walton-1/+1
2013-03-21auto merge of #5407 : jbclements/rust/add-assert-eq-macro, r=jbclementsbors-4/+3
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-20change some uses of fail_unless to assert_eqJohn Clements-4/+3
2013-03-20libsyntax: Never use `::<>` in the type grammarPatrick Walton-6/+2
2013-03-20auto merge of #5443 : alexcrichton/rust/less-bad-copy, r=catamorphismbors-53/+53
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-3/+3
r? @graydon
2013-03-20syntax: Removing some bad copiesAlex Crichton-53/+53
2013-03-19libsyntax: Accept the new `[T, ..N]` style for vec.Patrick Walton-1/+1
2013-03-19libsyntax: Accept `static` instead of `const` for globalsPatrick Walton-2/+2
2013-03-19auto merge of #5426 : nikomatsakis/rust/issue-4846-lifetimes-in-expl-self, ↵bors-11/+14
r=pcwalton (this will be needed for snapshotting at some point) r? @pcwalton
2013-03-18Fix pretty printer for fixed length vectors.Luqman Aden-3/+3
2013-03-18Allow constant expressions in [Type * n].Luqman Aden-3/+3
2013-03-18librustc: Make the compiler ignore purity.Patrick Walton-5/+8
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-18Make &self permit explicit lifetimes, but don't really use themNiko Matsakis-11/+14
(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-15Actually pass inline asm operands around.Luqman Aden-2/+18
2013-03-14rustdoc: Document explicit self in methods. Closes #5254Zack Corr-1/+2
2013-03-13librustc: Don't accept `as Trait` anymore; fix all occurrences of it.Patrick Walton-5/+10
2013-03-13Remove `++` mode from the compiler (it is parsed as `+` mode)Niko Matsakis-1/+0
and obsolete `-` mode altogether (it *was* parsed as `+` mode).
2013-03-13auto merge of #5293 : brson/rust/logging, r=brsonbors-1/+1
r? @graydon This removes `log` from the language. Because we can't quite implement it as a syntax extension (probably need globals at the least) it simply renames the keyword to `__log` and hides it behind macros. After this the only way to log is with `debug!`, `info!`, etc. I figure that if there is demand for `log!` we can add it back later. I am not sure that we ever agreed on this course of action, though I *think* there is consensus that `log` shouldn't be a statement.
2013-03-12Add alignstack option for inline asm.Luqman Aden-1/+1
2013-03-12Parse operands properly and add a way to indicate volatile asm.Luqman Aden-2/+6
2013-03-12Create asm! syntax extension.Luqman Aden-1/+1
2013-03-12Parse inline assembly.Luqman Aden-0/+8
2013-03-11Remove uses of logBrian Anderson-1/+1
2013-03-11auto merge of #5304 : jld/rust/const-adjustments, r=graydonbors-0/+5
These changes make const translation use adjustments (autodereference, autoreference, bare-fn-to-closure), like normal code does, replacing some ad-hoc logic that wasn't always right. As a convenient side-effect, explicit dereference (both of pointers and of newtypes) is also supported in const expressions. There is also a “bonus fix” for a bug in the pretty-printer exposed by one of the added tests.
2013-03-11librustc: Lint the old `drop` destructor notation offPatrick Walton-27/+2
2013-03-11librustc: Replace all uses of `fn()` with `&fn()`. rs=defunPatrick Walton-2/+2