summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2014-11-26/*! -> //!Steve Klabnik-64/+31
Sister pull request of https://github.com/rust-lang/rust/pull/19288, but for the other style of block doc comment.
2014-11-26Test fixes and rebase conflictsAlex Crichton-6/+6
2014-11-26rollup merge of #19326: huonw/safer-syntaxAlex Crichton-89/+17
This makes it correct (e.g. avoiding null pointers) and safe.
2014-11-26rollup merge of #19298: nikomatsakis/unboxed-closure-parse-the-plusAlex Crichton-166/+146
Implements RFC 438. Fixes #19092. This is a [breaking-change]: change types like `&Foo+Send` or `&'a mut Foo+'a` to `&(Foo+Send)` and `&'a mut (Foo+'a)`, respectively. r? @brson
2014-11-26rollup merge of #19288: steveklabnik/doc_style_cleanupAlex Crichton-23/+15
This is considered good convention. This is about half of them in total, I just don't want an impossible to land patch. :smile:
2014-11-26Remove special casing for some meta attributesSteven Fackler-1/+0
Descriptions and licenses are handled by Cargo now, so there's no reason to keep these attributes around.
2014-11-26auto merge of #19176 : aturon/rust/stab-iter, r=alexcrichtonbors-6/+5
This is an initial pass at stabilizing the `iter` module. The module is fairly large, but is also pretty polished, so most of the stabilization leaves things as they are. Some changes: * Due to the new object safety rules, various traits needs to be split into object-safe traits and extension traits. This includes `Iterator` itself. While splitting up the traits adds some complexity, it will also increase flexbility: once we have automatic impls of `Trait` for trait objects over `Trait`, then things like the iterator adapters will all work with trait objects. * Iterator adapters that use up the entire iterator now take it by value, which makes the semantics more clear and helps catch bugs. Due to the splitting of Iterator, this does not affect trait objects. If the underlying iterator is still desired for some reason, `by_ref` can be used. (Note: this change had no fallout in the Rust distro except for the useless mut lint.) * In general, extension traits new and old are following an [in-progress convention](rust-lang/rfcs#445). As such, they are marked `unstable`. * As usual, anything involving closures is `unstable` pending unboxed closures. * A few of the more esoteric/underdeveloped iterator forms (like `RandomAccessIterator` and `MutableDoubleEndedIterator`, along with various unfolds) are left experimental for now. * The `order` submodule is left `experimental` because it will hopefully be replaced by generalized comparison traits. * "Leaf" iterators (like `Repeat` and `Counter`) are uniformly constructed by free fns at the module level. That's because the types are not otherwise of any significance (if we had `impl Trait`, you wouldn't want to define a type at all). Closes #17701 Due to renamings and splitting of traits, this is a: [breaking-change]
2014-11-26Rote changes due to the fact that ast paths no longer carry this extraneous ↵Niko Matsakis-48/+40
bounds.
2014-11-26Fixup various places that were doing `&T+'a` and do `&(T+'a)`Niko Matsakis-1/+1
2014-11-26Implement the new parsing rules for types in the parser, modifying the AST ↵Niko Matsakis-117/+105
appropriately.
2014-11-26auto merge of #19262 : murarth/rust/module-path-fix, r=jakub-bors-2/+9
Closes #18859
2014-11-26auto merge of #19252 : japaric/rust/cow, r=aturonbors-6/+6
- Add `IntoCow` trait, and put it in the prelude - Add `is_owned`/`is_borrowed` methods to `Cow` - Add `CowString`/`CowVec` type aliases (to `Cow<'_, String, str>`/`Cow<'_, Vec, [T]>` respectively) - `Cow` implements: `Show`, `Hash`, `[Partial]{Eq,Ord}` - `impl BorrowFrom<Cow<'a, T, B>> for B` [breaking-change]s: - `IntoMaybeOwned` has been removed from the prelude - libcollections: `SendStr` is now an alias to `CowString<'static>` (it was aliased to `MaybeOwned<'static>`) - libgraphviz: - `LabelText` variants now wrap `CowString` instead of `MaybeOwned` - `Nodes` and `Edges` are now type aliases to `CowVec` (they were aliased to `MaybeOwnedVec`) - libstd/path: `Display::as_maybe_owned` has been renamed to `Display::as_cow` and now returns a `CowString` - These functions now accept/return `Cow` instead of `MaybeOwned[Vector]`: - libregex: `Replacer::reg_replace` - libcollections: `str::from_utf8_lossy` - libgraphviz: `Id::new`, `Id::name`, `LabelText::pre_escaped_content` - libstd: `TaskBuilder::named` r? @aturon
2014-11-25/** -> ///Steve Klabnik-23/+15
This is considered good convention.
2014-11-25Fallout from stabilizationAaron Turon-6/+5
2014-11-26Make syntax::owned_slice a Box<[T]> wrapper.Huon Wilson-89/+17
This makes it correct (e.g. avoiding null pointers) and safe.
2014-11-25Deprecate MaybeOwned[Vector] in favor of CowJorge Aparicio-6/+6
2014-11-24Fixed "::::" appearing in module_path!()Murarth-2/+9
2014-11-24Add `node_to_user_string`, `node_to_string` variant that drops id from output.Felix S. Klock II-26/+33
2014-11-23std: Add a new top-level thread_local moduleAlex Crichton-59/+34
This commit removes the `std::local_data` module in favor of a new `std::thread_local` module providing thread local storage. The module provides two variants of TLS: one which owns its contents and one which is based on scoped references. Each implementation has pros and cons listed in the documentation. Both flavors have accessors through a function called `with` which yield a reference to a closure provided. Both flavors also panic if a reference cannot be yielded and provide a function to test whether an access would panic or not. This is an implementation of [RFC 461][rfc] and full details can be found in that RFC. This is a breaking change due to the removal of the `std::local_data` module. All users can migrate to the new thread local system like so: thread_local!(static FOO: Rc<RefCell<Option<T>>> = Rc::new(RefCell::new(None))) The old `local_data` module inherently contained the `Rc<RefCell<Option<T>>>` as an implementation detail which must now be explicitly stated by users. [rfc]: https://github.com/rust-lang/rfcs/pull/461 [breaking-change]
2014-11-23rollup merge of #19215: aochagavia/prettyJakub Bukaj-21/+16
Closes https://github.com/rust-lang/rust/issues/19077 I would appreciate any guidance on how to write a test for this. I saw some examples in `test/pretty`, but there are different ways to test... With or without `.pp` files, with a `pp-exact` comment, etc.
2014-11-23rollup merge of #19211: aochagavia/tuple-indexJakub Bukaj-66/+30
This breaks code like ``` let t = (42i, 42i); ... t.0::<int> ...; ``` Change this code to not contain an unused type parameter. For example: ``` let t = (42i, 42i); ... t.0 ...; ``` Closes https://github.com/rust-lang/rust/issues/19096 [breaking-change] r? @aturon
2014-11-23auto merge of #19158 : jakub-/rust/issue-14091, r=alexcrichtonbors-33/+45
Closes #14091. Closes #19195.
2014-11-23Remove type parameters from ExprField and ExprTupFieldAdolfo Ochagavía-51/+23
2014-11-23libsyntax: Forbid type parameters in tuple indicesAdolfo Ochagavía-16/+8
This breaks code like ``` let t = (42i, 42i); ... t.0::<int> ...; ``` Change this code to not contain an unused type parameter. For example: ``` let t = (42i, 42i); ... t.0 ...; ``` Closes https://github.com/rust-lang/rust/issues/19096 [breaking-change]
2014-11-22Fix pretty printing unsafe match armsAdolfo Ochagavía-21/+16
2014-11-22auto merge of #19132 : sinistersnare/rust/patch-1, r=alexcrichtonbors-2/+2
Just used Githubs edit view, so I hope this works...
2014-11-22auto merge of #19122 : Kintaro/rust/remove_struct_variant, r=jakub-bors-1/+1
The struct_variant is not gated anymore. This commit just removes it and the resulting warnings when compiling rust. Now compiles with the snapshot from 11/18 (as opposed to PR #19014)
2014-11-21unicode: Rename is_XID_start to is_xid_start, is_XID_continue to is_xid_continueBrian Anderson-3/+3
2014-11-21unicode: Add stability attributes to u_charBrian Anderson-2/+2
Free functions deprecated. UnicodeChar experimental pending final decisions about prelude.
2014-11-21core: Convert Char::escape_default, escape_unicode to iteratorsBrian Anderson-3/+5
[breaking-change]
2014-11-21Fix various deprecation warnings from char changesBrian Anderson-3/+3
2014-11-20Remove libnativeAaron Turon-28/+3
With runtime removal complete, there's nothing left of libnative. This commit removes it. Fixes #18687 [breaking-change]
2014-11-20Fix an ICE on diagnostics originating in external macrosJakub Bukaj-33/+45
2014-11-20auto merge of #19071 : huonw/rust/col2column, r=nikomatsakisbors-5/+5
This macro is very rarely used, so there is no need (and it is better) for it to avoid the abbreviation. Closes rust-lang/rfcs#467.
2014-11-20auto merge of #19113 : nikomatsakis/rust/unboxed-boxed-closure-unification, ↵bors-88/+27
r=acrichto Use the expected type to infer the argument/return types of unboxed closures. Also, in `||` expressions, use the expected type to decide if the result should be a boxed or unboxed closure (and if an unboxed closure, what kind). This supercedes PR #19089, which was already reviewed by @pcwalton.
2014-11-20Rename `col!` to `column!`.Huon Wilson-5/+5
This macro is very rarely used, so there is no need (and it is better) for it to avoid the abbreviation. Closes rust-lang/rfcs#467. [breaking-change]
2014-11-20fixed markdown rendering a H1 in commentDavis Silverman-2/+2
2014-11-20removed usage of struct_variant feature as it is no longer gatedSimon Wollwage-1/+1
2014-11-19Fixes to the roll-upJakub Bukaj-1/+1
2014-11-19rollup merge of #19103: huonw/literal-suffixesJakub Bukaj-250/+329
Futureproof Rust for fancier suffixed literals. The Rust compiler tokenises a literal followed immediately (no whitespace) by an identifier as a single token: (for example) the text sequences `"foo"bar`, `1baz` and `1u1024` are now a single token rather than the pairs `"foo"` `bar`, `1` `baz` and `1u` `1024` respectively. The compiler rejects all such suffixes in the parser, except for the 12 numeric suffixes we have now. I'm fairly sure this will affect very few programs, since it's not currently legal to have `<literal><identifier>` in a Rust program, except in a macro invocation. Any macro invocation relying on this behaviour can simply separate the two tokens with whitespace: `foo!("bar"baz)` becomes `foo!("bar" baz)`. This implements [RFC 463](https://github.com/rust-lang/rfcs/blob/master/text/0463-future-proof-literal-suffixes.md), and so closes https://github.com/rust-lang/rust/issues/19088.
2014-11-19rollup merge of #19090: kmcallister/deriving-non-typeJakub Bukaj-2/+5
Besides being more helpful, this gives us the flexibility to later define a meaning for something like ```rust #[deriving(...)] mod bar { ... } ```
2014-11-19rollup merge of #19073: jakub-/issue-19069Jakub Bukaj-11/+23
Fixes #19069. These were never intended not to be feature-gated but this PR is nonetheless a... [breaking-change]
2014-11-19rollup merge of #19040: alexcrichton/issue-18904Jakub Bukaj-26/+5
This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc]. There are a number of breaking changes as a part of this commit which will need to be handled to migrated old code: * A number of formatting traits have been removed: String, Bool, Char, Unsigned, Signed, and Float. It is recommended to instead use Show wherever possible or to use adaptor structs to implement other methods of formatting. * The format specifier for Boolean has changed from `t` to `b`. * The enum `FormatError` has been renamed to `Error` as well as becoming a unit struct instead of an enum. The `WriteError` variant no longer exists. * The `format_args_method!` macro has been removed with no replacement. Alter code to use the `format_args!` macro instead. * The public fields of a `Formatter` have become read-only with no replacement. Use a new formatting string to alter the formatting flags in combination with the `write!` macro. The fields can be accessed through accessor methods on the `Formatter` structure. Other than these breaking changes, the contents of std::fmt should now also all contain stability markers. Most of them are still #[unstable] or #[experimental] [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md [breaking-change] Closes #18904
2014-11-19Merge the ExprFnBlock and ExprUnboxedClosure into one ExprClosure with an ↵Niko Matsakis-88/+27
optional unboxed closure kind.
2014-11-20Switch numeric suffix parsing to use the new system.Huon Wilson-145/+99
This moves errors and all handling of numeric suffixes into the parser rather than the lexer.
2014-11-20Parse and store suffixes on literals.Huon Wilson-90/+221
This adds an optional suffix at the end of a literal token: `"foo"bar`. An actual use of a suffix in a expression (or other literal that the compiler reads) is rejected in the parser. This doesn't switch the handling of numbers to this system, and doesn't outlaw illegal suffixes for them yet.
2014-11-19Refactor QPath to take an ast::TraitRefNiko Matsakis-18/+28
2014-11-18std: Stabilize std::fmtAlex Crichton-26/+5
This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc]. There are a number of breaking changes as a part of this commit which will need to be handled to migrated old code: * A number of formatting traits have been removed: String, Bool, Char, Unsigned, Signed, and Float. It is recommended to instead use Show wherever possible or to use adaptor structs to implement other methods of formatting. * The format specifier for Boolean has changed from `t` to `b`. * The enum `FormatError` has been renamed to `Error` as well as becoming a unit struct instead of an enum. The `WriteError` variant no longer exists. * The `format_args_method!` macro has been removed with no replacement. Alter code to use the `format_args!` macro instead. * The public fields of a `Formatter` have become read-only with no replacement. Use a new formatting string to alter the formatting flags in combination with the `write!` macro. The fields can be accessed through accessor methods on the `Formatter` structure. Other than these breaking changes, the contents of std::fmt should now also all contain stability markers. Most of them are still #[unstable] or #[experimental] [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md [breaking-change] Closes #18904
2014-11-19Switch to an independent enum for `Lit*` subtokens.Huon Wilson-91/+85
2014-11-18auto merge of #19044 : murarth/rust/libsyntax-view-item, r=alexcrichtonbors-1/+41
Allows parsing view items (`use` and `extern crate`) individually. Does not change behavior of any existing functions. Closes #19024