Commit Graph

17 Commits

Author SHA1 Message Date
Matthias Krüger
af2b370100 more clippy::style fixes:
get_first
single_char_add_str
unnecessary_mut_passed
manual_map
manual_is_ascii_check
2023-07-23 23:39:04 +02:00
Maybe Waffle
fd649a3cc5 Replace enum ==s with matches where it makes sense 2023-01-30 12:26:26 +00:00
Jeremy Stucki
3dde32ca97 rustc: Remove needless lifetimes 2022-12-20 22:10:40 +01:00
Maybe Waffle
f2b97a8bfe Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
Nicholas Nethercote
99f5c79d64 Shrink Token.
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-08-01 08:53:04 +10:00
Vadim Petrochenkov
e2d3a4f631 rustc_metadata: Store a flag telling whether an item may have doc links in 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-19 22:53:46 +03:00
Guillaume Gomez
43d0497824 Fix invalid array access in beautify_doc_string 2022-04-08 15:30:37 +02:00
Guillaume Gomez
e3942874a0 Fix horizontal trim for block doc comments 2022-02-07 16:50:45 +01:00
Guillaume Gomez
2938be612d Correctly handle starts in block doc comments 2022-01-19 11:18:17 +01:00
Guillaume Gomez
ee97600a6f Fix invalid removal of backlines from doc comments 2021-12-28 17:09:22 +01:00
Matthias Krüger
0a9c1be100 Rollup merge of #90742 - est31:add_assign, r=davidtwco
Use AddAssign impl
2021-11-10 18:52:29 +01:00
est31
9afb241af5 Use AddAssign impl 2021-11-09 23:47:36 +01:00
Guillaume Gomez
e8f1d57d80 Fix last doc code comment being removed if it only had one character 2021-11-06 20:21:29 +01:00
Dylan DPC
c51172f38a Rollup merge of #80344 - matthiaskrgr:matches, r=Dylan-DPC
use matches!() macro in more places
2020-12-28 14:13:12 +01:00
Matthias Krüger
d12a358673 use matches!() macro in more places 2020-12-24 13:35:12 +01:00
Guillaume Gomez
64afdedfb8 Rework beautify_doc_string so that it returns a Symbol instead of a String 2020-12-22 16:05:38 +01:00
mark
9e5f7d5631 mv compiler to compiler/ 2020-08-30 18:45:07 +03:00