about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/util/comments.rs
AgeCommit message (Collapse)AuthorLines
2025-01-26rustc_ast: replace some len-checks + indexing with slice patterns etc. 🧹Yotam Ofek-2/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-1/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-03-01Move `gather_comments`.Nicholas Nethercote-125/+1
To the module where it is used, so it doesn't have to be `pub`.
2023-07-23more clippy::style fixes:Matthias Krüger-1/+1
get_first single_char_add_str unnecessary_mut_passed manual_map manual_is_ascii_check
2023-01-30Replace enum `==`s with `match`es where it makes senseMaybe Waffle-16/+17
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-1/+1
2022-12-01Remove useless borrows and derefsMaybe Waffle-2/+2
2022-08-01Shrink `Token`.Nicholas Nethercote-4/+6
From 72 bytes to 12 bytes (on x86-64). There are two parts to this: - Changing various source code offsets from 64-bit to 32-bit. This is not a problem because the rest of rustc also uses 32-bit source code offsets. This means `Token` is no longer `Copy` but this causes no problems. - Removing the `RawStrError` from `LiteralKind`. Raw string literal invalidity is now indicated by a `None` value within `RawStr`/`RawByteStr`, and the new `validate_raw_str` function can be used to re-lex an invalid raw string literal to get the `RawStrError`. There is one very small change in behaviour. Previously, if a raw string literal matched both the `InvalidStarter` and `TooManyHashes` cases, the latter would override the former. This has now changed, because `raw_double_quoted_string` now uses `?` and so returns immediately upon detecting the `InvalidStarter` case. I think this is a slight improvement to report the earlier-detected error, and it explains the change in the `test_too_many_hashes` test. The commit also removes a couple of comments that refer to #77629 and say that the size of these types don't affect performance. These comments are wrong, though the performance effect is small.
2022-04-19rustc_metadata: Store a flag telling whether an item may have doc links in ↵Vadim Petrochenkov-0/+8
its attributes This should be cheap on rustc side, but it's significant optimization for rustdoc that won't need to decode and process attributes unnecessarily
2022-04-08Fix invalid array access in `beautify_doc_string`Guillaume Gomez-1/+4
2022-02-07Fix horizontal trim for block doc commentsGuillaume Gomez-5/+11
2022-01-19Correctly handle starts in block doc commentsGuillaume Gomez-4/+25
2021-12-28Fix invalid removal of backlines from doc commentsGuillaume Gomez-7/+0
2021-11-10Rollup merge of #90742 - est31:add_assign, r=davidtwcoMatthias Krüger-1/+1
Use AddAssign impl
2021-11-09Use AddAssign implest31-1/+1
2021-11-06Fix last doc code comment being removed if it only had one characterGuillaume Gomez-1/+1
2020-12-28Rollup merge of #80344 - matthiaskrgr:matches, r=Dylan-DPCDylan DPC-4/+2
use matches!() macro in more places
2020-12-24use matches!() macro in more placesMatthias Krüger-4/+2
2020-12-22Rework beautify_doc_string so that it returns a Symbol instead of a StringGuillaume Gomez-28/+30
2020-08-30mv compiler to compiler/mark-0/+222