| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Implement step 1 of rust-lang/rfcs#702
Allows the expression `..` (without either endpoint) in general, can be
used in slicing syntax `&expr[..]` where we previously wrote `&expr[]`.
The old syntax &expr[] is not yet removed or warned for.
|
|
|
|
|
|
Allows the expression `..` (without either endpoint) in general, can be
used in slicing syntax `&expr[..]` where we previously wrote `&expr[]`.
The old syntax &expr[] is not yet removed or warned for.
|
|
|
|
upgrade the inference based on expected type so that it is able to
infer the fn kind in isolation even if the full signature is not
available (and we could perhaps do better still in some cases, such as
extracting just the types of the arguments but not the return value).
|
|
syntax like `use foo::bar::;` and `use foo:: as bar;` should be rejected, see issue #21629
|
|
Conflicts:
src/librustc/metadata/filesearch.rs
src/librustc_back/target/mod.rs
src/libstd/os.rs
src/libstd/sys/windows/os.rs
src/libsyntax/ext/tt/macro_parser.rs
src/libsyntax/print/pprust.rs
src/test/compile-fail/issue-2149.rs
|
|
|
|
Conflicts:
src/libsyntax/parse/parser.rs
|
|
Also `for x in option.into_iter()` -> `if let Some(x) = option`
|
|
|
|
See PR # 21378 for context
|
|
Fixes #21153.
|
|
view path idents
|
|
|
|
This commits adds an associated type to the `FromStr` trait representing an
error payload for parses which do not succeed. The previous return value,
`Option<Self>` did not allow for this form of payload. After the associated type
was added, the following attributes were applied:
* `FromStr` is now stable
* `FromStr::Err` is now stable
* `FromStr::from_str` is now stable
* `StrExt::parse` is now stable
* `FromStr for bool` is now stable
* `FromStr for $float` is now stable
* `FromStr for $integral` is now stable
* Errors returned from stable `FromStr` implementations are stable
* Errors implement `Display` and `Error` (both impl blocks being `#[stable]`)
Closes #15138
|
|
|
|
|
|
Closes #21263
[breaking-change]
If you are using `core::ops::FullRange` you should change to using `core::ops::RangeFull`
|
|
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.
|
|
|
|
|
|
|
|
Lower case and give a more precise span: from operator to operator, not
just the last one.
|
|
|
|
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
|
|
Conflicts:
src/librustc/diagnostics.rs
src/librustdoc/clean/mod.rs
src/librustdoc/html/format.rs
src/libsyntax/parse/parser.rs
|
|
Conflicts:
src/libcore/ops.rs
src/librustc_typeck/astconv.rs
src/libstd/io/mem.rs
src/libsyntax/parse/lexer/mod.rs
|
|
|
|
Conflicts:
src/librustc_typeck/check/closure.rs
|
|
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.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
This avoids having ast::Ty nodes which have no counterpart in the source.
|
|
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
Only the most recent changes (since November 2014) get a special error.
Fixes #20599
|
|
|