about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-08-30fix various warningsErick Tryzelaar-1/+1
2013-08-28auto merge of #8718 : bblum/rust/typeof, r=pcwaltonbors-3/+39
r? anybody
2013-08-27librustc: Fix merge fallout.Patrick Walton-46/+3
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-22/+66
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-27librustc: Add support for type parameters in the middle of paths.Patrick Walton-301/+505
For example, `foo::<T>::bar::<U>`. This doesn't enforce that the type parameters are in the right positions, however.
2013-08-27librustc: Remove `&const` and `*const` from the language.Patrick Walton-19/+14
They are still present as part of the borrow check.
2013-08-27auto merge of #8797 : ↵bors-2/+2
nikomatsakis/rust/issue-8625-assign-to-andmut-in-borrowed-loc-2, r=pcwalton Fixes for #8625 to prevent assigning to `&mut` in borrowed or aliasable locations. The old code was insufficient in that it failed to catch bizarre cases like `& &mut &mut`. r? @pnkfelix
2013-08-27Remove remnants of implicit selfNiko Matsakis-2/+2
2013-08-24Introduce alternate forms of loggingAlex Crichton-23/+30
These new macros are all based on format! instead of fmt! and purely exist for bootstrapping purposes. After the next snapshot, all uses of logging will be migrated to these macros, and then after the next snapshot after that we can drop the `2` suffix on everything
2013-08-24Settle on the format/write/print family of namesAlex Crichton-11/+36
2013-08-24Implement a wrapper macro around fprintf -- ifmtfAlex Crichton-22/+50
2013-08-23Emit a better error for attempted unsafe-pointer-self. Close #8306.Ben Blum-0/+13
2013-08-23Parse and reserve typeof keyword. #3228Ben Blum-3/+26
2013-08-22Add `self` to the ast_map for provided methods. Closes #8010.Michael Sullivan-5/+11
2013-08-22auto merge of #8626 : kballard/rust/issue-8615, r=catamorphismbors-1/+0
Fixes #8615.
2013-08-21std/extra: changing XXX to FIXME; cleanupTim Chevalier-2/+9
* Get rid of by-value-self workarounds; it works now * Remove type annotations, they're not needed anymore
2013-08-21auto merge of #8582 : thestinger/rust/container, r=thestingerbors-6/+5
5f3a637 r=huonw 934a5eb r=thestinger 0f6e90a r=cmr
2013-08-20auto merge of #8573 : mrordinaire/rust/struct-new-as-field-name, r=alexcrichtonbors-23/+0
fix for #8088, along with a test.
2013-08-20rm obsolete integer to_str{,_radix} free functionsDaniel Micay-6/+5
2013-08-19Don't skip token after @'staticKevin Ballard-1/+0
Fixes #8615.
2013-08-19auto merge of #8535 : nikomatsakis/rust/issue-3678-wrappers-be-gone-2, r=graydonbors-0/+79
Long-standing branch to remove foreign function wrappers altogether. Calls to C functions are done "in place" with no stack manipulation; the scheme relies entirely on the correct use of `#[fixed_stack_segment]` to guarantee adequate stack space. A linter is added to detect when `#[fixed_stack_segment]` annotations are missing. An `externfn!` macro is added to make it easier to declare foreign fns and wrappers in one go: this macro may need some refinement, though, for example it might be good to be able to declare a group of foreign fns. I leave that for future work (hopefully somebody else's work :) ). Fixes #3678.
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-0/+79
2013-08-19auto merge of #8564 : alexcrichton/rust/ifmt+++, r=graydonbors-23/+20
See discussion in #8489, but this selects option 3 by adding a `Default` trait to be implemented by various basic types. Once this makes it into a snapshot I think it's about time to start overhauling all current use-cases of `fmt!` to move towards `ifmt!`. The goal is to replace `%X` with `{}` in 90% of situations, and this commit should enable that.
2013-08-18auto merge of #8556 : sfackler/rust/quote, r=alexcrichtonbors-154/+114
They previously required one called "ext_cx" to be in scope. Fixes part of #7727
2013-08-18auto merge of #8560 : kballard/rust/reserve-yield, r=pcwaltonbors-4/+7
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-18quote_*! macros take an ExtCtxSteven Fackler-154/+114
They previously required one called "ext_cx" to be in scope. Fixes part of #7727
2013-08-18auto merge of #8551 : huonw/rust/speling, r=alexcrichtonbors-3/+3
(This doesn't add/remove `u`s or change `ize` to `ise`, or anything like that.)
2013-08-18auto merge of #8550 : kballard/rust/token-start-err-msg, r=catamorphismbors-1/+3
The span was fixed at some point to point to the correct character, but the error message is still bad. Update it to emit the actual character in question (potentially escaped). Fixes #3747.
2013-08-17auto merge of #8547 : kballard/rust/trait-parse-err-msg, r=alexcrichtonbors-1/+1
When parsing a trait function, the function must end with either `;` or `{` (signifying a default implementation). The error message incorrectly stated that it must be `;` or `}`. Fixes #6610.
2013-08-18fix for #8088 (Cannot name a struct field `new` due to ancient syntax)Do Nhat Minh-23/+0
remove code for parsing ancient syntax added a run-pass test
2013-08-17Fix warnings in librustc and libsyntaxErick Tryzelaar-1/+0
2013-08-16Delegate `{}` to Default instead of PolyAlex Crichton-23/+20
By using a separate trait this is overridable on a per-type basis and makes room for the possibility of even more arguments passed in for the future.
2013-08-16Reserve 'yield' keywordKevin Ballard-4/+7
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-16auto merge of #8534 : huonw/rust/tls-key-macro, r=alexcrichtonbors-0/+11
This allows the internal implementation details of the TLS keys to be changed without requiring the update of all the users. (Or, applying changes that *have* to be applied for the keys to work correctly, e.g. forcing LLVM to not merge these constants.)
2013-08-16auto merge of #8526 : blake2-ppc/rust/either-result, r=catamorphismbors-3/+3
Retry of PR #8471 Replace the remaining functions marked for issue #8228 with similar functions that are iterator-based. Change `either::{lefts, rights}` to be iterator-filtering instead of returning a vector. Replace `map_vec`, `map_vec2`, `iter_vec2` in std::result with three functions: * `result::collect` gathers `Iterator<Result<V, U>>` to `Result<~[V], U>` * `result::fold` folds `Iterator<Result<T, E>>` to `Result<V, E>` * `result::fold_` folds `Iterator<Result<T, E>>` to `Result<(), E>`
2013-08-16doc: convert remaining uses of core:: to std::.Huon Wilson-3/+3
2013-08-16syntax: add a local_data_key macro that creates a key for access to the TLS.Huon Wilson-0/+11
This allows the internal implementation details of the TLS keys to be changed without requiring the update of all the users. (Or, applying changes that have to be applied for the keys to work correctly, e.g. forcing LLVM to not merge these constants.)
2013-08-15Better error message for unknown start of tokenKevin Ballard-1/+3
The span was fixed at some point to point to the correct character, but the error message is still bad. Update it to emit the actual character in question (potentially escaped). Fixes #3747.
2013-08-15Fix error message when trait method ends with wrong tokenKevin Ballard-1/+1
When parsing a trait function, the function must end with either `;` or `{` (signifying a default implementation). The error message incorrectly stated that it must be `;` or `}`. Fixes #6610.
2013-08-15Switch to new <V:Visitor> visitor (rather than @Visitor).Felix S. Klock II-296/+366
Alpha-renamed top-level visit_* functions to walk_*. (Motivation: Distinguish visit action and recursive traversal.) Abstract over `&mut self` rather than over `@mut self`. This required some acrobatics, notably the `impl<E> Visitor<E> for @mut Visitor<E>` and corresponding introduction of `@mut Visitor` and some local `let mut` bindings. Remove oldvisit reference. Added default implementations for all of the Visitor trait methods. Note that both `visit_expr_post` and `visit_ty` are no-op's by default, just like they are in `oldvisit::default_visitor`. Refactoring: extract logic to ease swapping visit for oldvisit (hopefully).
2013-08-15std: Change either::{lefts, rights} to return an iteratorblake2-ppc-3/+3
2013-08-14auto merge of #8440 : sfackler/rust/env-fix, r=pcwaltonbors-1/+1
The type of the result of option_env! was not fully specified in the None case, leading to type check failures in the case where the variable was not defined (e.g. option_env!("FOO").is_none()). Also cleaned up some compilation warnings.
2013-08-13auto merge of #8446 : alexcrichton/rust/ifmt++, r=graydonbors-14/+26
This includes a number of improvements to `ifmt!` * Implements formatting arguments -- `{:0.5x}` works now * Formatting now works on all integer widths, not just `int` and `uint` * Added a large doc block to `std::fmt` which should help explain what `ifmt!` is all about * Added floating point formatters, although they have the same pitfalls from before (they're just proof-of-concept now) Closed a couple of issues along the way, yay! Once this gets into a snapshot, I'll start looking into removing all of `fmt`
2013-08-13Add `f` formats to `ifmt!`Alex Crichton-5/+6
Currently the work just the same as the old `extfmt` versions
2013-08-12Forbid pub/priv where it has no effectAlex Crichton-38/+30
Closes #5495
2013-08-12Correct the padding on integer types for formattingAlex Crichton-5/+13
2013-08-12Define integer formats for all widthsAlex Crichton-0/+1
Closes #1653
2013-08-12Implement formatting arguments for strings and integersAlex Crichton-5/+7
Closes #1651
2013-08-12auto merge of #8418 : ↵bors-31/+114
pnkfelix/rust/fsk-issue3192-improve-parse-error-for-empty-struct-init, r=pcwalton,me Fix #3192. r? anyone There are 4 different new tests, to check some different scenarios for what the parse context is at the time of recovery, becasue our compile-fail infrastructure does not appear to handle verifying error-recovery situations. Differentiate between unit-like struct definition item and unit-like struct construction in the error message. ---- More generally, outlines a more generic strategy for parse error recovery: By committing to an expression/statement at set points in the parser, we can then do some look-ahead to catch common mistakes and skip over them. One detail about this strategy is that you want to avoid emitting the "helpful" message unless the input is reasonably close to the case of interest. (E.g. do not warn about a potential unit struct for an input of the form `let hmm = do foo { } { };`) To accomplish this, I added (partial) last_token tracking; used for `commit_stmt` support. The check_for_erroneous_unit_struct_expecting fn returns bool to signal whether it "made progress"; currently unused; this is meant for use to compose several such recovery checks together in a loop.
2013-08-11Fixed option_env! typeSteven Fackler-1/+1
The type of the result of option_env! was not fully specified in the None case, leading to type check failures in the case where the variable was not defined (e.g. option_env!("FOO").is_none()).