Skip to content

Commit

Permalink
Fixed nits raised in review.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Regueiro committed May 20, 2019
1 parent ce75a23 commit ce2ee30
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/librustc/hir/mod.rs
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/infer/outlives/verify.rs
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/query/mod.rs
Expand Up @@ -248,20 +248,20 @@ 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" }
}
}

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".
Expand All @@ -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>> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_save_analysis/dump_visitor.rs
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_typeck/astconv.rs
Expand Up @@ -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>`
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/collect.rs
Expand Up @@ -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);
Expand Down

0 comments on commit ce2ee30

Please sign in to comment.