bors
4032b85aec
Auto merge of #21278 - thchittenden:issue-21033-struct-var-pattern-fix, 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-19 19:40:51 +00:00
Tom Chittenden
d8372139a7
Fixes #21033 with accompanying test.
2015-01-19 11:58:01 -05:00
bors
135cac8528
Auto merge of #21099 - sanxiyn:opt-return-ty, r=alexcrichton
...
This avoids having ast::Ty nodes which have no counterpart in the source.
2015-01-19 08:22:58 +00:00
Seo Sanghyeon
3f0cc8011a
Make output type in ast::FnDecl optional
2015-01-18 22:49:19 +09:00
bors
dcaeb6aa23
auto merge of #20901 : dgrunwald/rust/update-token-can-begin-expr, r=sanxiyn
...
* 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-18 11:28:53 +00:00
Alex Crichton
42198c18f4
Test fixes and rebase conflicts
2015-01-15 18:53:30 -08:00
Alex Crichton
0be4b9b9c5
rollup merge of #21088 : aochagavia/obsolete
...
Only the most recent changes (since November 2014) get a special error.
Fixes #20599
2015-01-15 14:11:44 -08:00
Eduard Burtescu
b51026e09c
syntax: parse fully qualified UFCS expressions.
2015-01-15 18:51:14 +02:00
Adolfo Ochagavía
21a2df6362
Remove old obsolete syntax errors
2015-01-14 22:17:03 +01:00
Daniel Grunwald
d0863adf24
Update Token::can_begin_expr() to make it consistent with the grammar:
...
* 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-11 00:14:03 +01:00
Steven Fackler
cbd962ebb5
Forbid trailing attributes in impl blocks
...
Closes #20711
2015-01-08 21:36:30 -08:00
Alex Crichton
d11bfba71b
rollup merge of #20720 : nick29581/assoc-ice-missing
2015-01-07 17:38:03 -08:00
Nick Cameron
68a783a89f
Remove String impls and fix for make tidy
2015-01-08 14:35:53 +13:00
Alex Crichton
6e806bdefd
rollup merge of #20721 : japaric/snap
...
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-07 17:26:58 -08:00
Alex Crichton
f6a7dc5528
rollup merge of #20726 : dgrunwald/require-parens-for-chained-comparison
...
[Rendered RFC](https://github.com/rust-lang/rfcs/blob/master/text/0558-require-parentheses-for-chained-comparisons.md )
2015-01-07 17:19:55 -08:00
Daniel Grunwald
1cc69c484e
RFC 558: Require parentheses for chained comparisons
...
Fixes #20724 .
2015-01-08 01:44:01 +01:00
Jorge Aparicio
517f1cc63c
use slicing sugar
2015-01-07 17:35:56 -05:00
Nick Cameron
63a9bd5e0a
Fix precedence for ranges.
...
Technically this is a
[breaking-change]
but it probably shouldn't affect your code.
Closes #20256
2015-01-08 11:25:00 +13:00
bors
c0216c8945
Merge pull request #20674 from jbcrail/fix-misspelled-comments
...
Fix misspelled comments.
Reviewed-by: steveklabnik
2015-01-07 15:35:30 +00:00
Joseph Crail
e3b7fedc20
Fix misspelled comments.
...
I cleaned up comments prior to the 1.0 alpha release.
2015-01-06 20:53:18 -05:00
Alex Crichton
56a9e2fcd5
Test fixes and rebase conflicts
2015-01-06 16:10:37 -08:00
Alex Crichton
0631b466c2
rollup merge of #19430 : pczarn/interp_tt-cleanup
...
Conflicts:
src/libsyntax/parse/parser.rs
2015-01-06 15:38:10 -08:00
Piotr Czarnecki
d85c017f92
Cleanup and followup to PR #17830 : parsing changes
...
Prevents breaking down `$name` tokens into separate `$` and `name`.
Reports unknown macro variables.
Fixes #18775
Fixes #18839
Fixes #15640
2015-01-07 00:24:48 +01:00
Alex Crichton
5c3ddcb15d
rollup merge of #20481 : seanmonstar/fmt-show-string
...
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-06 15:22:24 -08:00
Nick Cameron
0c7f7a5fb8
fallout
2015-01-07 12:02:52 +13:00
Sean McArthur
44440e5c18
core: split into fmt::Show and fmt::String
...
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-06 14:49:42 -08:00
Nick Cameron
e970db37a9
Remove old slicing hacks and make new slicing work
2015-01-07 10:49:00 +13:00
Nick Cameron
f7ff37e4c5
Replace full slice notation with index calls
2015-01-07 10:46:33 +13:00
Alex Crichton
4b359e3aee
More test fixes!
2015-01-05 22:58:37 -08:00
Alex Crichton
7975fd9cee
rollup merge of #20482 : kmcallister/macro-reform
...
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-05 19:01:17 -08:00
Alex Crichton
384e218789
Merge remote-tracking branch 'nrc/sized-2' into rollup
...
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-05 18:55:41 -08:00
Alex Crichton
afbce050ca
rollup merge of #20556 : japaric/no-for-sized
...
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
2015-01-05 18:47:45 -08:00
Alex Crichton
bb5e16b4b8
rollup merge of #20554 : huonw/mut-pattern
...
Conflicts:
src/librustc_typeck/check/_match.rs
2015-01-05 18:38:51 -08:00
Alex Crichton
3d9923d0d5
rollup merge of #20424 : jroesch/tuple-struct-where-clause-fix
...
Fixes #17904 . All the cases that I believe we should support are detailed in the test case, let me know if there is there is any more desired behavior. cc @japaric.
r? @nikomatsakis or whoever is appropriate.
2015-01-05 18:36:30 -08:00
Alex Crichton
7f4f79cbd7
rollup merge of #20099 : P1start/parse-more-macro-ops
...
Closes #20093 .
2015-01-05 18:36:25 -08:00
Keegan McAllister
c9f0ff3813
Reserve the keyword 'macro'
2015-01-05 18:21:14 -08:00
Nick Cameron
48f50e1e98
Obsolete Sized? T
...
[breaking-change]
Use `T: ?Sized`
2015-01-06 14:20:47 +13:00
Nick Cameron
595a082587
Remove the prefix in ObsoleteSyntax variants
2015-01-06 13:23:29 +13:00
Jorge Aparicio
799332fa3f
syntax: remove dead code
2015-01-05 17:22:16 -05:00
Jorge Aparicio
58b0d7479f
syntax: make the closure type f: |uint| -> bool
syntax obsolete
2015-01-05 17:22:16 -05:00
Jorge Aparicio
714a5b7f5e
remove TyClosure
2015-01-05 17:22:15 -05:00
Keegan McAllister
fc58479323
Stop using macro_escape as an inner attribute
...
In preparation for the rename.
2015-01-05 12:00:57 -08:00
Jorge Aparicio
4ed2800701
syntax: obsolete the for Sized?
syntax
2015-01-05 14:56:49 -05:00
Keegan McAllister
e2a9c04e19
Allow leading :: in use items
2015-01-05 11:38:12 -08:00
Keegan McAllister
ad7c647773
Add a special macro nonterminal $crate
2015-01-05 11:38:12 -08:00
Jared Roesch
c02fac471a
Refactor struct parsing and add tests
2015-01-05 00:46:01 -08:00
Huon Wilson
bf6c007760
Change &
pat to only work with &T, and &mut
with &mut T.
...
This implements RFC 179 by making the pattern `&<pat>` require matching
against a variable of type `&T`, and introducing the pattern `&mut
<pat>` which only works with variables of type `&mut T`.
The pattern `&mut x` currently parses as `&(mut x)` i.e. a pattern match
through a `&T` or a `&mut T` that binds the variable `x` to have type
`T` and to be mutable. This should be rewritten as follows, for example,
for &mut x in slice.iter() {
becomes
for &x in slice.iter() {
let mut x = x;
Due to this, this is a
[breaking-change]
Closes #20496 .
2015-01-05 16:14:17 +11:00
bors
ed22606c83
auto merge of #20285 : FlaPer87/rust/oibit-send-and-friends, r=nikomatsakis
...
This commit introduces the syntax for negative implementations of traits
as shown below:
`impl !Trait for Type {}`
cc #13231
Part of RFC rust-lang/rfcs#127
r? @nikomatsakis
2015-01-05 04:20:46 +00:00
Jared Roesch
c54932cb12
Fix the parsing of where-clauses for structs
2015-01-04 17:33:31 -08:00
Flavio Percoco
8b883ab268
Add syntax for negative implementations of traits
...
This commit introduces the syntax for negative implmenetations of traits
as shown below:
`impl !Trait for Type {}`
cc #13231
Part of RFC #3
2015-01-04 23:16:13 +01:00