about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
AgeCommit message (Collapse)AuthorLines
2015-03-19Rollup merge of #23475 - nikomatsakis:closure-ret-syntax, r=acrichtoManish Goregaokar-14/+22
Require braces when a closure has an explicit return type. This is a [breaking-change]: instead of a closure like `|| -> i32 22`, prefer `|| -> i32 { 22 }`. Fixes #23420.
2015-03-18Require braces when a closure has an explicit return type. This is aNiko Matsakis-14/+22
[breaking-change]: instead of a closure like `|| -> i32 22`, prefer `|| -> i32 { 22 }`. Fixes #23420.
2015-03-18Register new snapshotsAlex Crichton-8/+0
2015-03-16impl f{32,64}Jorge Aparicio-0/+1
2015-03-16Auto merge of #23331 - eddyb:attr-lookahead, r=nikomatsakisbors-439/+272
Most of the changes are cleanup facilitated by straight-forward attribute handling. This is a minor [breaking-change] for users of `quote_stmt!` (returns `Option<P<Stmt>>` now) and some of the public methods in `Parser` (a few `Vec<Attribute>` arguments/returns were removed). r? @nikomatsakis
2015-03-13Deprecate range, range_step, count, distributionsAaron Turon-2/+1
This commit deprecates the `count`, `range` and `range_step` functions in `iter`, in favor of range notation. To recover all existing functionality, a new `step_by` adapter is provided directly on `ops::Range` and `ops::RangeFrom`. [breaking-change]
2015-03-13syntax: use lookahead to distinguish inner and outer attributes, instead of ↵Eduard Burtescu-439/+272
passing the latter around.
2015-03-13Auto merge of #23229 - aturon:stab-path, r=alexcrichtonbors-7/+1
This commit stabilizes essentially all of the new `std::path` API. The API itself is changed in a couple of ways (which brings it in closer alignment with the RFC): * `.` components are now normalized away, unless they appear at the start of a path. This in turn effects the semantics of e.g. asking for the file name of `foo/` or `foo/.`, both of which yield `Some("foo")` now. This semantics is what the original RFC specified, and is also desirable given early experience rolling out the new API. * The `parent` method is now `without_file` and succeeds if, and only if, `file_name` is `Some(_)`. That means, in particular, that it fails for a path like `foo/../`. This change affects `pop` as well. In addition, the `old_path` module is now deprecated. [breaking-change] r? @alexcrichton
2015-03-12Stabilize std::pathAaron Turon-7/+1
This commit stabilizes essentially all of the new `std::path` API. The API itself is changed in a couple of ways (which brings it in closer alignment with the RFC): * `.` components are now normalized away, unless they appear at the start of a path. This in turn effects the semantics of e.g. asking for the file name of `foo/` or `foo/.`, both of which yield `Some("foo")` now. This semantics is what the original RFC specified, and is also desirable given early experience rolling out the new API. * The `parent` function now succeeds if, and only if, the path has at least one non-root/prefix component. This change affects `pop` as well. * The `Prefix` component now involves a separate `PrefixComponent` struct, to better allow for keeping both parsed and unparsed prefix data. In addition, the `old_path` module is now deprecated. Closes #23264 [breaking-change]
2015-03-12Auto merge of #23265 - eddyb:meth-ast-refactor, r=nikomatsakisbors-82/+73
The end result is that common fields (id, name, attributes, etc.) are stored in now-structures `ImplItem` and `TraitItem`. The signature of a method is no longer duplicated between methods with a body (default/impl) and those without, they now share `MethodSig`. This is also a [breaking-change] because of minor bugfixes and changes to syntax extensions: * `pub fn` methods in a trait no longer parse - remove the `pub`, it has no meaning anymore * `MacResult::make_methods` is now `make_impl_items` and the return type has changed accordingly * `quote_method` is gone, because `P<ast::Method>` doesn't exist and it couldn't represent a full method anyways - could be replaced by `quote_impl_item`/`quote_trait_item` in the future, but I do hope we realize how silly that combinatorial macro expansion is and settle on a single `quote` macro + some type hints - or just no types at all (only token-trees) r? @nikomatsakis This is necessary (hopefully also sufficient) for associated constants.
2015-03-12Rollup merge of #23297 - steveklabnik:examples, r=huonwManish Goregaokar-1/+1
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-11Example -> ExamplesSteve Klabnik-1/+1
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-11syntax: move MethMac to MacImplItem and combine {Provided,Required}Method ↵Eduard Burtescu-14/+17
into MethodTraitItem.
2015-03-11syntax: rename TypeMethod to MethodSig and use it in MethDecl.Eduard Burtescu-22/+17
2015-03-11syntax: gather common fields of impl & trait items into their respective types.Eduard Burtescu-64/+57
2015-03-11syntax: move indirection around {Trait,Impl}Item, from within.Eduard Burtescu-13/+13
2015-03-11Remove ProcType and ProcExpGuillaume Gomez-29/+0
2015-03-10Remove proc keywordGuillaume Gomez-28/+1
2015-03-05Rollup merge of #22764 - ivanradanov:fileline_help, r=huonwManish Goregaokar-6/+9
When warnings and errors occur, the associated help message should not print the same code snippet. https://github.com/rust-lang/rust/issues/21938
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-9/+19
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-03-03Change span_help calls to fileline_help where appropriateIvan Radanov Ivanov-6/+9
2015-02-28Auto merge of #21521 - defuz:interval-with-path, r=pnkfelixbors-0/+13
Fixing #21475. Right now this code can not be parsed: ```rust use m::{START, END}; fn main() { match 42u32 { m::START...m::END => {}, // error: expected one of `::`, `=>`, or `|`, found `...` _ => {}, } } mod m { pub const START: u32 = 4; pub const END: u32 = 14; } ``` I fixed the parser and added test for this case, but now there are still problems with mixing literals and paths in interval: ```rust match 42u32 { 0u32...m::END => {}, // mismatched types in range [E0031] m::START...59u32 => {}, // mismatched types in range [E0031] _ => {}, } } ``` I'll try fix this problem and need review.
2015-02-28FIX #21475: Expr_::ExprPath with two fieldsdefuz-2/+2
2015-02-28FIX #21475: Interval match patterns won't parse namespace specifiers correctlydefuz-0/+13
2015-02-27obsolete `|&:|` syntaxJorge Aparicio-1/+0
closes #22881
2015-02-24Implement `<T>::method` UFCS expression syntax.Eduard Burtescu-16/+54
2015-02-24syntax: use a single Path for Trait::Item in QPath.Eduard Burtescu-19/+13
2015-02-24syntax: don't use TraitRef in QPath.Eduard Burtescu-4/+4
2015-02-24syntax: don't store a secondary NodeId for TyPath.Eduard Burtescu-4/+3
2015-02-24Auto merge of #21689 - FlaPer87:oibit-send-and-friends, r=nikomatsakisbors-14/+27
This is one more step towards completing #13231 This series of commits add support for default trait implementations. The changes in this PR don't break existing code and they are expected to preserve the existing behavior in the compiler as far as built-in bounds checks go. The PR adds negative implementations of `Send`/`Sync` for some types and it removes the special cases for `Send`/`Sync` during the trait obligations checks. That is, it now fully relies on the traits check rather than lang items. Once this patch lands and a new snapshot is created, it'll be possible to add default impls for `Send` and `Sync` and remove entirely the use of `BuiltinBound::{BoundSend,BoundSync}` for positive implementations as well. This PR also removes the restriction on negative implementations. That is, it is now possible to add negative implementations for traits other than `Send`/`Sync`
2015-02-23Rollup merge of #22544 - bombless:fix-pattern, r=pnkfelixManish Goregaokar-0/+3
2015-02-22Auto merge of #22466 - Kimundi:str_pattern_ai_safe, r=aturonbors-1/+1
This is not a complete implementation of the RFC: - only existing methods got updated, no new ones added - doc comments are not extensive enough yet - optimizations got lost and need to be reimplemented See https://github.com/rust-lang/rfcs/pull/528 Technically a [breaking-change]
2015-02-22Rename DefTrait to DefaultImplFlavio Percoco-2/+2
2015-02-22Add support for default trait impls in libsyntaxFlavio Percoco-14/+27
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-1/+1
where possible.
2015-02-20make span on obsolete syntax very preciseNiko Matsakis-1/+2
2015-02-20Addressed PR commentsMarvin Löbel-1/+1
2015-02-19Fix issue #22426 #22447bombless-0/+3
2015-02-18Round 3 test fixes and conflictsAlex Crichton-23/+23
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-46/+44
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-40/+40
2015-02-18Declare `&foo[]` to be obsolete syntax. Modify the obsolete mechanism toNiko Matsakis-5/+4
support warnings.
2015-02-18Remove usage of .map(|&foo| foo)Kevin Butler-1/+1
2015-02-18Opt for .cloned() over .map(|x| x.clone()) etc.Kevin Butler-5/+4
2015-02-15Rollup merge of #22285 - kmcallister:pub-macro, r=nick29581Manish Goregaokar-0/+18
It's not clear what this means, because a macro in item position can expand to zero or more items. For now we disallow it, which is technically a [breaking-change] but is landing without an RFC. The `pub` keyword previously had no effect, which seems quite unintended. Fixes #18317. Fixes #14660.
2015-02-13Forbid `pub mymacro!();`Keegan McAllister-0/+18
It's not clear what this means, because a macro in item position can expand to zero or more items. For now we disallow it, which is technically a [breaking-change] but is landing without an RFC. The `pub` keyword previously had no effect, which seems quite unintended. Fixes #18317. Fixes #14660.
2015-02-12Made `Self` a keyword.Marvin Löbel-22/+51
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes #22137
2015-02-09Accept quantification of lifetimes outside the self type in where clauses.Nick Cameron-5/+28
Closes #20022
2015-02-06Libsyntax has been updatedGuillaumeGomez-4/+3
2015-02-06Replace the get method by the deref one on InternedStringGuillaumeGomez-3/+4