about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/token.rs
AgeCommit message (Collapse)AuthorLines
2021-10-04Use `TokenKind::similar_tokens()`Fabian Wolff-0/+1
2021-09-04Fix formattingTheodore Luo Wang-1/+4
2021-09-04Use verbose suggestions and only match if the + is seen before a numeric literalTheodore Luo Wang-0/+4
2021-08-22Fix typos “a”→“an”Frank Steffahn-1/+1
2021-04-27remove pat2021mark-10/+3
2021-04-15rename pat2015 to pat_parammark-7/+7
2021-03-22rename :pat2018 -> :pat215mark-7/+7
2021-03-15Extend `proc_macro_back_compat` lint to `procedural-masquerade`Aaron Hill-27/+0
We now lint on *any* use of `procedural-masquerade` crate. While this crate still exists, its main reverse dependency (`cssparser`) no longer depends on it. Any crates still depending off should stop doing so, as it only exists to support very old Rust versions. If a crate actually needs to support old versions of rustc via `procedural-masquerade`, then they'll just need to accept the warning until we remove it entirely (at the same time as the back-compat hack). The latest version of `procedural-masquerade` does not work with the latest rustc, but trying to check for the version seems like more trouble than it's worth. While working on this, I realized that the `proc-macro-hack` check was never actually doing anything. The corresponding enum variant in `proc-macro-hack` is named `Value` or `Nested` - it has never been called `Input`. Due to a strange Crater issue, the Crater run that tested adding this did *not* end up testing it - some of the crates that would have failed did not actually have their tests checked, making it seem as though the `proc-macro-hack` check was working. The Crater issue is being discussed at https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Nearly.20identical.20Crater.20runs.20processed.20a.20crate.20differently/near/230406661 Despite the `proc-macro-hack` check not actually doing anything, we haven't gotten any reports from users about their build being broken. I went ahead and removed it entirely, since it's clear that no one is being affected by the `proc-macro-hack` regression in practice.
2021-03-14Introduce `proc_macro_back_compat` lint, and emit for `time-macros-impl`Aaron Hill-49/+1
Now that future-incompat-report support has landed in nightly Cargo, we can start to make progress towards removing the various proc-macro back-compat hacks that have accumulated in the compiler. This PR introduces a new lint `proc_macro_back_compat`, which results in a future-incompat-report entry being generated. All proc-macro back-compat warnings will be grouped under this lint. Note that this lint will never actually become a hard error - instead, we will remove the special cases for various macros, which will cause older versions of those crates to emit some other error. I've added code to fire this lint for the `time-macros-impl` case. This is the easiest case out of all of our current back-compat hacks - the crate was renamed to `time-macros`, so seeing a filename with `time-macros-impl` guarantees that an older version of the parent `time` crate is in use. When Cargo's future-incompat-report feature gets stabilized, affected users will start to see future-incompat warnings when they build their crates.
2021-03-06Change x64 size checks to not apply to x32.Harald van Dijk-2/+2
Rust contains various size checks conditional on target_arch = "x86_64", but these checks were never intended to apply to x86_64-unknown-linux-gnux32. Add target_pointer_width = "64" to the conditions.
2021-01-07rustc_parse: Better spans for synthesized token streamsVadim Petrochenkov-1/+1
2020-12-31Enable Pat2021 in edition 2021.Mara Bos-2/+1
2020-12-30Implement edition-based macro pat featuremark-5/+30
2020-12-24use matches!() macro in more placesMatthias Krüger-34/+19
2020-12-17docs: Edit rustc_ast::token::Tokenpierwill-1/+1
Add missing punctuation.
2020-11-25Adjust pretty-print compat hack to work with item statementsAaron Hill-7/+14
2020-10-26Suggest expressions that look like const generic arguments should be ↵varkor-0/+7
enclosed in brackets Co-Authored-By: Esteban Kuber <github@kuber.com.ar>
2020-10-16Parse inline const expressionsSantiago Pastorino-0/+1
2020-10-15Rollup merge of #77739 - est31:remove_unused_code, r=petrochenkov,varkorYuki Okushi-10/+0
Remove unused code Rustc has a builtin lint for detecting unused code inside a crate, but when an item is marked `pub`, the code, even if unused inside the entire workspace, is never marked as such. Therefore, I've built [warnalyzer](https://github.com/est31/warnalyzer) to detect unused items in a cross-crate setting. Closes https://github.com/est31/warnalyzer/issues/2
2020-10-14Remove unused code from rustc_astest31-10/+0
2020-10-11Add hack to keep `actix-web` and `actori-web` compilingAaron Hill-5/+16
This extends the existing `ident_name_compatibility_hack` to handle the `tuple_from_req` macro defined in `actix-web` (and its fork `actori-web`).
2020-09-10Fully integrate token collection for additional AST structsAaron Hill-1/+1
This commit contains miscellaneous changes that don't fit into any of the other commits in this PR
2020-09-07Rollup merge of #76274 - scottmcm:fix-76271, r=petrochenkovDylan DPC-0/+1
Allow try blocks as the argument to return expressions Fixes #76271 I don't think this needs to be edition-aware (phew) since `return try` in 2015 is also the start of an expression, just with a struct literal instead of a block (`return try { x: 4, y: 5 }`).
2020-09-04Account for version number in NtIdent hackAaron Hill-3/+13
Issue #74616 tracks a backwards-compatibility hack for certain macros. This has is implemented by hard-coding the filenames and macro names of certain code that we want to continue to compile. However, the initial implementation of the hack was based on the directory structure when building the crate from its repository (e.g. `js-sys/src/lib.rs`). When the crate is build as a dependency, it will include a version number from the clone from the cargo registry (e.g. `js-sys-0.3.17/src/lib.rs`), which would fail the check. This commit modifies the backwards-compatibility hack to check that desired crate name (`js-sys` or `time-macros-impl`) is a prefix of the proper part of the path. See https://github.com/rust-lang/rust/issues/76070#issuecomment-687215646 for more details.
2020-09-02Allow try blocks as the argument to return expressionsScott McMurray-0/+1
Fixes 76271
2020-09-01Remove trivia tokensAleksey Kladov-15/+3
2020-08-30mv compiler to compiler/mark-0/+884