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

@ -850,7 +850,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
.is_some()
}
// Sets `implicitly_sized` to true on `Bounds` if necessary
/// Sets `implicitly_sized` to true on `Bounds` if necessary
pub(crate) fn add_implicitly_sized<'hir>(
&self,
bounds: &mut Bounds<'hir>,
@ -2390,7 +2390,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
path_segs
}
// Check a type `Path` and convert it to a `Ty`.
/// Check a type `Path` and convert it to a `Ty`.
pub fn res_to_ty(
&self,
opt_self_ty: Option<Ty<'tcx>>,

View file

@ -233,9 +233,10 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
result
}
// This is an implementation of the TypeRelation trait with the
// aim of simply comparing for equality (without side-effects).
// It is not intended to be used anywhere else other than here.
/// This is an implementation of the [`TypeRelation`] trait with the
/// aim of simply comparing for equality (without side-effects).
///
/// It is not intended to be used anywhere else other than here.
pub(crate) struct SimpleEqRelation<'tcx> {
tcx: TyCtxt<'tcx>,
param_env: ty::ParamEnv<'tcx>,

View file

@ -42,22 +42,22 @@ impl<'a> fmt::Debug for VarianceTerm<'a> {
}
}
// The first pass over the crate simply builds up the set of inferreds.
/// The first pass over the crate simply builds up the set of inferreds.
pub struct TermsContext<'a, 'tcx> {
pub tcx: TyCtxt<'tcx>,
pub arena: &'a DroplessArena,
// For marker types, UnsafeCell, and other lang items where
// variance is hardcoded, records the item-id and the hardcoded
// variance.
/// For marker types, `UnsafeCell`, and other lang items where
/// variance is hardcoded, records the item-id and the hardcoded
/// variance.
pub lang_items: Vec<(LocalDefId, Vec<ty::Variance>)>,
// Maps from the node id of an item to the first inferred index
// used for its type & region parameters.
/// Maps from the node id of an item to the first inferred index
/// used for its type & region parameters.
pub inferred_starts: LocalDefIdMap<InferredIndex>,
// Maps from an InferredIndex to the term for that variable.
/// Maps from an InferredIndex to the term for that variable.
pub inferred_terms: Vec<VarianceTermPtr<'a>>,
}