| Age | Commit message (Collapse) | Author | Lines |
|
cleanup shebang handling in the lexer
|
|
This increases the size of some important types, such as `ast::Expr` and
`mir::Statement`. However, it drastically reduces how much the interner
is used, and the fields are more natural sizes that don't require bit
operations to extract.
As a result, instruction counts drop across a range of workloads, by as
much as 12% for incremental "check" builds of `script-servo`.
Peak memory usage goes up a little for some cases, but down by more for
some other cases -- as much as 18% for non-incremental builds of
`packed-simd`.
The commit also:
- removes the `repr(packed)`, because it has negligible effect, but can
cause undefined behaviour;
- replaces explicit impls of common traits (`Copy`, `PartialEq`, etc.)
with derived ones.
|
|
is_doc_comment function checks the first four chars, but this is
redundant, `doc_comment` local var has the same info.
|
|
Make some of lexer's API private
Lexer is a `pub` type, so it feels wrong that its fields are just pub (I guess it wasn't exported initially), so let's minimize visibility.
Context: I am looking into extracting rust-lexer into a library, which can be shared by rust-analyzer and rustc. I hope that a simple interface like `fn next_token(src: &str) -> (TokenKind, usize)` would work, but to try this out I need to understand what is the current API of the lexer.
|
|
|
|
- libarena
- librustc_allocator
- librustc_borrowck
- librustc_codegen_ssa
- librustc_codegen_utils
- librustc_driver
- librustc_errors
- librustc_incremental
- librustc_metadata
- librustc_passes
- librustc_privacy
- librustc_resolve
- librustc_save_analysis
- librustc_target
- librustc_traits
- libsyntax
- libsyntax_ext
- libsyntax_pos
|
|
|
|
|
|
a bool
|
|
|
|
|
|
r=pnkfelix
fixes rust-lang#56766
fixes #56766
|
|
Optimize indentation in the pretty printer.
Currently the pretty-printer calls `write!` for every space of
indentation. On some workloads the indentation level can exceed 100, and
a faster implementation reduces instruction counts by up to 7% on a few
workloads.
|
|
Currently the pretty-printer calls `write!` for every space of
indentation. On some workloads the indentation level can exceed 100, and
a faster implementation reduces instruction counts by up to 7% on a few
workloads.
|
|
|
|
|
|
Whitelist some rustc attrs
These rustc attrs are used within libcore, and were causing failures when one mixed incremental compilation with bootstrapping (due to a default of `-D warnings` when bootstrapping).
Fix #59523
Fix #59524
Cc #58633
|
|
Recover from parse error in tuple syntax
|
|
flag them as unused.
|
|
attribute.
|
|
Rename `type_parameters` to `generics` and so on
Some old variable names had fallen through the generics generalisation pull requests.
|
|
Do not emit incorrect borrow suggestion involving macros and fix overlapping multiline spans
Fix #58298.
|
|
|
|
Use `SmallVec` in `TokenStreamBuilder`.
This reduces by 12% the number of allocations done for a "clean incremental" of `webrender_api`, which reduces the instruction count by about 0.5%.
r? @petrochenkov
|
|
Visit path in `walk_mac`
Fixes https://github.com/rust-lang/rust/issues/54110.
|
|
|
|
This reduces by 12% the number of allocations done for a "clean
incremental" of `webrender_api`, which reduces the instruction count by
about 0.5%.
It also reduces instruction counts by up to 1.4% across a range of
rustc-perf benchmark runs.
|
|
|
|
Do not complain about unmentioned fields in recovered patterns
When the parser has to recover from malformed code in a pattern, do not
complain about missing fields.
Fix #59145.
|
|
When two multiline span labels point at the same span, we special
case the output to avoid weird behavior:
```
foo(
_____^
|_____|
|| bar,
|| );
|| ^
||______|
|______foo
baz
```
instead showing
```
foo(
_____^
| bar,
| );
| ^
| |
|______foo
baz
```
|
|
Reject integer suffix when tuple indexing
Fix #59418.
r? @varkor
|
|
syntax: Remove warning for unnecessary path disambiguators
`rustfmt` is now stable and it removes unnecessary turbofishes, so removing the warning as discussed in https://github.com/rust-lang/rust/pull/43540 (where it was introduced).
One hardcoded warning less.
Closes https://github.com/rust-lang/rust/issues/58055
r? @nikomatsakis
|
|
|
|
|
|
|
|
|
|
Expand suggestions for type ascription parse errors
Fix #51222. CC #48016, #47666, #54516, #34255.
|
|
|
|
|
|
Make meta-item API compatible with `LocalInternedString::get` soundness fix
r? @Zoxc
|
|
|
|
This commit makes two changes - separating the `NodeId` that identifies
an enum variant from the `NodeId` that identifies the variant's
constructor; and no longer creating a `NodeId` for `Struct`-style enum
variants and structs.
Separation of the variant id and variant constructor id will allow the
rest of RFC 2008 to be implemented by lowering the visibility of the
variant's constructor without lowering the visbility of the variant
itself.
No longer creating a `NodeId` for `Struct`-style enum variants and
structs mostly simplifies logic as previously this `NodeId` wasn't used.
There were various cases where the `NodeId` wouldn't be used unless
there was an unit or tuple struct or enum variant but not all uses of
this `NodeId` had that condition, by removing this `NodeId`, this must
be explicitly dealt with. This change mostly applied cleanly, but there
were one or two cases in name resolution and one case in type check
where the existing logic required a id for `Struct`-style enum variants
and structs.
|
|
|
|
|
|
syntax: Better recovery for `$ty::AssocItem` and `ty!()::AssocItem`
This PR improves on https://github.com/rust-lang/rust/pull/46788 covering a few missing cases.
Fixes https://github.com/rust-lang/rust/issues/52307
Fixes https://github.com/rust-lang/rust/issues/53776
r? @estebank
|
|
|
|
|
|
In order to minimize the verbosity of common syntax errors that are parsed
as type ascription, hide the feature gate error unless there are no other
errors being emitted by the parser.
|
|
|
|
Tweak incorrect escaped char diagnostic
|