| Age | Commit message (Collapse) | Author | Lines |
|
Because it's an extra type layer that doesn't really help; in a couple
of places it actively gets in the way, and overall removing it makes the
code nicer. It does, however, move `tokenstream::TokenTree` further away
from the `TokenTree` in `quote.rs`.
More importantly, this change reduces the size of `TokenStream` from 48
bytes to 40 bytes on x86-64, which is enough to slightly reduce
instruction counts on numerous benchmarks, the best by 1.5%.
Note that `open_tt` and `close_tt` have gone from being methods on
`Delimited` to associated methods of `TokenTree`.
|
|
Suggest an appropriate token when encountering `pub Ident<'a>`
Fix #55403. Follow up to #45997.
|
|
|
|
Delay gensym creation for "underscore items" (`use foo as _`/`const _`) until name resolution
So they cannot be cloned by macros. See https://github.com/rust-lang/rust/pull/56303 for the discussion.
Mostly fix cross-crate use of underscore items by inverting the "gensyms are lost in metadata" bug as described in https://github.com/rust-lang/rust/pull/56303#issuecomment-442464695.
Fix unused import warnings for single-segment imports (first commit) and `use crate_name as _` imports (as specified in https://github.com/rust-lang/rust/pull/56303#issuecomment-442274118).
Prohibit accidentally implemented `static _: TYPE = EXPR;` (cc https://github.com/rust-lang/rust/pull/55983).
Add more tests for `use foo as _` imports.
|
|
cleanup: remove static lifetimes from consts
A follow-up to https://github.com/rust-lang/rust/pull/56497.
|
|
libsyntax_pos: A few tweaks
|
|
r=michaelwoerister
53956 panic on include bytes of own file
fix #53956
When using `include_bytes!` on a source file in the project, compiler would panic on subsequent compilations because `expand_include_bytes` would overwrite files in the source_map with no source. This PR changes `expand_include_bytes` to check source_map and use the already existing src, if any.
|
|
syntax: Use iterator and pattern APIs instead of `char_at`
Iterating over chars with the `char_at(str, i)` `i += ch.len_utf8()` loop seems unidiomatic.
|
|
|
|
fixes remaining test failures
|
|
|
|
|
|
|
|
|
|
`CrateRoot` -> `PathRoot`, `::` doesn't necessarily mean crate root now
`SelfValue` -> `SelfLower`, `SelfType` -> `SelfUpper`, both `self` and `Self` can be used in type and value namespaces now
|
|
Remove not used `DotEq` token
Currently libproc_macro does not use `DotEq` token.
https://github.com/rust-lang/rust/pull/49545 changed libproc_macro
to not generate `DotEq` token.
|
|
r=petrochenkov
Add description about `crate` for parse_visibility's comment
This rule was introduced by https://github.com/rust-lang/rust/pull/45401.
|
|
Remove some uses of try!
|
|
Currently libproc_macro does not use `DotEq` token.
https://github.com/rust-lang/rust/pull/49545 changed libproc_macro
to not generate `DotEq` token.
|
|
Prohibit `static _`
Fis unused import warnings for `use foo as _`
Add more tests for `use foo as _`
|
|
|
|
This rule was introduced by https://github.com/rust-lang/rust/pull/45401.
|
|
|
|
|
|
|
|
|
|
Clean up and streamline the pretty-printer
Some minor improvements.
|
|
Clean up span in non-trailing `..` suggestion
|
|
Update outdated code comments in StringReader
For the detection of newlines in the lexer, this is now done in `analyze_source_file.rs`.
|
|
Suggest appropriate place for lifetime when declared after type arguments
|
|
`Printer::word` takes a `&str` and converts it into a `String`, which
causes an allocation. But that allocation is rarely necessary, because
`&str` is almost always a `&'static str` or a `String` that won't be
used again.
This commit changes `Token::String` so it holds a `Cow<'static, str>`
instead of a `String`, which avoids a lot of allocations.
|
|
|
|
|
|
Use per-span hygiene in a few other places in resolve
Prefer `rust_2015`/`rust_2018` helpers to comparing editions
|
|
|
|
|
|
|
|
|
|
fix #55972: Erroneous self arguments on bare functions emit subpar compilation error
#55972
r? @estebank
|
|
|
|
Ignore non-semantic tokens for 'probably_eq' streams.
Improves the situation in #43081 by skipping typically non-semantic tokens when checking for 'probably_eq'.
r? @alexcrichton
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This avoids a moderately hot allocation in `parse_lit_token`.
|
|
Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.
Because it results in fewer allocations and small speedups on some
benchmarks.
|
|
Because it results in fewer allocations and small speedups on some
benchmarks.
|