| Age | Commit message (Collapse) | Author | Lines |
|
|
|
This extends PR #73293 to handle patterns (Pat). Unlike expressions,
patterns do not support custom attributes, so we only need to capture
tokens during macro_rules! argument parsing.
|
|
|
|
|
|
Explicitly store their kind and style retrieved during lexing in the token
|
|
* Deduplicate type ascription LHS errors
* Remove duplicated `:` -> `::` suggestion from parse error
* Tweak wording to be more accurate
* Modify `current_type_ascription` to reduce span wrangling
* remove now unnecessary match arm
* Add run-rustfix to appropriate tests
|
|
|
|
|
|
r=petrochenkov
Tweak `::` -> `:` typo heuristic and reduce verbosity
Do not trigger on correct type ascription expressions with trailing
operators and _do_ trigger on likely path typos where a turbofish is
used.
On likely path typos, remove note explaining type ascription.
Clean up indentation.
r? @petrochenkov
|
|
Do not trigger on correct type ascription expressions with trailing
operators and _do_ trigger on likely path typos where a turbofish is
used.
On likely path typos, remove note explaining type ascription.
|
|
Audit hidden/short code suggestions
Should fix #73641.
Audit uses of `span_suggestion_short` and `tool_only_span_suggestion` (`span_suggestion_hidden` is already tested with `run-rustfix`). Leave some FIXMEs for futher improvements/fixes.
r? @estebank
|
|
|
|
Recover extra trailing angle brackets in struct definition
This commit applies the existing 'extra angle bracket recovery' logic
when parsing fields in struct definitions. This allows us to continue
parsing the struct's fields, avoiding spurious 'missing field' errors in
code that tries to use the struct.
|
|
|
|
This commit applies the existing 'extra angle bracket recovery' logic
when parsing fields in struct definitions. This allows us to continue
parsing the struct's fields, avoiding spurious 'missing field' errors in
code that tries to use the struct.
|
|
Tweak "non-primitive cast" error
- Suggest borrowing expression if it would allow cast to work.
- Suggest using `<Type>::from(<expr>)` when appropriate.
- Minor tweak to `;` typo suggestion.
Partily address #47136.
|
|
- Suggest borrowing expression if it would allow cast to work.
- Suggest using `<Type>::from(<expr>)` when appropriate.
- Minor tweak to `;` typo suggestion.
Partily address #47136.
|
|
Fixes more of:
clippy::unused_unit
clippy::op_ref
clippy::useless_format
clippy::needless_return
clippy::useless_conversion
clippy::bind_instead_of_map
clippy::into_iter_on_ref
clippy::redundant_clone
clippy::nonminimal_bool
clippy::redundant_closure
clippy::option_as_ref_deref
clippy::len_zero
clippy::iter_cloned_collect
clippy::filter_next
|
|
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
|
|
|
|
The value passed in already has backticks surrounding the text.
|
|
|
|
|
|
Code blocks that are not annotated are assumed to be Rust
|
|
|
|
|
|
|
|
direction
|
|
|
|
|
|
|
|
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)
|
|
|
|
Use more selective spans
Improve suggestion output
Be more selective when displaying suggestions
Silence some knock-down type errors
|
|
|
|
Make error message clearer about creating new module
This is a partial improvement for #69492
|
|
|
|
|
|
|
|
it. (clippy::redundant_static_lifetimes)
|
|
parser: Remove `Parser::prev_span`
Follow-up to https://github.com/rust-lang/rust/pull/69384.
r? @Centril
|
|
|
|
|
|
|
|
|
|
Caller now passes in a `decorate` function, which is only run if the
lint is allowed.
|
|
|
|
also refactor `FnKind` and `visit_assoc_item` visitors
|
|
|