| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
- Change wording of suggestion
- Move recovery logic to `diagnostics.rs`
- Reduce ammount of code duplication
|
|
|
|
|
|
|
|
Include expression to wait for to the span of Await
Currently the span of `await!` only includes itself:
```rust
await!(3);
// ^^^^^
```
This PR changes it so that the span holds the whole `await!` expression:
```rust
await!(3);
// ^^^^^^^^^
|
|
Move token tree related lexer state to a separate struct
Just a types-based refactoring.
We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer
|
|
|
|
impl_trait_in_bindings is not yet complete and can lead to compiler crashes.
Fixes #60764.
|
|
See https://github.com/rust-lang/rust/pull/50838/files#r283296243 for
explanation how jointness checking works with *next* pair
|
|
|
|
We only used a bunch of fields when tokenizing into a token tree,
so let's move them out of the base lexer
|
|
Use `Symbol` more
A `Symbol` can be equated with a string (e.g. `&str`). This involves a
TLS lookup to get the chars (and a Mutex lock in a parallel compiler)
and then a char-by-char comparison. This functionality is convenient but
avoids one of the main benefits of `Symbol`s, which is fast equality
comparisons.
This PR removes the `Symbol`/string equality operations, forcing a lot
of existing string occurrences to become `Symbol`s. Fortunately, these
are almost all static strings (many are attribute names) and we can add
static `Symbol`s as necessary, and very little extra interning occurs.
The benefits are (a) a slight speedup (possibly greater in a parallel
compiler), and (b) the code is a lot more principled about `Symbol` use.
The main downside is verbosity, particularly with more `use
syntax::symbol::symbols` items.
r? @Zoxc
|
|
|
|
And also the equality between `Path` and strings, because `Path` is made
up of `Symbol`s.
|
|
|
|
Because it's going to be used a lot.
|
|
Rollup of 4 pull requests
Successful merges:
- #60694 (Fix HIR printing of existential type #60662)
- #60750 (syntax: Remove some legacy nonterminal tokens)
- #60751 (Assorted cleanup in parser & AST validation)
- #60752 (Fix minor typos for ItemLocalId)
Failed merges:
r? @ghost
|
|
Assorted cleanup in parser & AST validation
r? @petrochenkov
Extracted out of a larger PR.
|
|
|
|
|
|
|
|
|
|
|
|
Remove some dead code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fix async desugaring providing wrong input to procedural macros.
Fixes #60674.
This PR fixes a minor oversight introduced by #60535 where unused `mut` binding modes were removed from the arguments to an `async fn` (as they were added to the statement that we insert into the closure body). However, this meant that the input to procedural macros was incorrect. This removes that and instead fixes the `unused_mut` error that it avoided.
r? @cramertj
cc @taiki-e
|
|
Comment ext::tt::transcribe
Also did a bit of minor cleanup (remove unidiomatic use of `Add` and an unneeded `clone`). No functionality changes.
r? @petrochenkov
|
|
Identify when a stmt could have been parsed as an expr
There are some expressions that can be parsed as a statement without
a trailing semicolon depending on the context, which can lead to
confusing errors due to the same looking code being accepted in some
places and not others. Identify these cases and suggest enclosing in
parenthesis making the parse non-ambiguous without changing the
accepted grammar.
Fix #54186, cc #54482, fix #59975, fix #47287.
|
|
This is unrelated to the rest of this PR but it made sense to add a
FIXME explaining that the function shouldn't really be in the parser.
|
|
This commit removes the modification of the mutability of simple
bindings. While the mutability isn't used, it is important that it is
kept so that the input to procedural macros matches what the user wrote.
This commit also modifies the span of the binding mode so that it is
considered a compiler desugaring and won't be linted against for being
unused..
|
|
|
|
|
|
|
|
Implement built-in await syntax
Adds support for .await under the existing async_await feature gate.
Moves macro-like await! syntax to the await_macro feature gate.
Removes support for `await` as a non-keyword under the `async_await`
feature.
This new syntax is not final, but is the consensus solution proposed by the lang team, as explained in https://boats.gitlab.io/blog/post/await-decision/
Fix https://github.com/rust-lang/rust/issues/51719
Fix https://github.com/rust-lang/rust/issues/51751
Fix https://github.com/rust-lang/rust/issues/60016
|
|
Adds support for .await under the existing async_await feature gate.
Moves macro-like await! syntax to the await_macro feature gate.
Removes support for `await` as a non-keyword under the `async_await`
feature.
|
|
Fix parsing issue with negative literals as const generic arguments
|
|
Correct handling of arguments in async fn
Fixes #60509
Fixes #60566
r? @cramertj or @davidtwco
|
|
rustc: rename -Z emit-directives to -Z emit-artifact-notifications and simplify the output.
This is my take on #60006 / #60419 (see https://github.com/rust-lang/rust/pull/60006#discussion_r275983732).
I'm not too attached the "notifications" part, it's pretty much bikeshed material.
**EDIT**: for "artifact", @matklad pointed out Cargo already uses it (in https://github.com/rust-lang/rust/pull/60464#issuecomment-488576998)
The first two commits are fixes that could be landed independently, especially the `compiletest` one, which removes the need for any of the normalization added in #60006 to land the test.
The last commit enables the emission for all outputs, which was my main suggestion for #60006, mostly to show that it's minimal and not really a "scope creep" (as suggested in https://github.com/rust-lang/rust/pull/60006#discussion_r279964081).
cc @alexcrichton @nnethercote
|
|
simplify the output.
|
|
Enforce sorting of accepted and removed features
Fixes https://github.com/rust-lang/rust/issues/60361 with mechanism introduced in https://github.com/rust-lang/rust/pull/60373.
r? @oli-obk
|
|
|
|
|