| 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
|
|
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
|
|
|
|
The previous implementation did not work when called on an opening
delimiter, or when called re-entrantly from the same `TokenCursor` stack
depth.
|
|
The value passed in already has backticks surrounding the text.
|
|
|
|
|
|
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.
|
|
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
|
|
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
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`error_bad_item_kind`: add help text
For example, this adds:
```
= help: consider moving the `use` import out to a nearby module scope
```
r? @petrochenkov @estebank
Fixes https://github.com/rust-lang/rust/issues/37205.
|
|
|
|
|
|
Added tests and stderr output
|
|
Tweak chained operators diagnostic
Use more selective spans
Improve suggestion output
Be more selective when displaying suggestions
Silence some knock-down type errors
r? @Centril
|
|
|
|
Use more selective spans
Improve suggestion output
Be more selective when displaying suggestions
Silence some knock-down type errors
|
|
|
|
parser: simplify & remove unused field
r? @petrochenkov
|
|
couple more clippy fixes (let_and_return, if_same_then_else)
* summarize if-else-code with identical blocks (clippy::if_same_then_else)
* don't create variable bindings just to return the bound value immediately (clippy::let_and_return)
|
|
parser: recover on `for<'a> |...| body` closures
When encountering `for` and `<` is 1 token ahead, interpret this as an explicitly quantified generic closure and recover, rather than attempting to parse a `for` loop. This provides both improved diagnostics as well as an insurance policy for the ability to use this as the syntax for generic closures in the future.
As requested by r? @eddyb
|
|
|
|
|