summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2014-09-26Hide the quote_*! macros when the feature gate is offKeegan McAllister-67/+55
This makes it easier to experiment with improved quasiquoting as an ordinary plugin library. The list of quote macros in feature_gate.rs was already out of sync; this commit also prevents that problem in the future.
2014-09-26librustc: Eliminate the `ref` syntax for unboxed closure capture clausesPatrick Walton-33/+34
in favor of `move`. This breaks code that used `move` as an identifier, because it is now a keyword. Change such identifiers to not use the keyword `move`. Additionally, this breaks code that was counting on by-value or by-reference capture semantics for unboxed closures (behind the feature gate). Change `ref |:|` to `|:|` and `|:|` to `move |:|`. Part of RFC #63; part of issue #12831. [breaking-change]
2014-09-25auto merge of #17378 : Gankro/rust/hashmap-entry, r=aturonbors-7/+9
Deprecates the `find_or_*` family of "internal mutation" methods on `HashMap` in favour of the "external mutation" Entry API as part of RFC 60. Part of #17320, but this still needs to be done on the rest of the maps. However they don't have any internal mutation methods defined, so they can be done without deprecating or breaking anything. Work on `BTree` is part of the complete rewrite in #17334. The implemented API deviates from the API described in the RFC in two key places: * `VacantEntry.set` yields a mutable reference to the inserted element to avoid code duplication where complex logic needs to be done *regardless* of whether the entry was vacant or not. * `OccupiedEntry.into_mut` was added so that it is possible to return a reference into the map beyond the lifetime of the Entry itself, providing functional parity to `VacantEntry.set`. This allows the full find_or_insert functionality to be implemented using this API. A PR will be submitted to the RFC to amend this. [breaking-change]
2014-09-24handling fallout from entry apiAlexis Beingessner-7/+9
2014-09-24Remove unused enum variantsJakub Wieczorek-8/+1
2014-09-24Use more descriptive names in dead code messagesJakub Wieczorek-0/+25
2014-09-24Fix rebase falloutSteven Fackler-14/+12
2014-09-23Deprecate `#[ignore(cfg(...))]`Steven Fackler-0/+6
Replace `#[ignore(cfg(a, b))]` with `#[cfg_attr(all(a, b), ignore)]`
2014-09-23Add a cfg_attr syntax extensionSteven Fackler-0/+62
This extends cfg-gating to attributes. ```rust #[cfg_attr(<cfg pattern>, <attr>)] ``` will expand to ```rust #[<attr>] ``` if the `<cfg pattern>` matches the current cfg environment, and nothing if it does not. The grammar for the cfg pattern has a simple recursive structure: * `value` and `key = "value"` are cfg patterns, * `not(<cfg pattern>)` is a cfg pattern and matches if `<cfg pattern>` does not. * `all(<cfg pattern>, ...)` is a cfg pattern and matches if all of the `<cfg pattern>`s do. * `any(<cfg pattern>, ...)` is a cfg pattern and matches if any of the `<cfg pattern>`s do. Examples: ```rust // only derive Show for assert_eq! in tests #[cfg_attr(test, deriving(Show))] struct Foo { ... } // only derive Show for assert_eq! in tests and debug builds #[cfg_attr(any(test, not(ndebug)), deriving(Show))] struct Foo { ... } // ignore a test in certain cases #[test] #[cfg_attr(all(not(target_os = "linux"), target_endian = "big"), ignore)] fn test_broken_thing() { ... } // Avoid duplication when fixing staging issues in rustc #[cfg_attr(not(stage0), lang="iter")] pub trait Iterator<T> { ... } ```
2014-09-23auto merge of #17402 : steveklabnik/rust/update_manual, r=brsonbors-1/+1
Because I'm still :mask: :mask: :mask: , I figured some mindless tasks would be better than trying to finish the ownership guide. The manual has long been waiting for some :heart: :heart: :heart: , and so I gave it a quick once-over. I made small commits in case any of the changes are a bit weird, I mostly did a few things: 1. changed 'manual' to 'reference.' I feel like this name is better. If it's not, It's not a huge deal. it shouldn't be `rust.md` though. 2. word wrapped everything appropriately. Changes 1&2 are in the first commit, so that its' easier to see the changes in the later ones. 3. fixed other small style issues 4. removed references to things that are in the standard library, and not the language itself There's still lots of gross in here, but I didn't want to pile on too too many changes. /cc @brson @nikomatsakis
2014-09-23auto merge of #17028 : pcwalton/rust/higher-rank-trait-lifetimes, r=pnkfelixbors-8/+53
They will ICE during typechecking if used, because they depend on trait reform. This is part of unboxed closures. r? @nikomatsakis
2014-09-22librustc: Parse and resolve higher-rank lifetimes in traits.Patrick Walton-8/+53
They will ICE during typechecking if used, because they depend on trait reform. This is part of unboxed closures.
2014-09-22librustc: Forbid private types in public APIs.Patrick Walton-0/+4
This breaks code like: struct Foo { ... } pub fn make_foo() -> Foo { ... } Change this code to: pub struct Foo { // note `pub` ... } pub fn make_foo() -> Foo { ... } The `visible_private_types` lint has been removed, since it is now an error to attempt to expose a private type in a public API. In its place a `#[feature(visible_private_types)]` gate has been added. Closes #16463. RFC #48. [breaking-change]
2014-09-22manual -> reference & formattingSteve Klabnik-1/+1
'reference' sounds better than 'manual' to me here, and rust.html is certainly wrong. I also wrapped everything to 80 cols.
2014-09-22auto merge of #17339 : treeman/rust/doc-things, r=alexcrichtonbors-156/+129
Also some cleanup to conform to documentation style.
2014-09-21auto merge of #17415 : jakub-/rust/issue-17383, r=huonwbors-5/+7
Fixes #17383.
2014-09-21Fix the span for discriminators in non-C-like enumsJakub Wieczorek-5/+7
Fixes #17383.
2014-09-20libsyntax: Explicit error message for sugared doc comments.Mike Boutin-11/+28
Display an explicit message about items missing after sugared doc comment attributes. References #2789.
2014-09-20auto merge of #17319 : kmcallister/rust/method-macro-bt, r=pcwaltonbors-1/+4
We were leaving these on the stack, causing spurious backtraces.
2014-09-19rollup merge of #17379 : pcwalton/keywords-followed-by-double-colonAlex Crichton-35/+48
2014-09-19rollup merge of #17338 : nick29581/variants-namespaceAlex Crichton-27/+28
2014-09-19rollup merge of #17318 : nick29581/sliceAlex Crichton-10/+131
2014-09-19rollup merge of #17314 : eddyb/span-no-gcAlex Crichton-123/+133
2014-09-19rollup merge of #17236 : fhahn/issue-16723-multiple-itemsAlex Crichton-20/+15
2014-09-19Allow syntax extensions to return multiple items, closes #16723.Florian Hahn-20/+15
This patch replaces `MacItem` with `MacItems`.
2014-09-19Add enum variants to the type namespaceNick Cameron-27/+28
Change to resolve and update compiler and libs for uses. [breaking-change] Enum variants are now in both the value and type namespaces. This means that if you have a variant with the same name as a type in scope in a module, you will get a name clash and thus an error. The solution is to either rename the type or the variant.
2014-09-18librustc: Implement the syntax in the RFC for unboxed closure sugar.Patrick Walton-81/+77
Part of issue #16640. I am leaving this issue open to handle parsing of higher-rank lifetimes in traits. This change breaks code that used unboxed closures: * Instead of `F:|&: int| -> int`, write `F:Fn(int) -> int`. * Instead of `F:|&mut: int| -> int`, write `F:FnMut(int) -> int`. * Instead of `F:|: int| -> int`, write `F:FnOnce(int) -> int`. [breaking-change]
2014-09-18libsyntax: Disallow keywords followed by `::`.Patrick Walton-35/+48
This breaks code that looked like: mymacro!(static::foo); ... where `mymacro!` expects a path or expression. Change such macros to not accept keywords followed by `::`. Closes #17298. [breaking-change]
2014-09-19Implement slicing syntax.Nick Cameron-10/+131
`expr[]`, `expr[expr..]`, `expr[..expr]`,`expr[expr..expr]` Uses the Slice and SliceMut traits. Allows ... as well as .. in range patterns.
2014-09-18Fix fallout in tests from removing the use of Gc in ExpnInfo.Eduard Burtescu-10/+10
2014-09-18syntax: use an index in CodeMap instead of Gc for ExpnInfo.Eduard Burtescu-113/+123
2014-09-17librustc: Implement associated types behind a feature gate.Patrick Walton-155/+530
The implementation essentially desugars during type collection and AST type conversion time into the parameter scheme we have now. Only fully qualified names--e.g. `<T as Foo>::Bar`--are supported.
2014-09-17auto merge of #17343 : alexcrichton/rust/rollup, r=alexcrichtonbors-34/+31
2014-09-17Pop the expansion context after expanding a method macroKeegan McAllister-1/+4
We were leaving these on the stack, causing spurious backtraces. I've confirmed that this test fails without the fix.
2014-09-17auto merge of #16836 : P1start/rust/closure_ret_bang, r=alexcrichtonbors-10/+10
Fixes #13490.
2014-09-17rollup merge of #17290 : bkoropoff/issue-17283Alex Crichton-34/+31
2014-09-17doc: Remove "see above".Jonas Hietala-4/+3
2014-09-17doc: Backticks and spelling mistakes.Jonas Hietala-13/+13
2014-09-17doc: Cleanup.Jonas Hietala-149/+123
Remove ~~~ for code block specification. Use /// Over /** */ for doc blocks.
2014-09-17rebasing fixesNick Cameron-6/+4
2014-09-17move feature_gate to libsyntaxNick Cameron-0/+462
2014-09-17move std_inject to libsyntaxNick Cameron-0/+236
2014-09-17move most of front to libsyntaxNick Cameron-0/+889
2014-09-16Propagate restrictions against struct literals to the RHS of assignmentsBrian Koropoff-2/+3
This prevents confusing errors when accidentally using an assignment in an `if` expression. For example: ```rust fn main() { let x = 1u; if x = x { println!("{}", x); } } ``` Previously, this yielded: ``` test.rs:4:16: 4:17 error: expected `:`, found `!` test.rs:4 println!("{}", x); ^ ``` With this change, it now yields: ``` test.rs:3:8: 3:13 error: mismatched types: expected `bool`, found `()` (expected bool, found ()) test.rs:3 if x = x { ^~~~~ ``` Closes issue #17283
2014-09-16Convert restriction enum into bitflagsBrian Koropoff-32/+28
This makes having multiple restrictions at once cleaner. Also drop NO_DOUBLEBAR restriction since it is never used.
2014-09-17auto merge of #17223 : retep998/rust/into_string, r=huonwbors-42/+42
Replaces some usage of `.to_string()` with `.into_string()`
2014-09-16Fallout from renamingAaron Turon-74/+80
2014-09-16auto merge of #17280 : thestinger/rust/heap, r=pcwaltonbors-2/+2
2014-09-15auto merge of #17221 : bkoropoff/rust/strinterner-unsafe, r=sfacklerbors-11/+0
The `StrInterner::clear()` method takes self immutably but can invalidate references returned by `StrInterner::get_ref`. Since `get_ref` is unused, just remove it. Closes #17181
2014-09-15heap: optimize EMPTY to avoid relocationsDaniel Micay-2/+2
Sized deallocation makes it pointless to provide an address that never overlaps with pointers returned by an allocator. Code can branch on the capacity of the allocation instead of a comparison with this sentinel. This improves the situation in #8859, and the remaining issues are only from the logging API, which should be disabled by default in optimized release builds anyway along with debug assertions. The remaining issues are part of #17081. Closes #8859