about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-01-24Auto merge of #21079 - huonw:chained-cmp-tweaks, r=pnkfelixbors-23/+28
First commit is mindless groundwork for the second one, to make the spans (arguably) nicer. ### before ``` require-parens-for-chained-comparison.rs:14:20: 14:22 error: Chained comparison operators require parentheses require-parens-for-chained-comparison.rs:14 false == false == false; ^~ require-parens-for-chained-comparison.rs:17:16: 17:17 error: Chained comparison operators require parentheses require-parens-for-chained-comparison.rs:17 false == 0 < 2; ^ require-parens-for-chained-comparison.rs:20:8: 20:9 error: Chained comparison operators require parentheses require-parens-for-chained-comparison.rs:20 f<X>(); ^ require-parens-for-chained-comparison.rs:20:8: 20:9 help: Use ::< instead of < if you meant to specify type arguments. require-parens-for-chained-comparison.rs:20 f<X>(); ^ ``` ### after ``` require-parens-for-chained-comparison.rs:14:11: 14:22 error: chained comparison operators require parentheses require-parens-for-chained-comparison.rs:14 false == false == false; ^~~~~~~~~~~ require-parens-for-chained-comparison.rs:17:11: 17:17 error: chained comparison operators require parentheses require-parens-for-chained-comparison.rs:17 false == 0 < 2; ^~~~~~ require-parens-for-chained-comparison.rs:20:6: 20:9 error: chained comparison operators require parentheses require-parens-for-chained-comparison.rs:20 f<X>(); ^~~ require-parens-for-chained-comparison.rs:20:6: 20:9 help: use `::<...>` instead of `<...>` if you meant to specify type arguments require-parens-for-chained-comparison.rs:20 f<X>(); ^~~ ```
2015-01-25Tweak chained comparison errors.Huon Wilson-3/+4
Lower case and give a more precise span: from operator to operator, not just the last one.
2015-01-25Add the span of the operator itself to ast::BinOp.Huon Wilson-20/+24
2015-01-24Auto merge of #21542 - vadimcn:fix-exported-macro-paths, r=alexcrichtonbors-1/+10
... so that `super::foo` gets serialized as `super:: foo`, rather than `super :: foo`.
2015-01-23Fix tidy.Vadim Chugunov-1/+1
2015-01-22Suppress space after idents with "ModName" style in serialization of ↵Vadim Chugunov-1/+10
exported macros. Fixes issue #20701
2015-01-22Fix some grammar inconsistencies for the '..' range notation.Daniel Grunwald-19/+38
Grammar changes: * allow 'for _ in 1..i {}' (fixes #20241) * allow 'for _ in 1.. {}' as infinite loop * prevent use of range notation in contexts where only operators of high precedence are expected (fixes #20811) Parser code cleanup: * remove RESTRICTION_NO_DOTS * make AS_PREC const and follow naming convention * make min_prec inclusive
2015-01-21Make diagnostic ordering deterministicAlex Crichton-7/+7
2015-01-21More test fixes and rebase conflictsAlex Crichton-1/+1
2015-01-21rollup merge of #20179: eddyb/blind-itemsAlex Crichton-775/+333
Conflicts: src/librustc/diagnostics.rs src/librustdoc/clean/mod.rs src/librustdoc/html/format.rs src/libsyntax/parse/parser.rs
2015-01-21rollup merge of #21258: aturon/stab-3-indexAlex Crichton-6/+6
Conflicts: src/libcore/ops.rs src/librustc_typeck/astconv.rs src/libstd/io/mem.rs src/libsyntax/parse/lexer/mod.rs
2015-01-21tests: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-8/+8
2015-01-21rollup merge of #21463: sanxiyn/demutAlex Crichton-17/+17
2015-01-21rollup merge of #21457: alexcrichton/issue-21436Alex Crichton-70/+63
Conflicts: src/liballoc/boxed.rs src/librustc/middle/traits/error_reporting.rs src/libstd/sync/mpsc/mod.rs
2015-01-21rollup merge of #21429: GuillaumeGomez/macro-fixAlex Crichton-53/+54
This is little clean code of this PR: #21366. I patched the same thing as aochagavia but too slowly obviously. This is a merge of our two codes, more "rust-like".
2015-01-21rollup merge of #21411: P1start/help-tweaksAlex Crichton-1/+1
Conflicts: src/librustc_typeck/check/closure.rs
2015-01-21rollup merge of #21396: japaric/no-parens-in-rangeAlex Crichton-4/+4
Conflicts: src/libsyntax/parse/lexer/comments.rs
2015-01-21rollup merge of #21340: pshc/libsyntax-no-more-intsAlex Crichton-471/+471
Collaboration with @rylev! I didn't change `int` in the [quasi-quoter](https://github.com/pshc/rust/blob/99ae1a30f3ca28c0f7e431620560d30e44627124/src/libsyntax/ext/quote.rs#L328), because I'm not sure if there will be adverse effects. Addresses #21095.
2015-01-21rollup merge of #21289: brson/errorcodesAlex Crichton-0/+25
This does the bare minimum to make registration of error codes work again. After this patch, every call to `span_err!` with an error code gets that error code validated against a list in that crate and a new tidy script `errorck.py` validates that no error codes are duplicated globally. There are further improvements to be made yet, detailed in #19624. r? @nikomatsakis
2015-01-21Fallout from stabilization.Aaron Turon-6/+6
2015-01-21syntax: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-418/+202
2015-01-21syntax: merge ast::ViewItem into ast::Item.Eduard Burtescu-353/+130
2015-01-21Remove feature(import_shadowing).Eduard Burtescu-4/+1
2015-01-21De-mut the parserSeo Sanghyeon-17/+17
2015-01-20std: Rename Show/String to Debug/DisplayAlex Crichton-70/+63
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-20Add some extended errors.Michael Sproul-0/+6
2015-01-20Make fatal errors work with codes, add to typeckBrian Anderson-0/+12
2015-01-20Make error code registration work again. #19624Brian Anderson-0/+7
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-21Rollup merge of #20998 - estsauver:20984, r=steveklabnikBarosl LEE-22/+22
There are a large number of places that incorrectly refer to deriving in comments, instead of derives. If someone could look at src/etc/generate-deriving-span-tests.py, I'm not sure how those tests were passing before/if they were.
2015-01-20Auto merge of #21364 - cmr:fix-ttseq-ice, r=alexcrichtonbors-10/+13
Closes #21350
2015-01-20Fix up some ‘help’ messagesP1start-1/+1
2015-01-20Auto merge of #21257 - alexcrichton:issue-20064, r=pnkfelixbors-0/+14
These two attributes are used to change the entry point into a Rust program, but for now they're being put behind feature gates until we have a chance to think about them a little more. The #[start] attribute specifically may have its signature changed. This is a breaking change to due the usage of these attributes generating errors by default now. If your crate is using these attributes, add this to your crate root: #![feature(start)] // if you're using the #[start] attribute #![feature(main)] // if you're using the #[main] attribute cc #20064
2015-01-19Updates of the fixGuillaumeGomez-43/+43
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-4/+4
2015-01-19Fixes #21033 with accompanying test.Tom Chittenden-25/+34
2015-01-19Auto merge of #21099 - sanxiyn:opt-return-ty, r=alexcrichtonbors-63/+27
This avoids having ast::Ty nodes which have no counterpart in the source.
2015-01-18libsyntax: 0u -> 0us, 0i -> 0isPaul Collier-156/+156
2015-01-18libsyntax: int types -> isizePaul Collier-40/+40
2015-01-18libsyntax: int => i32 in appropriate placesPaul Collier-48/+48
2015-01-18Fix #21356Adolfo Ochagavía-14/+15
2015-01-18syntax: allow bare sequences in lhs for follow checkingCorey Richardson-10/+13
Closes #21350
2015-01-18Make output type in ast::FnDecl optionalSeo Sanghyeon-63/+27
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-80/+80
2015-01-17Set allow(unstable) in crates that use unstable featuresBrian Anderson-0/+1
Lets them build with the -dev, -nightly, or snapshot compiler
2015-01-17Register new snapshots.Eduard Burtescu-8/+0
2015-01-18Improve the error message when source file cannot be readRyan Levick-2/+3
Contribution from @look!