| Age | Commit message (Collapse) | Author | Lines |
|
refactor check_for_substitution
No behavior change, just flatter and simpler code.
r? @petrochenkov
|
|
syntax: Unsupport `foo! bar { ... }` macros in the parser
Their support in expansion was removed in https://github.com/rust-lang/rust/pull/61606.
Also un-reserve `macro_rules` as a macro name, there's no ambiguity between `macro_rules` definitions and macro calls (it also wasn't reserved correctly).
cc https://github.com/rust-lang-nursery/wg-grammar/issues/51
|
|
r=dtolnay,Centril
Use mem::take instead of mem::replace with default
|
|
Remove needless lifetimes (rustc)
|
|
Rollup of 15 pull requests
Successful merges:
- #62021 (MSVC link output improve)
- #62064 (nth_back for chunks_exact)
- #62128 (Adjust warning of -C extra-filename with -o.)
- #62161 (Add missing links for TryFrom docs)
- #62183 (std: Move a process test out of libstd)
- #62186 (Add missing type urls in Into trait)
- #62196 (Add Vec::leak)
- #62199 (import gdb for explicit access to gdb.current_objfile())
- #62229 (Enable intptrcast for explicit casts)
- #62250 (Improve box clone doctests to ensure the documentation is valid)
- #62255 (Switch tracking issue for `#![feature(slice_patterns)]`)
- #62285 (Fix michaelwoerister's mailmap)
- #62304 (HashMap is UnwindSafe)
- #62319 (Fix mismatching Kleene operators)
- #62327 (Fixed document bug, those replaced each other)
Failed merges:
r? @ghost
|
|
Switch tracking issue for `#![feature(slice_patterns)]`
Switches the tracking issue for `#![feature(slice_patterns)]` to a fresh one in https://github.com/rust-lang/rust/issues/62254 due to new RFCs.
Closes https://github.com/rust-lang/rust/issues/23121.
r? @varkor
|
|
rustc: use a separate copy of P for HIR than for AST.
Note: this currently includes/is based on top of #61987.
Like #61968, but goes one step further and uses a separate `P<...>` for the HIR, with no `Clone`, or the ability to mutate after allocation.
There is still `into_inner`/`into_iter`, but they're only exposed for `hir::lowering`, and they would take more work to untangle.
r? @petrochenkov cc @rust-lang/compiler
|
|
|
|
|
|
|
|
Minimizes risk.
|
|
No behavior change, just flatter and simpler code
|
|
|
|
|
|
|
|
|
|
|
|
Unreserve `macro_rules` as a macro name
|
|
Rollup of 8 pull requests
Successful merges:
- #62062 (Use a more efficient iteration order for forward dataflow)
- #62063 (Use a more efficient iteration order for backward dataflow)
- #62224 (rustdoc: remove unused derives and variants)
- #62228 (Extend the #[must_use] lint to boxed types)
- #62235 (Extend the `#[must_use]` lint to arrays)
- #62239 (Fix a typo)
- #62241 (Always parse 'async unsafe fn' + properly ban in 2015)
- #62248 (before_exec actually will only get deprecated with 1.37)
Failed merges:
r? @ghost
|
|
r=petrochenkov
Stabilize `type_alias_enum_variants` in Rust 1.37.0
Stabilize `#![feature(type_alias_enum_variants)]` which allows type-relative resolution with highest priority to `enum` variants in both expression and pattern contexts. For example, you may now write:
```rust
enum Option<T> {
None,
Some(T),
}
type OptAlias<T> = Option<T>;
fn work_on_alias(x: Option<u8>) -> u8 {
match x {
OptAlias::Some(y) => y + 1,
OptAlias::None => 0,
}
}
```
Closes https://github.com/rust-lang/rfcs/issues/2218
Closes https://github.com/rust-lang/rust/issues/52118
r? @petrochenkov
|
|
|
|
|
|
Remove outdated question_mark_macro_sep lint
|
|
Remove old fixme
fixed in https://github.com/rust-lang/rust/pull/60160
r? @Centril
|
|
libsyntax: Fix some Clippy warnings
When I was working on it before a lot of these popped up in the RLS so I figured I'll send a small patch fixing only the (hopefully) uncontroversial ones.
Others that could be also fixed included also [`clippy::print_with_newline`](https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline) and [`clippy::cast_lossless`](https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless). Should I add them as well?
since most of it touches libsyntax...
r? @petrochenkov
|
|
refactor lexer to use idiomatic borrowing
|
|
|
|
|
|
|
|
|
|
Lexer uses Symbols for a lot of stuff, not only for identifiers, so
the "name" terminology is just confusing.
|
|
|
|
Implement arbitrary_enum_discriminant
Implements RFC rust-lang/rfcs#2363 (tracking issue #60553).
|
|
Remove `ast::Guard`
With the introduction of `ast::ExprKind::Let` in https://github.com/rust-lang/rust/pull/60861, the `ast::Guard` structure is now redundant in terms of representing [`if let` guards](https://github.com/rust-lang/rust/issues/51114) in AST since it can be represented by `ExprKind::Let` syntactically. Therefore, we remove `ast::Guard` here.
However, we keep `hir::Guard` because the semantic representation is a different matter and this story is more unclear right now (might involve `goto 'arm` in HIR or something...).
r? @petrochenkov
|
|
Run rustfmt on some libsyntax files
As part of #62008, run rustfmt on:
- src/libsyntax/ext/tt/macro_rules.rs
- src/libsyntax/ext/tt/quoted.rs
There is no semantic change. To fix potential merge conflicts, simply choose the other side then run rustfmt and fix any tidy check (like line length).
|
|
[let_chains, 2/6] Introduce `Let(..)` in AST, remove IfLet + WhileLet and parse let chains
Here we remove `ast::ExprKind::{IfLet, WhileLet}` and introduce `ast::ExprKind::Let`.
Moreover, we also:
+ connect the parsing logic for let chains
+ introduce the feature gate
+ rewire HIR lowering a bit.
However, this does not connect the new syntax to semantics in HIR.
That will be the subject of a subsequent PR.
Per https://github.com/rust-lang/rust/issues/53667#issuecomment-471583239.
Next step after https://github.com/rust-lang/rust/pull/59288.
cc @Manishearth re. Clippy.
r? @oli-obk
|
|
|
|
|
|
Fix meta-variable binding errors in macros
The errors are either:
- The meta-variable used in the right-hand side is not bound (or defined) in the
left-hand side.
- The meta-variable used in the right-hand side does not repeat with the same
kleene operator as its binder in the left-hand side. Either it does not repeat
enough, or it uses a different operator somewhere.
This change should have no semantic impact.
Found by https://github.com/rust-lang/rust/pull/62008
|
|
Lint empty `#[derive()]` as unused attribute.
Closes https://github.com/rust-lang/rust/issues/54651.
cc https://github.com/rust-lang/rust/issues/55112
r? @petrochenkov
|
|
|
|
The errors are either:
- The meta-variable used in the right-hand side is not bound (or defined) in the
left-hand side.
- The meta-variable used in the right-hand side does not repeat with the same
kleene operator as its binder in the left-hand side. Either it does not repeat
enough, or it uses a different operator somewhere.
This change should have no semantic impact.
|
|
Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|