1
Fork 0

Rollup merge of #104976 - WaffleLapkin:move_comments, r=cjgillot

Prefer doc comments over `//`-comments in compiler

Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.
This commit is contained in:
Matthias Krüger 2022-11-27 22:14:08 +01:00 committed by GitHub
commit 86304f5149
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
83 changed files with 400 additions and 387 deletions

View file

@ -590,7 +590,7 @@ impl UseSpans<'_> {
}
}
// Add a span label to the arguments of the closure, if it exists.
/// Add a span label to the arguments of the closure, if it exists.
pub(super) fn args_span_label(self, err: &mut Diagnostic, message: impl Into<String>) {
if let UseSpans::ClosureUse { args_span, .. } = self {
err.span_label(args_span, message);
@ -628,7 +628,7 @@ impl UseSpans<'_> {
}
}
// Add a span label to the use of the captured variable, if it exists.
/// Add a span label to the use of the captured variable, if it exists.
pub(super) fn var_span_label(
self,
err: &mut Diagnostic,

View file

@ -83,7 +83,7 @@ mod type_check;
mod universal_regions;
mod used_muts;
// A public API provided for the Rust compiler consumers.
/// A public API provided for the Rust compiler consumers.
pub mod consumers;
use borrow_set::{BorrowData, BorrowSet};

View file

@ -121,8 +121,8 @@ pub(super) fn populate_access_facts<'a, 'tcx>(
}
}
// For every potentially drop()-touched region `region` in `local`'s type
// (`kind`), emit a Polonius `use_of_var_derefs_origin(local, origin)` fact.
/// For every potentially drop()-touched region `region` in `local`'s type
/// (`kind`), emit a Polonius `use_of_var_derefs_origin(local, origin)` fact.
pub(super) fn add_drop_of_var_derefs_origin<'tcx>(
typeck: &mut TypeChecker<'_, 'tcx>,
local: Local,