diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-24 06:33:12 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-11-06 23:05:07 +1100 |
| commit | eea6f23a0ed67fd8c6b8e1b02cda3628fee56b2f (patch) | |
| tree | effdb244138f311440b21c9fd52e4028edb575ea /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 69bc4aba785e071740d2d46f109623b9951aae5d (diff) | |
| download | rust-eea6f23a0ed67fd8c6b8e1b02cda3628fee56b2f.tar.gz rust-eea6f23a0ed67fd8c6b8e1b02cda3628fee56b2f.zip | |
Make doc comments cheaper with `AttrKind`.
`AttrKind` is a new type with two variants, `Normal` and `DocComment`. It's a
big performance win (over 10% in some cases) because `DocComment` lets doc
comments (which are common) be represented very cheaply.
`Attribute` gets some new helper methods to ease the transition:
- `has_name()`: check if the attribute name matches a single `Symbol`; for
`DocComment` variants it succeeds if the symbol is `sym::doc`.
- `is_doc_comment()`: check if it has a `DocComment` kind.
- `{get,unwrap}_normal_item()`: extract the item from a `Normal` variant;
panic otherwise.
Fixes #60935.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
