Prefer doc comments over //-comments in compiler

This commit is contained in:
Maybe Waffle 2022-11-27 11:15:06 +00:00
parent 0e9eee6811
commit 1d42936b18
83 changed files with 400 additions and 387 deletions

View file

@ -26,9 +26,9 @@ use thin_vec::thin_vec;
pub struct MarkedAttrs(GrowableBitSet<AttrId>);
impl MarkedAttrs {
// We have no idea how many attributes there will be, so just
// initiate the vectors with 0 bits. We'll grow them as necessary.
pub fn new() -> Self {
// We have no idea how many attributes there will be, so just
// initiate the vectors with 0 bits. We'll grow them as necessary.
MarkedAttrs(GrowableBitSet::new_empty())
}
@ -174,9 +174,11 @@ impl MetaItem {
self.ident().unwrap_or_else(Ident::empty).name
}
// Example:
// #[attribute(name = "value")]
// ^^^^^^^^^^^^^^
/// ```text
/// Example:
/// #[attribute(name = "value")]
/// ^^^^^^^^^^^^^^
/// ```
pub fn name_value_literal(&self) -> Option<&Lit> {
match &self.kind {
MetaItemKind::NameValue(v) => Some(v),