]> git.proxmox.com Git - rustc.git/blobdiff - src/librustc/infer/combine.rs
New upstream version 1.34.2+dfsg1
[rustc.git] / src / librustc / infer / combine.rs
index 97f9c2ceba005fcf4a58fb1ff9515da493517b63..9cd5a844f15900a178ce8b9755783d8b0d34059d 100644 (file)
@@ -29,13 +29,13 @@ use super::lub::Lub;
 use super::sub::Sub;
 use super::type_variable::TypeVariableValue;
 
-use hir::def_id::DefId;
-use ty::{IntType, UintType};
-use ty::{self, Ty, TyCtxt};
-use ty::error::TypeError;
-use ty::relate::{self, Relate, RelateResult, TypeRelation};
-use ty::subst::Substs;
-use traits::{Obligation, PredicateObligations};
+use crate::hir::def_id::DefId;
+use crate::ty::{IntType, UintType};
+use crate::ty::{self, Ty, TyCtxt};
+use crate::ty::error::TypeError;
+use crate::ty::relate::{self, Relate, RelateResult, TypeRelation};
+use crate::ty::subst::Substs;
+use crate::traits::{Obligation, PredicateObligations};
 
 use syntax::ast;
 use syntax_pos::Span;
@@ -165,8 +165,8 @@ impl<'infcx, 'gcx, 'tcx> CombineFields<'infcx, 'gcx, 'tcx> {
         Glb::new(self, a_is_expected)
     }
 
-    /// Here dir is either EqTo, SubtypeOf, or SupertypeOf. The
-    /// idea is that we should ensure that the type `a_ty` is equal
+    /// Here, `dir` is either `EqTo`, `SubtypeOf`, or `SupertypeOf`.
+    /// The idea is that we should ensure that the type `a_ty` is equal
     /// to, a subtype of, or a supertype of (respectively) the type
     /// to which `b_vid` is bound.
     ///
@@ -294,7 +294,7 @@ impl<'infcx, 'gcx, 'tcx> CombineFields<'infcx, 'gcx, 'tcx> {
 struct Generalizer<'cx, 'gcx: 'cx+'tcx, 'tcx: 'cx> {
     infcx: &'cx InferCtxt<'cx, 'gcx, 'tcx>,
 
-    /// Span, used when creating new type variables and things.
+    /// The span, used when creating new type variables and things.
     span: Span,
 
     /// The vid of the type variable that is in the process of being
@@ -329,7 +329,7 @@ struct Generalization<'tcx> {
     /// particular around 'bivariant' type parameters that are only
     /// constrained by a where-clause. As an example, imagine a type:
     ///
-    ///     struct Foo<A, B> where A: Iterator<Item=B> {
+    ///     struct Foo<A, B> where A: Iterator<Item = B> {
     ///         data: A
     ///     }
     ///
@@ -342,7 +342,7 @@ struct Generalization<'tcx> {
     /// <: ?C`, but no particular relationship between `?B` and `?D`
     /// (after all, we do not know the variance of the normalized form
     /// of `A::Item` with respect to `A`). If we do nothing else, this
-    /// may mean that `?D` goes unconstrained (as in #41677).  So, in
+    /// may mean that `?D` goes unconstrained (as in #41677). So, in
     /// this scenario where we create a new type variable in a
     /// bivariant context, we set the `needs_wf` flag to true. This
     /// will force the calling code to check that `WF(Foo<?C, ?D>)`