Fixed nits raised in review.

This commit is contained in:
Alexander Regueiro 2019-05-20 16:19:34 +01:00
parent ce75a23c0d
commit ce2ee305f9
6 changed files with 13 additions and 13 deletions

View File

@ -2143,7 +2143,7 @@ pub enum UseKind {
ListStem,
}
/// `TraitRef` are references to traits in impls.
/// References to traits in impls.
///
/// `resolve` maps each `TraitRef`'s `ref_id` to its defining trait; that's all
/// that the `ref_id` is for. Note that `ref_id`'s value is not the `NodeId` of the

View File

@ -141,9 +141,9 @@ impl<'cx, 'gcx, 'tcx> VerifyBoundCx<'cx, 'gcx, 'tcx> {
}
fn recursive_type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx> {
let mut bounds: Vec<_> = ty.walk_shallow()
let mut bounds = ty.walk_shallow()
.map(|subty| self.type_bound(subty))
.collect();
.collect::<Vec<_>>();
let mut regions = smallvec![];
ty.push_regions(&mut regions);

View File

@ -248,12 +248,12 @@ rustc_queries! {
desc { "computing the variances for items in this crate" }
}
/// Maps from def-ID of a type or region parameter to its (inferred) variance.
/// Maps from the `DefId` of a type or region parameter to its (inferred) variance.
query variances_of(_: DefId) -> &'tcx [ty::Variance] {}
}
TypeChecking {
/// Maps from def-ID of a type to its (inferred) outlives.
/// Maps from thee `DefId` of a type to its (inferred) outlives.
query inferred_outlives_crate(_: CrateNum)
-> Lrc<ty::CratePredicatesMap<'tcx>> {
desc { "computing the inferred outlives predicates for items in this crate" }
@ -261,7 +261,7 @@ rustc_queries! {
}
Other {
/// Maps from an impl/trait def-ID to a list of the def-ids of its items.
/// Maps from an impl/trait `DefId to a list of the `DefId`s of its items.
query associated_item_def_ids(_: DefId) -> Lrc<Vec<DefId>> {}
/// Maps from a trait item to the trait item "descriptor".
@ -274,7 +274,7 @@ rustc_queries! {
}
TypeChecking {
/// Maps a def-ID of a type to a list of its inherent impls.
/// Maps a `DefId` of a type to a list of its inherent impls.
/// Contains implementations of methods that are inherent to a type.
/// Methods in these implementations don't need to be exported.
query inherent_impls(_: DefId) -> Lrc<Vec<DefId>> {

View File

@ -1216,7 +1216,7 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
let hir_id = self.tcx.hir().node_to_hir_id(id);
let access = access_from!(self.save_ctxt, root_item, hir_id);
// The parent def-ID of a given use tree is always the enclosing item.
// The parent `DefId` of a given use tree is always the enclosing item.
let parent = self.save_ctxt.tcx.hir().opt_local_def_id(id)
.and_then(|id| self.save_ctxt.tcx.parent(id))
.map(id_from_def_id);

View File

@ -702,7 +702,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
}
/// Instantiates the path for the given trait reference, assuming that it's
/// bound to a valid trait type. Returns the def-ID for the defining trait.
/// bound to a valid trait type. Returns the `DefId` of the defining trait.
/// The type _cannot_ be a type other than a trait type.
///
/// If the `projections` argument is `None`, then assoc type bindings like `Foo<T = X>`
@ -994,7 +994,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
// Expand trait aliases recursively and check that only one regular (non-auto) trait
// is used and no 'maybe' bounds are used.
let expanded_traits = traits::expand_trait_aliases(tcx, bound_trait_refs.clone());
let expanded_traits = traits::expand_trait_aliases(tcx, bound_trait_refs.iter().cloned());
let (mut auto_traits, regular_traits): (Vec<_>, Vec<_>) =
expanded_traits.partition(|i| tcx.trait_is_auto(i.trait_ref().def_id()));
if regular_traits.len() > 1 {
@ -1240,7 +1240,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
}
// Search for a bound on a type parameter which includes the associated item
// given by `assoc_name`. `ty_param_def_id` is the `DefId` for the type parameter
// given by `assoc_name`. `ty_param_def_id` is the `DefId` of the type parameter
// This function will fail if there are no suitable bounds or there is
// any ambiguity.
fn find_bound_for_assoc_item(&self,

View File

@ -713,9 +713,9 @@ fn super_predicates_of<'a, 'tcx>(
let superbounds1 = superbounds1.predicates(tcx, self_param_ty);
// Convert any explicit superbounds in the wheree-clause,
// Convert any explicit superbounds in the where-clause,
// e.g., `trait Foo where Self: Bar`.
// In the case of trait aliases, however, we include all bounds in the where clause,
// In the case of trait aliases, however, we include all bounds in the where-clause,
// so e.g., `trait Foo = where u32: PartialEq<Self>` would include `u32: PartialEq<Self>`
// as one of its "superpredicates".
let is_trait_alias = tcx.is_trait_alias(trait_def_id);