Skip to content

Commit ce2ee30

Browse files
author
Alexander Regueiro
committed
Fixed nits raised in review.
1 parent ce75a23 commit ce2ee30

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/librustc/hir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2143,7 +2143,7 @@ pub enum UseKind {
21432143
ListStem,
21442144
}
21452145

2146-
/// `TraitRef` are references to traits in impls.
2146+
/// References to traits in impls.
21472147
///
21482148
/// `resolve` maps each `TraitRef`'s `ref_id` to its defining trait; that's all
21492149
/// that the `ref_id` is for. Note that `ref_id`'s value is not the `NodeId` of the

src/librustc/infer/outlives/verify.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ impl<'cx, 'gcx, 'tcx> VerifyBoundCx<'cx, 'gcx, 'tcx> {
141141
}
142142

143143
fn recursive_type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx> {
144-
let mut bounds: Vec<_> = ty.walk_shallow()
144+
let mut bounds = ty.walk_shallow()
145145
.map(|subty| self.type_bound(subty))
146-
.collect();
146+
.collect::<Vec<_>>();
147147

148148
let mut regions = smallvec![];
149149
ty.push_regions(&mut regions);

src/librustc/query/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -248,20 +248,20 @@ rustc_queries! {
248248
desc { "computing the variances for items in this crate" }
249249
}
250250

251-
/// Maps from def-ID of a type or region parameter to its (inferred) variance.
251+
/// Maps from the `DefId` of a type or region parameter to its (inferred) variance.
252252
query variances_of(_: DefId) -> &'tcx [ty::Variance] {}
253253
}
254254

255255
TypeChecking {
256-
/// Maps from def-ID of a type to its (inferred) outlives.
256+
/// Maps from thee `DefId` of a type to its (inferred) outlives.
257257
query inferred_outlives_crate(_: CrateNum)
258258
-> Lrc<ty::CratePredicatesMap<'tcx>> {
259259
desc { "computing the inferred outlives predicates for items in this crate" }
260260
}
261261
}
262262

263263
Other {
264-
/// Maps from an impl/trait def-ID to a list of the def-ids of its items.
264+
/// Maps from an impl/trait `DefId to a list of the `DefId`s of its items.
265265
query associated_item_def_ids(_: DefId) -> Lrc<Vec<DefId>> {}
266266

267267
/// Maps from a trait item to the trait item "descriptor".
@@ -274,7 +274,7 @@ rustc_queries! {
274274
}
275275

276276
TypeChecking {
277-
/// Maps a def-ID of a type to a list of its inherent impls.
277+
/// Maps a `DefId` of a type to a list of its inherent impls.
278278
/// Contains implementations of methods that are inherent to a type.
279279
/// Methods in these implementations don't need to be exported.
280280
query inherent_impls(_: DefId) -> Lrc<Vec<DefId>> {

src/librustc_save_analysis/dump_visitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
12161216
let hir_id = self.tcx.hir().node_to_hir_id(id);
12171217
let access = access_from!(self.save_ctxt, root_item, hir_id);
12181218

1219-
// The parent def-ID of a given use tree is always the enclosing item.
1219+
// The parent `DefId` of a given use tree is always the enclosing item.
12201220
let parent = self.save_ctxt.tcx.hir().opt_local_def_id(id)
12211221
.and_then(|id| self.save_ctxt.tcx.parent(id))
12221222
.map(id_from_def_id);

src/librustc_typeck/astconv.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
702702
}
703703

704704
/// Instantiates the path for the given trait reference, assuming that it's
705-
/// bound to a valid trait type. Returns the def-ID for the defining trait.
705+
/// bound to a valid trait type. Returns the `DefId` of the defining trait.
706706
/// The type _cannot_ be a type other than a trait type.
707707
///
708708
/// 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 {
994994

995995
// Expand trait aliases recursively and check that only one regular (non-auto) trait
996996
// is used and no 'maybe' bounds are used.
997-
let expanded_traits = traits::expand_trait_aliases(tcx, bound_trait_refs.clone());
997+
let expanded_traits = traits::expand_trait_aliases(tcx, bound_trait_refs.iter().cloned());
998998
let (mut auto_traits, regular_traits): (Vec<_>, Vec<_>) =
999999
expanded_traits.partition(|i| tcx.trait_is_auto(i.trait_ref().def_id()));
10001000
if regular_traits.len() > 1 {
@@ -1240,7 +1240,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
12401240
}
12411241

12421242
// Search for a bound on a type parameter which includes the associated item
1243-
// given by `assoc_name`. `ty_param_def_id` is the `DefId` for the type parameter
1243+
// given by `assoc_name`. `ty_param_def_id` is the `DefId` of the type parameter
12441244
// This function will fail if there are no suitable bounds or there is
12451245
// any ambiguity.
12461246
fn find_bound_for_assoc_item(&self,

src/librustc_typeck/collect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,9 @@ fn super_predicates_of<'a, 'tcx>(
713713

714714
let superbounds1 = superbounds1.predicates(tcx, self_param_ty);
715715

716-
// Convert any explicit superbounds in the wheree-clause,
716+
// Convert any explicit superbounds in the where-clause,
717717
// e.g., `trait Foo where Self: Bar`.
718-
// In the case of trait aliases, however, we include all bounds in the where clause,
718+
// In the case of trait aliases, however, we include all bounds in the where-clause,
719719
// so e.g., `trait Foo = where u32: PartialEq<Self>` would include `u32: PartialEq<Self>`
720720
// as one of its "superpredicates".
721721
let is_trait_alias = tcx.is_trait_alias(trait_def_id);

0 commit comments

Comments
 (0)