Niko Matsakis
07cdb85331
Move return type an associated type of the Fn*
traits. Mostly this involves tweaking things in
...
the compiler that assumed two input types to assume two ouputs; we also have to teach `project.rs`
to project `Output` from the unboxed closure and fn traits.
2015-01-28 05:15:23 -05:00
Alex Crichton
3a07f859b8
Fallout of io => old_io
2015-01-26 16:01:16 -08:00
Eduard Burtescu
9690be5ece
Adjust most comments and messages to not use "unboxed".
2015-01-26 04:15:09 +02:00
Eduard Burtescu
11ef6f1349
Remove "unboxed" attribute in code referring to new closures.
2015-01-26 04:15:09 +02:00
Huon Wilson
ec790d6fcc
Tweak chained comparison errors.
...
Lower case and give a more precise span: from operator to operator, not
just the last one.
2015-01-25 00:35:06 +11:00
Huon Wilson
2e888d0341
Add the span of the operator itself to ast::BinOp.
2015-01-25 00:33:50 +11:00
Daniel Grunwald
db013f9f45
Fix some grammar inconsistencies for the '..' range notation.
...
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-22 19:55:15 +01:00
Alex Crichton
df1cddf20a
rollup merge of #20179 : eddyb/blind-items
...
Conflicts:
src/librustc/diagnostics.rs
src/librustdoc/clean/mod.rs
src/librustdoc/html/format.rs
src/libsyntax/parse/parser.rs
2015-01-21 11:56:00 -08:00
Alex Crichton
886c6f3534
rollup merge of #21258 : aturon/stab-3-index
...
Conflicts:
src/libcore/ops.rs
src/librustc_typeck/astconv.rs
src/libstd/io/mem.rs
src/libsyntax/parse/lexer/mod.rs
2015-01-21 11:53:49 -08:00
Alex Crichton
9c999c797c
rollup merge of #21463 : sanxiyn/demut
2015-01-21 09:21:09 -08:00
Alex Crichton
5d82c0fabf
rollup merge of #21411 : P1start/help-tweaks
...
Conflicts:
src/librustc_typeck/check/closure.rs
2015-01-21 09:15:54 -08:00
Alex Crichton
0c981875e4
rollup merge of #21340 : pshc/libsyntax-no-more-ints
...
Collaboration with @rylev!
I didn't change `int` in the [quasi-quoter](99ae1a30f3/src/libsyntax/ext/quote.rs (L328)
), because I'm not sure if there will be adverse effects.
Addresses #21095 .
2015-01-21 09:13:51 -08:00
Aaron Turon
a506d4cbfe
Fallout from stabilization.
2015-01-21 08:11:07 -08:00
Eduard Burtescu
38ac9e3984
syntax: merge ast::ViewItem into ast::Item.
2015-01-21 16:27:25 +02:00
Seo Sanghyeon
d4ced7b468
De-mut the parser
2015-01-21 20:44:49 +09:00
P1start
ed769bf87f
Fix up some ‘help’ messages
2015-01-20 19:51:44 +13:00
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
Paul Collier
3c32cd1be2
libsyntax: 0u -> 0us, 0i -> 0is
2015-01-18 19:43:44 -08:00
Paul Collier
591337431d
libsyntax: int types -> isize
2015-01-18 19:43:44 -08:00
Paul Collier
7a24b3a4d7
libsyntax: int => i32 in appropriate places
2015-01-18 19:43:44 -08: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
Paul Collier
a32249d447
libsyntax: uint types to usize
2015-01-17 23:45:29 +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