about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2015-01-20std: Rename Show/String to Debug/DisplayAlex Crichton-9/+9
This commit is an implementation of [RFC 565][rfc] which is a stabilization of the `std::fmt` module and the implementations of various formatting traits. Specifically, the following changes were performed: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md * The `Show` trait is now deprecated, it was renamed to `Debug` * The `String` trait is now deprecated, it was renamed to `Display` * Many `Debug` and `Display` implementations were audited in accordance with the RFC and audited implementations now have the `#[stable]` attribute * Integers and floats no longer print a suffix * Smart pointers no longer print details that they are a smart pointer * Paths with `Debug` are now quoted and escape characters * The `unwrap` methods on `Result` now require `Display` instead of `Debug` * The `Error` trait no longer has a `detail` method and now requires that `Display` must be implemented. With the loss of `String`, this has moved into libcore. * `impl<E: Error> FromError<E> for Box<Error>` now exists * `derive(Show)` has been renamed to `derive(Debug)`. This is not currently warned about due to warnings being emitted on stage1+ While backwards compatibility is attempted to be maintained with a blanket implementation of `Display` for the old `String` trait (and the same for `Show`/`Debug`) this is still a breaking change due to primitives no longer implementing `String` as well as modifications such as `unwrap` and the `Error` trait. Most code is fairly straightforward to update with a rename or tweaks of method calls. [breaking-change] Closes #21436
2015-01-20Test fixes and rebase conflictsAlex Crichton-3/+1
2015-01-21Rollup merge of #21336 - rylev:better-nofile-error, r=brsonBarosl LEE-2/+3
Contribution from @look! Addresses https://github.com/rust-lang/rust/issues/21329
2015-01-20Fix up some ‘help’ messagesP1start-1/+1
2015-01-19Auto merge of #21278 - thchittenden:issue-21033-struct-var-pattern-fix, ↵bors-25/+34
r=alexcrichton Closes #21033. The new strategy for parsing a field pattern is to look 1 token ahead and if it's a colon, parse as "fieldname: pat", otherwise parse the shorthand form "(box) (ref) (mut) fieldname)". The previous strategy was to parse "(ref) (mut) fieldname" then if we encounter a colon, throw an error if either "ref" or "mut" were encountered.
2015-01-19remove unnecessary parentheses from range notationJorge Aparicio-2/+2
2015-01-19Fixes #21033 with accompanying test.Tom Chittenden-25/+34
2015-01-19Auto merge of #21099 - sanxiyn:opt-return-ty, r=alexcrichtonbors-27/+6
This avoids having ast::Ty nodes which have no counterpart in the source.
2015-01-18libsyntax: 0u -> 0us, 0i -> 0isPaul Collier-35/+35
2015-01-18libsyntax: int types -> isizePaul Collier-7/+7
2015-01-18libsyntax: int => i32 in appropriate placesPaul Collier-10/+10
2015-01-18Make output type in ast::FnDecl optionalSeo Sanghyeon-27/+6
2015-01-18auto merge of #20901 : dgrunwald/rust/update-token-can-begin-expr, r=sanxiynbors-11/+5
* add `Token::AndAnd` (double borrow) * add `Token::DotDot` (range notation) * remove `Token::Pound` and `Token::At` This fixes a syntax error when parsing `fn f() -> RangeTo<i32> { return ..1; }`. Also, remove `fn_expr_lookahead`. It's from the `fn~` days and seems to no longer be necessary.
2015-01-17libsyntax: rename functions from uint to usizePaul Collier-12/+12
2015-01-18Improve the error message when source file cannot be readRyan Levick-2/+3
Contribution from @look!
2015-01-17libsyntax: uint types to usizePaul Collier-37/+37
2015-01-15Test fixes and rebase conflictsAlex Crichton-1/+1
2015-01-15rollup merge of #21088: aochagavia/obsoleteAlex Crichton-168/+4
Only the most recent changes (since November 2014) get a special error. Fixes #20599
2015-01-15syntax: parse fully qualified UFCS expressions.Eduard Burtescu-7/+37
2015-01-14Remove old obsolete syntax errorsAdolfo Ochagavía-168/+4
2015-01-11Update Token::can_begin_expr() to make it consistent with the grammar:Daniel Grunwald-11/+5
* add Token::AndAnd (double borrow) * add Token::DotDot (range notation) * remove Token::Pound and Token::At Fixes a syntax error when parsing "fn f() -> RangeTo<i32> { return ..1; }". Also, remove "fn_expr_lookahead". It's from the fn~ days and seems to no longer be necessary.
2015-01-08Forbid trailing attributes in impl blocksSteven Fackler-2/+6
Closes #20711
2015-01-08Store deprecated status of i/u-suffixed literals.Huon Wilson-4/+4
2015-01-07rollup merge of #20720: nick29581/assoc-ice-missingAlex Crichton-18/+20
2015-01-08Remove String impls and fix for make tidyNick Cameron-3/+0
2015-01-07rollup merge of #20721: japaric/snapAlex Crichton-161/+160
Conflicts: src/libcollections/vec.rs src/libcore/fmt/mod.rs src/librustc/lint/builtin.rs src/librustc/session/config.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/context.rs src/librustc_trans/trans/type_.rs src/librustc_typeck/check/_match.rs src/librustdoc/html/format.rs src/libsyntax/std_inject.rs src/libsyntax/util/interner.rs src/test/compile-fail/mut-pattern-mismatched.rs
2015-01-07rollup merge of #20726: dgrunwald/require-parens-for-chained-comparisonAlex Crichton-1/+23
[Rendered RFC](https://github.com/rust-lang/rfcs/blob/master/text/0558-require-parentheses-for-chained-comparisons.md)
2015-01-08RFC 558: Require parentheses for chained comparisonsDaniel Grunwald-1/+23
Fixes #20724.
2015-01-07use slicing sugarJorge Aparicio-161/+160
2015-01-08Fix precedence for ranges.Nick Cameron-18/+23
Technically this is a [breaking-change] but it probably shouldn't affect your code. Closes #20256
2015-01-07Merge pull request #20674 from jbcrail/fix-misspelled-commentsbors-4/+4
Fix misspelled comments. Reviewed-by: steveklabnik
2015-01-06More test fixesAlex Crichton-4/+4
2015-01-06Fix misspelled comments.Joseph Crail-4/+4
I cleaned up comments prior to the 1.0 alpha release.
2015-01-06Test fixes and rebase conflictsAlex Crichton-2/+2
2015-01-06rollup merge of #20563: cmr/macro-input-future-proofingAlex Crichton-0/+1
2015-01-06rollup merge of #19430: pczarn/interp_tt-cleanupAlex Crichton-57/+87
Conflicts: src/libsyntax/parse/parser.rs
2015-01-07Cleanup and followup to PR #17830: parsing changesPiotr Czarnecki-57/+87
Prevents breaking down `$name` tokens into separate `$` and `name`. Reports unknown macro variables. Fixes #18775 Fixes #18839 Fixes #15640
2015-01-06Register new snapshotsAlex Crichton-19/+1
Conflicts: src/librbml/lib.rs src/libserialize/json_stage0.rs src/libserialize/serialize_stage0.rs src/libsyntax/ast.rs src/libsyntax/ext/deriving/generic/mod.rs src/libsyntax/parse/token.rs
2015-01-06rollup merge of #20481: seanmonstar/fmt-show-stringAlex Crichton-26/+32
Conflicts: src/compiletest/runtest.rs src/libcore/fmt/mod.rs src/libfmt_macros/lib.rs src/libregex/parse.rs src/librustc/middle/cfg/construct.rs src/librustc/middle/dataflow.rs src/librustc/middle/infer/higher_ranked/mod.rs src/librustc/middle/ty.rs src/librustc_back/archive.rs src/librustc_borrowck/borrowck/fragments.rs src/librustc_borrowck/borrowck/gather_loans/mod.rs src/librustc_resolve/lib.rs src/librustc_trans/back/link.rs src/librustc_trans/save/mod.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/callee.rs src/librustc_trans/trans/common.rs src/librustc_trans/trans/consts.rs src/librustc_trans/trans/controlflow.rs src/librustc_trans/trans/debuginfo.rs src/librustc_trans/trans/expr.rs src/librustc_trans/trans/monomorphize.rs src/librustc_typeck/astconv.rs src/librustc_typeck/check/method/mod.rs src/librustc_typeck/check/mod.rs src/librustc_typeck/check/regionck.rs src/librustc_typeck/collect.rs src/libsyntax/ext/format.rs src/libsyntax/ext/source_util.rs src/libsyntax/ext/tt/transcribe.rs src/libsyntax/parse/mod.rs src/libsyntax/parse/token.rs src/test/run-pass/issue-8898.rs
2015-01-06rollup merge of #20609: cmr/memAlex Crichton-2/+4
2015-01-07falloutNick Cameron-17/+32
2015-01-06core: split into fmt::Show and fmt::StringSean McArthur-26/+32
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2015-01-07Remove old slicing hacks and make new slicing workNick Cameron-144/+69
2015-01-07Replace full slice notation with index callsNick Cameron-130/+130
2015-01-06syntax/rustc: implement isize/usizeCorey Richardson-2/+4
2015-01-06syntax: implement 'macro input future proofing'Corey Richardson-0/+1
See RFC 550 (https://github.com/rust-lang/rfcs/pull/550) for the motivation and details. If this breaks your code, add one of the listed tokens after the relevant non-terminal in your matcher. [breaking-change]
2015-01-05More test fixes!Alex Crichton-9/+3
2015-01-05rollup merge of #20482: kmcallister/macro-reformAlex Crichton-8/+51
Conflicts: src/libflate/lib.rs src/libstd/lib.rs src/libstd/macros.rs src/libsyntax/feature_gate.rs src/libsyntax/parse/parser.rs src/libsyntax/show_span.rs src/test/auxiliary/macro_crate_test.rs src/test/compile-fail/lint-stability.rs src/test/run-pass/intrinsics-math.rs src/test/run-pass/tcp-connect-timeouts.rs
2015-01-05Merge remote-tracking branch 'nrc/sized-2' into rollupAlex Crichton-41/+47
Conflicts: src/liballoc/boxed.rs src/libcollections/btree/map.rs src/libcollections/slice.rs src/libcore/borrow.rs src/libcore/cmp.rs src/libcore/ops.rs src/libstd/c_str.rs src/libstd/collections/hash/map.rs src/libsyntax/parse/obsolete.rs src/test/compile-fail/unboxed-closure-sugar-default.rs src/test/compile-fail/unboxed-closure-sugar-equiv.rs src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs src/test/compile-fail/unboxed-closure-sugar-region.rs src/test/compile-fail/unsized3.rs src/test/run-pass/associated-types-conditional-dispatch.rs
2015-01-05rollup merge of #20556: japaric/no-for-sizedAlex Crichton-2/+12
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/libcore/borrow.rs src/libcore/cmp.rs src/libcore/ops.rs src/libstd/c_str.rs src/test/compile-fail/issue-19009.rs