about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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
2014-10-07Add `abstract`, `final`, and `override` to reserved keywordsJohn Gallagher-0/+3
2014-10-07auto merge of #17787 : bgamari/rust/fix-quote-method, r=huonwbors-7/+9
The previous fix introduced in 75d49c8203405ab0af7a2b8b8698af02868fdbc2 neglected to parse outer attributes as described in #17782.
2014-10-07Update html_root_url for 0.12.0 releaseBrian Anderson-1/+1
2014-10-07Fix the most egregious instances of "local ambiguity: multiple parsing ↵Vadim Chugunov-1/+10
options..." error in macros, which often occurs when trying to match parts of Rust syntax. For example, this matcher: `fn $name:ident( $($param:ident : $pty:ty),* )` would fail when parsing `fn foo()`, because macro parser wouldn't realize that an ident cannot start with `)`. This resolves #5902, and at least partially mitigates #9364 and #3232.
2014-10-07Rename slice::SliceNick Cameron-1/+1
2014-10-07Put slicing syntax behind a feature gate.Nick Cameron-1/+8
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-07Use slice syntax instead of slice_to, etc.Nick Cameron-2/+2
2014-10-06syntax: Parse outer attributes in quote_method!Ben Gamari-7/+9
Fixes #17782.
2014-10-06auto merge of #17781 : P1start/rust/bitflags-lints, r=alexcrichtonbors-19/+19
Closes #17773.
2014-10-06Remove the #[allow(non_uppercase_statics)] attr from bitflags!P1start-19/+19
2014-10-05Give a more descriptive error when marking non-test items as #[test]P1start-12/+25
Closes #14772.
2014-10-04Changed `extern crate foo as bar;` error messageFelix Raimundo-5/+14
Closes #17709
2014-10-04Register new snapshotsBjörn Steinbrink-6/+2
2014-10-03rollup merge of #17729 : alexcrichton/issue-17718-startAlex Crichton-3/+21
2014-10-03rollup merge of #17215 : P1start/lintsAlex Crichton-5/+15
2014-10-03Correct error message for invalid `ref`/`mut` bindingsP1start-3/+4
Closes #15914.
2014-10-03Set the `non_uppercase_statics` lint to warn by defaultP1start-2/+11
2014-10-03auto merge of #16995 : kmcallister/rust/plugin-tutorial, r=alexcrichtonbors-1/+1
@steveklabnik, are you interested in looking this over?
2014-10-02syntax: Enable parsing of `const` globalsAlex Crichton-3/+21
This rewrites them to the current `ItemStatic` production of the compiler, but I want to get this into a snapshot. It will be illegal to use a `static` in a pattern of a `match` statement, so all those current uses will need to be rewritten to `const` once it's implemented. This requires that the stage0 snapshot is able to parse `const`. cc #17718
2014-10-02rollup merge of #17666 : eddyb/take-garbage-outAlex Crichton-55/+4
Conflicts: src/libcollections/lib.rs src/libcore/lib.rs src/librustdoc/lib.rs src/librustrt/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/test/run-pass/issue-8898.rs
2014-10-02Revert "Use slice syntax instead of slice_to, etc."Aaron Turon-2/+2
This reverts commit 40b9f5ded50ac4ce8c9323921ec556ad611af6b7.
2014-10-02Revert "Put slicing syntax behind a feature gate."Aaron Turon-8/+1
This reverts commit 95cfc35607ccf5f02f02de56a35a9ef50fa23a82.
2014-10-02syntax: remove ObsoleteManaged{Type,Expr}.Eduard Burtescu-24/+0
2014-10-02syntax: mark the managed_boxes feature as Removed.Eduard Burtescu-1/+1
2014-10-02syntax: ast: remove TyBox and UnBox.Eduard Burtescu-31/+5
2014-10-02syntax: remove unused imports of Gc and GC.Eduard Burtescu-1/+0
2014-10-02Put slicing syntax behind a feature gate.Nick Cameron-1/+8
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-02Use slice syntax instead of slice_to, etc.Nick Cameron-2/+2
2014-10-01Update some old references to rust.mdKeegan McAllister-1/+1
2014-10-01auto merge of #17678 : fhahn/rust/issue-17628-infinite-recursion, r=alexcrichtonbors-0/+12
This is a patch for #17628, thanks to @kmcallister for your helpful hints!
2014-10-01Limit recursion depth for macro expansions, closes #17628Florian Hahn-0/+12
2014-10-01auto merge of #17630 : sfackler/rust/cfg-warnings, r=brsonbors-9/+0
Closes #17490