diff options
| author | Alexander Regueiro <alexreg@me.com> | 2019-05-20 16:19:34 +0100 |
|---|---|---|
| committer | Alexander Regueiro <alexreg@me.com> | 2019-05-20 16:46:15 +0100 |
| commit | ce2ee305f9165c037ecddddb5792588a15ff6c37 (patch) | |
| tree | fcdb33e80e1c1d283d83c5226ddfc8f67f0084fc | |
| parent | ce75a23c0d56764cef7c633139f01b80f040cd25 (diff) | |
| download | rust-ce2ee305f9165c037ecddddb5792588a15ff6c37.tar.gz rust-ce2ee305f9165c037ecddddb5792588a15ff6c37.zip | |
Fixed nits raised in review.
| -rw-r--r-- | src/librustc/hir/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc/infer/outlives/verify.rs | 4 | ||||
| -rw-r--r-- | src/librustc/query/mod.rs | 8 | ||||
| -rw-r--r-- | src/librustc_save_analysis/dump_visitor.rs | 2 | ||||
| -rw-r--r-- | src/librustc_typeck/astconv.rs | 6 | ||||
| -rw-r--r-- | src/librustc_typeck/collect.rs | 4 |
6 files changed, 13 insertions, 13 deletions
diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index fafe1cf85a3..fd7a83427ef 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -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 diff --git a/src/librustc/infer/outlives/verify.rs b/src/librustc/infer/outlives/verify.rs index 5b8d89c865a..e1ad5aeea19 100644 --- a/src/librustc/infer/outlives/verify.rs +++ b/src/librustc/infer/outlives/verify.rs @@ -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); diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs index d043a32f06b..8825c94cdb8 100644 --- a/src/librustc/query/mod.rs +++ b/src/librustc/query/mod.rs @@ -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>> { diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index 5f184bf4a7d..1fdfcc84926 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -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); diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index ce5963e3ce5..4110a558401 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -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, diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 104c8e25d13..7adf86a99bd 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -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); |
