| Age | Commit message (Collapse) | Author | Lines |
|
attribute_to_string exists.
|
|
|
|
Fix pretty-printing of `$crate` (take 4)
Pretty-print `$crate` as `crate` or `crate_name` in unstructured tokens like `a $crate c` in `foo!(a $crate c)`, but only if those tokens are printed as a part of AST pretty-printing, rather than as a standalone token stream.
Fixes https://github.com/rust-lang/rust/issues/62325
Previous iterations - https://github.com/rust-lang/rust/pull/56647, https://github.com/rust-lang/rust/pull/57155, https://github.com/rust-lang/rust/pull/57915.
|
|
Stop visiting AST to discover those contexts, just iterate through hygiene data instead
|
|
...but only if those tokens are printed from inside of AST pretty-printing.
|
|
https://github.com/rust-lang/rust/issues/60532
|
|
This commit adds a `const_in_array_repeat_expressions` feature gate and
only create `Candidate::Repeat` if it is enabled.
|
|
rustdoc: set cfg(doctest) when collecting doctests
Note: This PR builds on top of https://github.com/rust-lang/rust/pull/61199; only the last commit is specific to this PR.
As discussed in https://github.com/rust-lang/rust/pull/61199, we want the ability to isolate items to only when rustdoc is collecting doctests, but we can't use `cfg(test)` because of libcore's `#![cfg(not(test))]`. This PR proposes a new cfg flag, `cfg(doctest)`, specific to this situation, rather than reusing an existing flag. I've isolated it behind a feature gate so that we can contain the effects to nightly only. (A stable workaround that can be used in lieu of `#[cfg(doctest)]` is `#[cfg(rustdoc)] #[doc(hidden)]`, at least once https://github.com/rust-lang/rust/pull/61351 lands.)
Tracking issue: https://github.com/rust-lang/rust/issues/62210
|
|
Support stability and deprecation checking for all macros
RELNOTES: Deprecation attributes on macros now have effect.
Fixes https://github.com/rust-lang/rust/issues/34079
Fixes https://github.com/rust-lang/rust/issues/49912
Unblocks https://github.com/rust-lang/rust/pull/62086
Unblocks https://github.com/rust-lang/rust/pull/61000
|
|
They always end up interned anyway
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Now that procedural macros no longer link transitively to libsyntax,
this shouldn't be needed any more! This commit is an experiment in
removing all dynamic libraries from rustc except for librustc_driver
itself. Let's see how far we can get with that!
|
|
|
|
|
|
|
|
|
|
Remove support for 1-token lookahead from the lexer
`StringReader` maintained `peek_token` and `peek_span_src_raw` for look ahead.
`peek_token` was used only by rustdoc syntax coloring. After moving peeking logic into highlighter, I was able to remove `peek_token` from the lexer. I tried to use `iter::Peekable`, but that wasn't as pretty as I hoped, due to buffered fatal errors. So I went with hand-rolled peeking.
After that I've noticed that the only peeking behavior left was for raw tokens to test tt jointness. I've rewritten it in terms of trivia tokens, and not just spans.
After that it became possible to simplify the awkward constructor of the lexer, which could return `Err` if the first peeked token contained error.
|
|
Feature gate `rustc` attributes harder
Fixes https://github.com/rust-lang/rust/issues/62116
|
|
Implement another internal lints
cc #49509
This adds ~~two~~ one internal lint~~s~~:
1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669
2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~
~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~
TODO (not directly relevant for review):
- [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) :thinking: cc @eddyb)
- [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870
- [x] Check explicitly for the `{declare,impl}_lint_pass!` macros
r? @oli-obk
|
|
Move `async || ...` closures into `#![feature(async_closure)]`
The `async || expr` syntax is moved out from `#![feature(async_await)]` into its own gate `#![feature(async_closure)]`.
New tracking issue: https://github.com/rust-lang/rust/issues/62290
Closes https://github.com/rust-lang/rust/issues/62214.
cc https://github.com/rust-lang/rust/issues/62149
r? @varkor
|
|
Remove io::Result from syntax::print
Since we're now writing directly to the vector, there's no need to
thread results through the whole printing infrastructure
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The reader itself doesn't need ability to peek tokens, so it's better
if clients implement this functionality.
This hopefully becomes especially easy once we use iterator interface
for lexer, but this is not too easy at the moment, because of buffered
errors.
|
|
refactor check_for_substitution
No behavior change, just flatter and simpler code.
r? @petrochenkov
|
|
syntax: Unsupport `foo! bar { ... }` macros in the parser
Their support in expansion was removed in https://github.com/rust-lang/rust/pull/61606.
Also un-reserve `macro_rules` as a macro name, there's no ambiguity between `macro_rules` definitions and macro calls (it also wasn't reserved correctly).
cc https://github.com/rust-lang-nursery/wg-grammar/issues/51
|
|
r=dtolnay,Centril
Use mem::take instead of mem::replace with default
|
|
Remove needless lifetimes (rustc)
|
|
|
|
Rollup of 15 pull requests
Successful merges:
- #62021 (MSVC link output improve)
- #62064 (nth_back for chunks_exact)
- #62128 (Adjust warning of -C extra-filename with -o.)
- #62161 (Add missing links for TryFrom docs)
- #62183 (std: Move a process test out of libstd)
- #62186 (Add missing type urls in Into trait)
- #62196 (Add Vec::leak)
- #62199 (import gdb for explicit access to gdb.current_objfile())
- #62229 (Enable intptrcast for explicit casts)
- #62250 (Improve box clone doctests to ensure the documentation is valid)
- #62255 (Switch tracking issue for `#![feature(slice_patterns)]`)
- #62285 (Fix michaelwoerister's mailmap)
- #62304 (HashMap is UnwindSafe)
- #62319 (Fix mismatching Kleene operators)
- #62327 (Fixed document bug, those replaced each other)
Failed merges:
r? @ghost
|
|
Switch tracking issue for `#![feature(slice_patterns)]`
Switches the tracking issue for `#![feature(slice_patterns)]` to a fresh one in https://github.com/rust-lang/rust/issues/62254 due to new RFCs.
Closes https://github.com/rust-lang/rust/issues/23121.
r? @varkor
|
|
rustc: use a separate copy of P for HIR than for AST.
Note: this currently includes/is based on top of #61987.
Like #61968, but goes one step further and uses a separate `P<...>` for the HIR, with no `Clone`, or the ability to mutate after allocation.
There is still `into_inner`/`into_iter`, but they're only exposed for `hir::lowering`, and they would take more work to untangle.
r? @petrochenkov cc @rust-lang/compiler
|
|
|
|
|
|
|
|
Minimizes risk.
|
|
No behavior change, just flatter and simpler code
|
|
|