| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
Small cleanup
* Add docstring to `Parser` field
* Remove unnecessary `unwrap`
* Remove unnecessary borrow
* Fix indentation of some `teach`text output
|
|
* Add docstring to `Parser` field
* Remove unnecessary `unwrap`
* Remove unnecessary borrow
* Fix indentation of some `teach`text output
|
|
Beautify all doc strings in rustdoc instead, including those in `#[doc]` attributes
|
|
Explicitly store their kind and style retrieved during lexing in the token
|
|
Seems to be a fallout from rustfmt transition
|
|
It encapsulate the (part of) the interface between the parser and
macro by example (macro_rules) parser.
The second bit is somewhat more general `parse_ast_fragment`, which is
the reason why we keep some `parse_xxx` functions as public.
|
|
In various ways, such as changing functions to take a `Symbol` instead
of a `&str`.
|
|
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
|
|
|
|
|
|
|
|
|
|
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
|
|
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
|
|
The previous implementation did not work when called on an opening
delimiter, or when called re-entrantly from the same `TokenCursor` stack
depth.
|
|
|
|
These are changes that would be needed if we add `#[must_use]` to
`Option::map`, per #71484.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parser: Remove `Parser::prev_span`
Follow-up to https://github.com/rust-lang/rust/pull/69384.
r? @Centril
|
|
|
|
|
|
|
|
parser: `token` -> `normalized_token`, `nonnormalized_token` -> `token`
So, after https://github.com/rust-lang/rust/pull/69006, its follow-ups and an attempt to remove `Parser::prev_span` I came to the conclusion that the unnormalized token and its span is what you want in most cases, so it should be default.
Normalization only makes difference in few cases where we are checking against `token::Ident` or `token::Lifetime` specifically.
This PR uses `normalized_token` for those cases.
Using normalization explicitly means that people writing code should remember about `NtIdent` and `NtLifetime` in general. (That is alleviated by the fact that `token.ident()` and `fn parse_ident_*` are already written.)
Remembering about `NtIdent`, was, however, already the case, kind of, because the implicit normalization was performed only for the current/previous token, but not for things like `look_ahead`.
As a result, most of token classification methods in `token.rs` already take `NtIdent` into account (this PR fixes a few pre-existing minor mistakes though).
The next step is removing `normalized(_prev)_token` entirely and replacing it with `token.ident()` (mostly) and `token.normalize()` (occasionally).
I want to make it a separate PR for that and run it though perf.
`normalized_token` filled on every bump has both a potential to avoid repeated normalization, and to do unnecessary work in advance (it probably doesn't matter anyway, the normalization is very cheap).
r? @Centril
|
|
example:
let s: String = format!("hello").into();
|
|
|
|
|
|
They are always set synchronously with normalized tokens now
|
|
|
|
Token normalization is merged directly into `bump`.
Special "unknown macro variable" diagnostic for unexpected `$`s is removed as preventing legal code from compiling.
|
|
|
|
|
|
use new span for better diagnostics.
|
|
Same idea for `Unsafety` & use new span for better diagnostics.
|
|
Hasten macro parsing
r? @eddyb
|
|
parser: Remove `Parser::prev_token_kind`
Follow-up to https://github.com/rust-lang/rust/pull/69006.
r? @Centril
|
|
|
|
Caller now passes in a `decorate` function, which is only run if the
lint is allowed.
|
|
|
|
including their unnormalized forms.
Add more documentation for them.
|
|
The previous commit wrapped `Parser` within a `Cow` for the hot macro
parsing path. As a result, there's no need for the `Cow` within
`Directory`, because it lies within `Parser`.
|
|
|