summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2014-10-28Use PascalCase for token variantsBrendan Zabarauskas-987/+1029
2014-10-27rollup merge of #18362 : kevinmehall/pprint-struct-pat-shorthandAlex Crichton-3/+5
2014-10-27rollup merge of #18332 : jbcrail/fix-commentsAlex Crichton-1/+1
2014-10-27rollup merge of #18326 : sfackler/cfg-finalAlex Crichton-17/+5
2014-10-27rollup merge of #18303 : cgaebel/make-vec-match-sliceAlex Crichton-1/+1
2014-10-27rollup merge of #18256 : SimonSapin/view_item_to_stringAlex Crichton-0/+4
2014-10-27Preserve struct field pattern shorthand in the prettyprinter.Kevin Mehall-3/+5
Use the `is_shorthand` field introduced by #17813 (ead6c4b) to make the prettyprinter output the shorthand form. Fixes a few places that set `is_shorthand: true` when the pattern is not a PatIdent with the same name as the field.
2014-10-25Fix spelling mistakes in comments.Joseph Crail-1/+1
2014-10-26Update parse::test::string_to_tts_1 testBrendan Zabarauskas-113/+100
2014-10-25Finish cfg syntax transitionSteven Fackler-17/+5
2014-10-26Add a KleeneOp enum for clarityBrendan Zabarauskas-30/+42
2014-10-26Reduce the size of the TokenTreeBrendan Zabarauskas-22/+34
2014-10-26Use standard capitalisation for TokenTree variantsBrendan Zabarauskas-91/+91
2014-10-26Prevent some vector reallocationsBrendan Zabarauskas-11/+10
2014-10-26Rename TokenTree variants for clarityBrendan Zabarauskas-91/+94
This should be clearer, and fits in better with the `TTNonterminal` variant. Renames: - `TTTok` -> `TTToken` - `TTDelim` -> `TTDelimited` - `TTSeq` -> `TTSequence`
2014-10-26Add Span and separate open/close delims to TTDelimBrendan Zabarauskas-88/+135
This came up when working [on the gl-rs generator extension](https://github.com/bjz/gl-rs/blob/990383de801bd2e233159d5be07c9b5622827620/src/gl_generator/lib.rs#L135-L146). The new definition of `TTDelim` adds an associated `Span` that covers the whole token tree and enforces the invariant that a delimited sequence of token trees must have an opening and closing delimiter. A `get_span` method has also been added to `TokenTree` type to make it easier to implement better error messages for syntax extensions.
2014-10-24Make the Vec data structure layout match raw::Slice.Clark Gaebel-1/+1
Fixes #18302 r? @thestinger
2014-10-24Add a lint for not using field pattern shorthandsP1start-29/+44
Closes #17792.
2014-10-23Add syntax::print::pprint::view_item_to_stringSimon Sapin-0/+4
… similar to the existing `item_to_string`. There may be more missing like this.
2014-10-22auto merge of #18141 : phildawes/rust/master, r=brsonbors-3/+49
Hello! I noticed spans are wrong for the PatIdents of self args. (I use spans a lot in racer)
2014-10-21Change method lookup infrastructure to use the trait methods. InsteadNiko Matsakis-0/+8
of tracking individual candidates per impl, we just track one candidate for the extension trait itself, and let the trait resolution handle walking the individual impls and so forth. Also change the interface to report back a richer notion of error.
2014-10-20auto merge of #18070 : alexcrichton/rust/spring-cleaning, r=aturonbors-411/+209
This is a large spring-cleaning commit now that the 0.12.0 release has passed removing an amount of deprecated functionality. This removes a number of deprecated crates (all still available as cargo packages in the rust-lang organization) as well as a slew of deprecated functions. All `#[crate_id]` support has also been removed. I tried to avoid anything that was recently deprecated, but I may have missed something! The major pain points of this commit is the fact that rustc/syntax have `#[allow(deprecated)]`, but I've removed that annotation so moving forward they should be cleaned up as we go.
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-411/+209
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-10-19fix printing signed literal in print_literalAleksandr Koshlo-1/+10
2014-10-18Parser: Fix spans of explicit self arg identsPhil Dawes-3/+49
2014-10-18auto merge of #18099 : jakub-/rust/fixed-issues, r=alexcrichtonbors-1/+1
Closes #9249. Closes #13105. Closes #13837. Closes #13847. Closes #15207. Closes #15261. Closes #16048. Closes #16098. Closes #16256. Closes #16562. Closes #16596. Closes #16709. Closes #16747. Closes #17025. Closes #17121. Closes #17450. Closes #17636.
2014-10-17auto merge of #16855 : P1start/rust/help-messages, r=brsonbors-11/+31
This adds ‘help’ diagnostic messages to rustc. This is used for anything that provides help to the user, particularly the `--explain` messages that were previously integrated into the relevant error message. They look like this: ``` match.rs:10:13: 10:14 error: unreachable pattern [E0001] match.rs:10 1 => {}, ^ match.rs:3:1: 3:38 note: in expansion of foo! match.rs:7:5: 20:2 note: expansion site match.rs:10:13: 10:14 help: pass `--explain E0001` to see a detailed explanation ``` (`help` is coloured cyan.) Adding these errors on a separate line stops the lines from being too long, as discussed in #16619.
2014-10-17Add tests for a few fixed issuesJakub Wieczorek-1/+1
2014-10-16libsyntax: Don't accept :? as a format specifier.Luqman Aden-1/+0
2014-10-16libsyntax: Remove all uses of {:?}.Luqman Aden-22/+23
2014-10-16Remove libdebug and update tests.Luqman Aden-1/+0
2014-10-13rollup merge of #17927 : alexcrichton/more-constAlex Crichton-1/+3
2014-10-13auto merge of #17733 : jgallagher/rust/while-let, r=alexcrichtonbors-2/+95
This is *heavily* based on `if let` (#17634) by @jakub- and @kballard This should close #17687
2014-10-13auto merge of #17963 : sfackler/rust/cfg-error, r=alexcrichtonbors-99/+22
All deprecation warnings have been converted to errors. This includes the warning for multiple cfgs on one item. We'll leave that as an error for some period of time to ensure that all uses are updated before the behavior changes from "or" to "and".
2014-10-13auto merge of #17757 : gamazeps/rust/issue17709, r=alexcrichtonbors-5/+14
I did not put the crate name in the error note, if that's necessary I'll look into it. Closes #17709
2014-10-12rustc: Warn about dead constantsAlex Crichton-1/+3
A few catch-all blocks ended up not having this case for constants. Closes #17925
2014-10-12Continue cfg syntax transitionSteven Fackler-99/+22
All deprecation warnings have been converted to errors. This includes the warning for multiple cfgs on one item. We'll leave that as an error for some period of time to ensure that all uses are updated before the behavior changes from "or" to "and".
2014-10-11Remove `virtual` structs from the languageJakub Wieczorek-59/+10
2014-10-10Move `while let` behind `while_let` feature gateJohn Gallagher-0/+5
2014-10-10Desugar `while let` into `loop { match { ... } }`John Gallagher-1/+10
2014-10-10Teach libsyntax about `while let`John Gallagher-1/+80
2014-10-10auto merge of #17853 : alexcrichton/rust/issue-17718, r=pcwaltonbors-62/+82
This change is an implementation of [RFC 69][rfc] which adds a third kind of global to the language, `const`. This global is most similar to what the old `static` was, and if you're unsure about what to use then you should use a `const`. The semantics of these three kinds of globals are: * A `const` does not represent a memory location, but only a value. Constants are translated as rvalues, which means that their values are directly inlined at usage location (similar to a #define in C/C++). Constant values are, well, constant, and can not be modified. Any "modification" is actually a modification to a local value on the stack rather than the actual constant itself. Almost all values are allowed inside constants, whether they have interior mutability or not. There are a few minor restrictions listed in the RFC, but they should in general not come up too often. * A `static` now always represents a memory location (unconditionally). Any references to the same `static` are actually a reference to the same memory location. Only values whose types ascribe to `Sync` are allowed in a `static`. This restriction is in place because many threads may access a `static` concurrently. Lifting this restriction (and allowing unsafe access) is a future extension not implemented at this time. * A `static mut` continues to always represent a memory location. All references to a `static mut` continue to be `unsafe`. This is a large breaking change, and many programs will need to be updated accordingly. A summary of the breaking changes is: * Statics may no longer be used in patterns. Statics now always represent a memory location, which can sometimes be modified. To fix code, repurpose the matched-on-`static` to a `const`. static FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } change this code to: const FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } * Statics may no longer refer to other statics by value. Due to statics being able to change at runtime, allowing them to reference one another could possibly lead to confusing semantics. If you are in this situation, use a constant initializer instead. Note, however, that statics may reference other statics by address, however. * Statics may no longer be used in constant expressions, such as array lengths. This is due to the same restrictions as listed above. Use a `const` instead. [breaking-change] Closes #17718 [rfc]: https://github.com/rust-lang/rfcs/pull/246
2014-10-09Use the same html_root_url for all docsBrian Anderson-1/+1
2014-10-09Revert "Update html_root_url for 0.12.0 release"Brian Anderson-1/+1
This reverts commit 2288f332301b9e22db2890df256322650a7f3445.
2014-10-09syntax: Tweak the return value of bytes!()Alex Crichton-14/+9
Instead of returning &'static [u8], an invocation of `bytes!()` now returns `&'static [u8, ..N]` where `N` is the length of the byte vector. This should functionally be the same, but there are some cases where an explicit cast may be needed, so this is a: [breaking-change]
2014-10-09syntax: Convert statics to constantsAlex Crichton-23/+23
2014-10-09rustc: Add `const` globals to the languageAlex Crichton-25/+50
This change is an implementation of [RFC 69][rfc] which adds a third kind of global to the language, `const`. This global is most similar to what the old `static` was, and if you're unsure about what to use then you should use a `const`. The semantics of these three kinds of globals are: * A `const` does not represent a memory location, but only a value. Constants are translated as rvalues, which means that their values are directly inlined at usage location (similar to a #define in C/C++). Constant values are, well, constant, and can not be modified. Any "modification" is actually a modification to a local value on the stack rather than the actual constant itself. Almost all values are allowed inside constants, whether they have interior mutability or not. There are a few minor restrictions listed in the RFC, but they should in general not come up too often. * A `static` now always represents a memory location (unconditionally). Any references to the same `static` are actually a reference to the same memory location. Only values whose types ascribe to `Sync` are allowed in a `static`. This restriction is in place because many threads may access a `static` concurrently. Lifting this restriction (and allowing unsafe access) is a future extension not implemented at this time. * A `static mut` continues to always represent a memory location. All references to a `static mut` continue to be `unsafe`. This is a large breaking change, and many programs will need to be updated accordingly. A summary of the breaking changes is: * Statics may no longer be used in patterns. Statics now always represent a memory location, which can sometimes be modified. To fix code, repurpose the matched-on-`static` to a `const`. static FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } change this code to: const FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } * Statics may no longer refer to other statics by value. Due to statics being able to change at runtime, allowing them to reference one another could possibly lead to confusing semantics. If you are in this situation, use a constant initializer instead. Note, however, that statics may reference other statics by address, however. * Statics may no longer be used in constant expressions, such as array lengths. This is due to the same restrictions as listed above. Use a `const` instead. [breaking-change] [rfc]: https://github.com/rust-lang/rfcs/pull/246
2014-10-09Merge tag '0.12.0'Brian Anderson-1/+1
0.12.0 release
2014-10-08auto merge of #17866 : jgallagher/rust/reserve-inheritance-keywords, r=huonwbors-0/+3
Closes #17862
2014-10-08auto merge of #17838 : vadimcn/rust/macros, r=alexcrichtonbors-1/+10