| Age | Commit message (Collapse) | Author | Lines |
|
We also sever syntax's dependency on rustc_target as a result.
This should slightly improve pipe-lining.
Moreover, some cleanup is done in related code.
|
|
|
|
|
|
|
|
`AttrKind` is a new type with two variants, `Normal` and `DocComment`. It's a
big performance win (over 10% in some cases) because `DocComment` lets doc
comments (which are common) be represented very cheaply.
`Attribute` gets some new helper methods to ease the transition:
- `has_name()`: check if the attribute name matches a single `Symbol`; for
`DocComment` variants it succeeds if the symbol is `sym::doc`.
- `is_doc_comment()`: check if it has a `DocComment` kind.
- `{get,unwrap}_normal_item()`: extract the item from a `Normal` variant;
panic otherwise.
Fixes #60935.
|
|
This kind of thing just makes the code harder to read.
|
|
use American spelling for `pluralize!`
|
|
r=estebank
Rename `LocalInternedString` and more
This PR renames `LocalInternedString` as `SymbolStr`, removes an unnecessary `impl` from it, improves comments, and cleans up some `SymbolStr` uses.
r? @estebank
|
|
Detect `::` -> `:` typo when involving turbofish
Fix #65569.
|
|
syntax: Avoid span arithmetic for delimiter tokens
The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it.
Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly.
If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract `1` from the span boundaries.
Fixes https://github.com/rust-lang/rust/issues/62524
r? @estebank
|
|
|
|
|
|
`Span` cannot represent `span.hi < span.lo`
So we can remove the corresponding checks from various code
|
|
|
|
Reduce amount of errors given unclosed delimiter
When in a file with a non-terminated item, catch the error and consume
the block instead of trying to recover it on a more granular way in order to
reduce the amount of unrelated errors that would be fixed after adding
the missing closing brace. Also point out the possible location of the
missing closing brace.
Fix #63690.
|
|
|
|
Because it's highly magical, which goes against the goal of keeping
`SymbolStr` simple. Plus it's only used in a handful of places that
only require minor changes.
|
|
Including removing a bunch of unnecessary `.as_str()` calls, and a bunch
of unnecessary sigils.
|
|
So we can remove the corresponding checks from various code
|
|
|
|
|
|
When in a file with a non-terminated item, catch the error and consume
the block instead of trying to recover it more granularly in order to
reduce the amount of unrelated errors that would be fixed after adding
the missing closing brace. Also point out the possible location of the
missing closing brace.
|
|
|
|
|
|
- Detect `,` and `:` typos where `;` was intended.
- When the next token could have been the start of a new statement,
detect a missing semicolon.
|
|
rustc, rustc_passes: reduce deps on rustc_expand
Part of #65324.
r? @petrochenkov
|
|
|
|
|
|
move report_invalid_macro_expansion_item to item.rs
From https://github.com/rust-lang/rust/pull/65324.
r? @Mark-Simulacrum
|
|
move Attribute::with_desugared_doc to librustdoc
From https://github.com/rust-lang/rust/pull/65324.
r? @varkor
|
|
move panictry! to where it is used.
From https://github.com/rust-lang/rust/pull/65324
r? @davidtwco
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Add test for rejecting `trait A: B1 = B2;`.
Also test rejection of `trait A: = B;`.
|
|
refactor and move `maybe_append`
|
|
|
|
Clarify diagnostics when using `~` as a unary op
It seems we prefer `bitwise not` to `bitwise negation`.
Fixes #57239
r? @estebank
|
|
nnethercote:avoid-unnecessary-TokenTree-to-TokenStream-conversions, r=petrochenkov
Avoid unnecessary `TokenTree` to `TokenStream` conversions
A `TokenStream` contains any number of `TokenTrees`. Therefore, a single `TokenTree` can be promoted to a `TokenStream`. But doing so costs two allocations: one for the single-element `Vec`, and one for the `Lrc`. (An `IsJoint` value also must be added; the default is `NonJoint`.)
The current code converts `TokenTree`s to `TokenStream`s unnecessarily in a few places. This PR removes some of these unnecessary conversions, both simplifying the code and speeding it up.
r? @petrochenkov
|