| Age | Commit message (Collapse) | Author | Lines |
|
Only capture tokens for items with outer attributes
Suggested by @petrochenkov in https://github.com/rust-lang/rust/issues/43081#issuecomment-633389225
|
|
Revert recursive `TokenKind::Interpolated` expansion for now
The crater run https://github.com/rust-lang/rust/issues/72622 revealed many root regressions, at least one of which is going to take some time to fix.
For now, let's revert https://github.com/rust-lang/rust/pull/72388 to allow the 709 affected crates to continue building on the latest nightly.
|
|
|
|
This reverts commit 7a4c1865fb2f58c57e3f09645515dec8be3022c6.
|
|
This reverts commit 2af0218bf1ffca0750a352554f20a07b760a30a8.
|
|
This reverts commit 5685e4dd90ad2f4978c63b9097f0b568e4ce6e5c.
|
|
pattern
add issue 72373 tests
fmt test
fix suggestion format
Replacement, not insertion of suggested string
implement review changes
refactor to span_suggestion_verbose, improve suggestion message, change id @ pattern space formatting
fmt
fix diagnostics spacing between ident and @
refactor reference
|
|
Fix confusing error message for comma typo in multiline statement
Fixes #72253. Expands on the issue with a colon typo check.
r? @estebank
cc @ehuss
|
|
confusing diagnostics, issue #72253
add test for confusing error message, issue-72253
remove is_multiline check, refactor to self.expect(&token:Semi)
update issue-72253 tests
return Ok
|
|
Suggested by @petrochenkov in https://github.com/rust-lang/rust/issues/43081#issuecomment-633389225
|
|
|
|
Rollup of 3 pull requests
Successful merges:
- #72284 (Remove `macro_defs` map)
- #72393 (Rewrite `Parser::collect_tokens`)
- #72528 (Fix typo in doc comment.)
Failed merges:
r? @ghost
|
|
|
|
|
|
|
|
The previous implementation did not work when called on an opening
delimiter, or when called re-entrantly from the same `TokenCursor` stack
depth.
|
|
Remove redundant backtick in error message.
The value passed in already has backticks surrounding the text.
|
|
Julian-Wollersberger:literal_error_reporting_cleanup, r=petrochenkov
Literal error reporting cleanup
While doing some performance work, I noticed some code duplication in `librustc_parser/lexer/mod.rs`, so I cleaned it up.
This PR is probably best reviewed commit by commit.
I'm not sure what the API stability practices for `librustc_lexer` are. Four public methods in `unescape.rs` can be removed, but two are used by clippy, so I left them in for now.
I could open a PR for Rust-Analyzer when this one lands.
But how do I open a PR for clippy? (Git submodules are frustrating to work with)
|
|
The value passed in already has backticks surrounding the text.
|
|
|
|
method `validate_literal_escape` with a mode argument.
This enables simplifying the `match` in `cook_lexer_literal()`
and it eliminates 90 lines of repetition :)
|
|
|
|
|
|
|
|
Add help message for missing right operand in condition
closes #30035
|
|
These are changes that would be needed if we add `#[must_use]` to
`Option::map`, per #71484.
|
|
Confusing suggestion on incorrect closing `}`
Compiler returns
```
error: unexpected closing delimiter: `}`
--> main.rs:20:1
|
9 | ErrorHandled::Reported => {}
| -- this block is empty, you might have not meant to close it temp
...
20 | }
| ^ unexpected closing delimiter
error: aborting due to previous error
```
|
|
Lint must_use on mem::replace
This adds a hint on `mem::replace`, "if you don't need the old value,
you can just assign the new value directly". This is in similar spirit
to the `must_use` on `ManuallyDrop::take`.
|
|
|
|
|
|
|
|
|
|
Code blocks that are not annotated are assumed to be Rust
|
|
|
|
|
|
|
|
|
|
direction
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parse: recover on `const fn()` / `async fn()`
Recover on `const fn()` and `async fn()` function pointers, suggesting to remove the qualifier.
For example:
```
error: an `fn` pointer type cannot be `async`
--> $DIR/recover-const-async-fn-ptr.rs:6:11
|
LL | type T3 = async fn();
| -----^^^^^
| |
| `async` because of this
| help: remove the `async` qualifier
```
r? @estebank
|
|
properly closed block.
|
|
Improve error messages for raw strings (#60762)
This diff improves error messages around raw strings in a few ways:
- Catch extra trailing `#` in the parser. This can't be handled in the lexer because we could be in a macro that actually expects another # (see test)
- Refactor & unify error handling in the lexer between ByteStrings and RawByteStrings
- Detect potentially intended terminators (longest sequence of "#*" is suggested)
Fixes #60762
cc @estebank who reviewed the original (abandoned) PR for the same ticket.
r? @Centril
|
|
delimiter #70583"
This reverts commit 811d817eaf5d78522773ab9d21543629027e4ecb.
|
|
parse_and_disallow_postfix_after_cast: account for `ExprKind::Err`.
Fixes https://github.com/rust-lang/rust/issues/70552.
r? @estebank
cc @daboross
|
|
|