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

@ -242,8 +242,8 @@ pub enum ExpandResult<T, U> {
Retry(U),
}
// `meta_item` is the attribute, and `item` is the item being modified.
pub trait MultiItemModifier {
/// `meta_item` is the attribute, and `item` is the item being modified.
fn expand(
&self,
ecx: &mut ExtCtxt<'_>,

View file

@ -193,7 +193,7 @@ impl<'a> ExtCtxt<'a> {
self.stmt_local(local, sp)
}
// Generates `let _: Type;`, which is usually used for type assertions.
/// Generates `let _: Type;`, which is usually used for type assertions.
pub fn stmt_let_type_only(&self, span: Span, ty: P<ast::Ty>) -> ast::Stmt {
let local = P(ast::Local {
pat: self.pat_wild(span),

View file

@ -200,7 +200,7 @@ fn get_features(
features
}
// `cfg_attr`-process the crate's attributes and compute the crate's features.
/// `cfg_attr`-process the crate's attributes and compute the crate's features.
pub fn features(
sess: &Session,
mut krate: ast::Crate,

View file

@ -401,7 +401,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
krate
}
// Recursively expand all macro invocations in this AST fragment.
/// Recursively expand all macro invocations in this AST fragment.
pub fn fully_expand_fragment(&mut self, input_fragment: AstFragment) -> AstFragment {
let orig_expansion_data = self.cx.current_expansion.clone();
let orig_force_mode = self.cx.force_mode;
@ -1931,9 +1931,12 @@ pub struct ExpansionConfig<'feat> {
pub features: Option<&'feat Features>,
pub recursion_limit: Limit,
pub trace_mac: bool,
pub should_test: bool, // If false, strip `#[test]` nodes
pub span_debug: bool, // If true, use verbose debugging for `proc_macro::Span`
pub proc_macro_backtrace: bool, // If true, show backtraces for proc-macro panics
/// If false, strip `#[test]` nodes
pub should_test: bool,
/// If true, use verbose debugging for `proc_macro::Span`
pub span_debug: bool,
/// If true, show backtraces for proc-macro panics
pub proc_macro_backtrace: bool,
}
impl<'feat> ExpansionConfig<'feat> {