]> git.lizzy.rs Git - rust.git/commitdiff
int -> i32
authorBastian Kauschke <bastian_kauschke@hotmail.de>
Sat, 6 Jun 2020 10:05:37 +0000 (12:05 +0200)
committerBastian Kauschke <bastian_kauschke@hotmail.de>
Sat, 20 Jun 2020 08:49:43 +0000 (10:49 +0200)
12 files changed:
src/librustc_infer/traits/mod.rs
src/librustc_infer/traits/util.rs
src/librustc_middle/traits/mod.rs
src/librustc_middle/ty/subst.rs
src/librustc_middle/ty/walk.rs
src/librustc_trait_selection/traits/project.rs
src/librustc_trait_selection/traits/query/normalize.rs
src/librustc_trait_selection/traits/select/confirmation.rs
src/librustc_trait_selection/traits/select/mod.rs
src/librustc_typeck/astconv.rs
src/librustc_typeck/check/method/probe.rs
src/librustc_typeck/check/pat.rs

index a15ac819be966b3a1c2ee2680919c12703ffb305..47555aca9f3fbc95aa4b9edbf95c634fa0fa71dd 100644 (file)
 
 pub use rustc_middle::traits::*;
 
-/// An `Obligation` represents some trait reference (e.g., `int: Eq`) for
+/// An `Obligation` represents some trait reference (e.g., `i32: Eq`) for
 /// which the "impl_source" must be found. The process of finding a "impl_source" is
 /// called "resolving" the `Obligation`. This process consists of
-/// either identifying an `impl` (e.g., `impl Eq for int`) that
+/// either identifying an `impl` (e.g., `impl Eq for i32`) that
 /// satisfies the obligation, or else finding a bound that is in
 /// scope. The eventual result is usually a `Selection` (defined below).
 #[derive(Clone, PartialEq, Eq, Hash)]
index ee9846c64b67c1033608b52baf62e00cf11061e1..4ae7e417a8f673d017da6ca897d3cebe910a7eec 100644 (file)
@@ -63,11 +63,11 @@ fn new(tcx: TyCtxt<'tcx>) -> Self {
     fn insert(&mut self, pred: ty::Predicate<'tcx>) -> bool {
         // We have to be careful here because we want
         //
-        //    for<'a> Foo<&'a int>
+        //    for<'a> Foo<&'a i32>
         //
         // and
         //
-        //    for<'b> Foo<&'b int>
+        //    for<'b> Foo<&'b i32>
         //
         // to be considered equivalent. So normalize all late-bound
         // regions before we throw things into the underlying set.
index 17ea84836bf0adda03fb96886e3a2f369b4900d8..f650240a41c63fa641cc0c3292f2aeb7ec45463f 100644 (file)
@@ -393,23 +393,25 @@ pub enum SelectionError<'tcx> {
 /// ```
 /// impl<T:Clone> Clone<T> for Option<T> { ... } // Impl_1
 /// impl<T:Clone> Clone<T> for Box<T> { ... }    // Impl_2
-/// impl Clone for int { ... }             // Impl_3
+/// impl Clone for i32 { ... }                   // Impl_3
 ///
-/// fn foo<T:Clone>(concrete: Option<Box<int>>,
-///                 param: T,
-///                 mixed: Option<T>) {
+/// fn foo<T: Clone>(concrete: Option<Box<i32>>, param: T, mixed: Option<T>) {
+///     // Case A: Vtable points at a specific impl. Only possible when
+///     // type is concretely known. If the impl itself has bounded
+///     // type parameters, Vtable will carry resolutions for those as well:
+///     concrete.clone(); // Vtable(Impl_1, [Vtable(Impl_2, [Vtable(Impl_3)])])
 ///
-///    // Case A: ImplSource points at a specific impl. Only possible when
-///    // type is concretely known. If the impl itself has bounded
-///    // type parameters, ImplSource will carry resolutions for those as well:
-///    concrete.clone(); // ImplSource(Impl_1, [ImplSource(Impl_2, [ImplSource(Impl_3)])])
+///     // Case A: ImplSource points at a specific impl. Only possible when
+///     // type is concretely known. If the impl itself has bounded
+///     // type parameters, ImplSource will carry resolutions for those as well:
+///     concrete.clone(); // ImplSource(Impl_1, [ImplSource(Impl_2, [ImplSource(Impl_3)])])
 ///
-///    // Case B: ImplSource must be provided by caller. This applies when
-///    // type is a type parameter.
-///    param.clone();    // ImplSourceParam
+///     // Case B: ImplSource must be provided by caller. This applies when
+///     // type is a type parameter.
+///     param.clone();    // ImplSourceParam
 ///
-///    // Case C: A mix of cases A and B.
-///    mixed.clone();    // ImplSource(Impl_1, [ImplSourceParam])
+///     // Case C: A mix of cases A and B.
+///     mixed.clone();    // ImplSource(Impl_1, [ImplSourceParam])
 /// }
 /// ```
 ///
index 1529f1173b391caea5df017e76d86b1e957eb646..3b4254a18ea61900ad3e6c4bdcc98f07b7e8684b 100644 (file)
@@ -599,12 +599,12 @@ fn const_for_param(
     ///
     /// ```
     /// type Func<A> = fn(A);
-    /// type MetaFunc = for<'a> fn(Func<&'a int>)
+    /// type MetaFunc = for<'a> fn(Func<&'a i32>)
     /// ```
     ///
     /// The type `MetaFunc`, when fully expanded, will be
     ///
-    ///     for<'a> fn(fn(&'a int))
+    ///     for<'a> fn(fn(&'a i32))
     ///             ^~ ^~ ^~~
     ///             |  |  |
     ///             |  |  DebruijnIndex of 2
@@ -613,7 +613,7 @@ fn const_for_param(
     /// Here the `'a` lifetime is bound in the outer function, but appears as an argument of the
     /// inner one. Therefore, that appearance will have a DebruijnIndex of 2, because we must skip
     /// over the inner binder (remember that we count De Bruijn indices from 1). However, in the
-    /// definition of `MetaFunc`, the binder is not visible, so the type `&'a int` will have a
+    /// definition of `MetaFunc`, the binder is not visible, so the type `&'a i32` will have a
     /// De Bruijn index of 1. It's only during the substitution that we can see we must increase the
     /// depth by 1 to account for the binder that we passed through.
     ///
@@ -621,18 +621,18 @@ fn const_for_param(
     ///
     /// ```
     /// type FuncTuple<A> = (A,fn(A));
-    /// type MetaFuncTuple = for<'a> fn(FuncTuple<&'a int>)
+    /// type MetaFuncTuple = for<'a> fn(FuncTuple<&'a i32>)
     /// ```
     ///
     /// Here the final type will be:
     ///
-    ///     for<'a> fn((&'a int, fn(&'a int)))
+    ///     for<'a> fn((&'a i32, fn(&'a i32)))
     ///                 ^~~         ^~~
     ///                 |           |
     ///          DebruijnIndex of 1 |
     ///                      DebruijnIndex of 2
     ///
-    /// As indicated in the diagram, here the same type `&'a int` is substituted once, but in the
+    /// As indicated in the diagram, here the same type `&'a i32` is substituted once, but in the
     /// first case we do not increase the De Bruijn index and in the second case we do. The reason
     /// is that only in the second case have we passed through a fn binder.
     fn shift_vars_through_binders<T: TypeFoldable<'tcx>>(&self, val: T) -> T {
index d6f504fdb338bff1e68880aa7d2e48b2b2569eab..633d4fda8a46d9691711df2633ab97daeb730c63 100644 (file)
@@ -22,13 +22,13 @@ pub fn new(root: GenericArg<'tcx>) -> TypeWalker<'tcx> {
     /// Skips the subtree corresponding to the last type
     /// returned by `next()`.
     ///
-    /// Example: Imagine you are walking `Foo<Bar<int>, usize>`.
+    /// Example: Imagine you are walking `Foo<Bar<i32>, usize>`.
     ///
     /// ```
     /// let mut iter: TypeWalker = ...;
     /// iter.next(); // yields Foo
-    /// iter.next(); // yields Bar<int>
-    /// iter.skip_current_subtree(); // skips int
+    /// iter.next(); // yields Bar<i32>
+    /// iter.skip_current_subtree(); // skips i32
     /// iter.next(); // yields usize
     /// ```
     pub fn skip_current_subtree(&mut self) {
index 706e68698eb5575fb6ae28b52723fb47844e835b..196405425473428ee199387a9abd4fdc0335fe18 100644 (file)
@@ -361,7 +361,7 @@ fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
                 // handle normalization within binders because
                 // otherwise we wind up a need to normalize when doing
                 // trait matching (since you can have a trait
-                // obligation like `for<'a> T::B : Fn(&'a int)`), but
+                // obligation like `for<'a> T::B: Fn(&'a i32)`), but
                 // we can't normalize with bound regions in scope. So
                 // far now we just ignore binders but only normalize
                 // if all bound regions are gone (and then we still
index 3e7749356d212ac439bf4deea5821456f9e7d257..ca49ff5884f98a7080dd4b6cd7fbf12e19e26787 100644 (file)
@@ -145,7 +145,7 @@ fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
                 // handle normalization within binders because
                 // otherwise we wind up a need to normalize when doing
                 // trait matching (since you can have a trait
-                // obligation like `for<'a> T::B : Fn(&'a int)`), but
+                // obligation like `for<'a> T::B: Fn(&'a i32)`), but
                 // we can't normalize with bound regions in scope. So
                 // far now we just ignore binders but only normalize
                 // if all bound regions are gone (and then we still
index f8d26c06a219d8546aa3471be5532a89ef7e1fb0..50c04e8fc345248ed04a7eecc44dda84bd7b0913 100644 (file)
@@ -553,14 +553,14 @@ fn confirm_closure_candidate(
     ///
     /// Here is an example. Imagine we have a closure expression
     /// and we desugared it so that the type of the expression is
-    /// `Closure`, and `Closure` expects an int as argument. Then it
+    /// `Closure`, and `Closure` expects `i32` as argument. Then it
     /// is "as if" the compiler generated this impl:
     ///
-    ///     impl Fn(int) for Closure { ... }
+    ///     impl Fn(i32) for Closure { ... }
     ///
-    /// Now imagine our obligation is `Fn(usize) for Closure`. So far
+    /// Now imagine our obligation is `Closure: Fn(usize)`. So far
     /// we have matched the self type `Closure`. At this point we'll
-    /// compare the `int` to `usize` and generate an error.
+    /// compare the `i32` to `usize` and generate an error.
     ///
     /// Note that this checking occurs *after* the impl has selected,
     /// because these output type parameters should not affect the
index c3b1079fb1284248d7129d4cb3cc3211f3515e31..7dc8c2cf4cdc2a46328affd3a0e79304e3db9e8b 100644 (file)
@@ -1762,7 +1762,7 @@ fn collect_predicates_for_types(
         // The strategy is to:
         //
         // 1. Instantiate those regions to placeholder regions (e.g.,
-        //    `for<'a> &'a int` becomes `&0 i32`.
+        //    `for<'a> &'a i32` becomes `&0 i32`.
         // 2. Produce something like `&'0 i32 : Copy`
         // 3. Re-bind the regions back to `for<'a> &'a i32 : Copy`
 
index b592d30c37d3cc0c422c1aa9320359b494c908ef..33d57e25711733b5217da9b3c8031fe109f9471a 100644 (file)
@@ -1394,13 +1394,13 @@ fn add_predicates_for_ast_type_binding(
             // That is, consider this case:
             //
             // ```
-            // trait SubTrait: SuperTrait<int> { }
+            // trait SubTrait: SuperTrait<i32> { }
             // trait SuperTrait<A> { type T; }
             //
             // ... B: SubTrait<T = foo> ...
             // ```
             //
-            // We want to produce `<B as SuperTrait<int>>::T == foo`.
+            // We want to produce `<B as SuperTrait<i32>>::T == foo`.
 
             // Find any late-bound regions declared in `ty` that are not
             // declared in the trait-ref. These are not well-formed.
index eb8f76687174e90a5b4614bbd119da19e5910e57..efd23894d02d159b8fcc4d80b53afe3664f90643 100644 (file)
@@ -1468,7 +1468,7 @@ fn consider_probe(
     ///
     /// ```
     /// trait Foo { ... }
-    /// impl Foo for Vec<int> { ... }
+    /// impl Foo for Vec<i32> { ... }
     /// impl Foo for Vec<usize> { ... }
     /// ```
     ///
index 7965c9c9ce12aed4d391d9359a26eac35abf46c0..ea47ae68ce7d36c63220b15c2140602a7765cc14 100644 (file)
@@ -212,7 +212,7 @@ fn check_pat(
         // errors in some cases, such as this one:
         //
         // ```
-        // fn foo<'x>(x: &'x int) {
+        // fn foo<'x>(x: &'x i32) {
         //    let a = 1;
         //    let mut z = x;
         //    z = &a;
@@ -220,7 +220,7 @@ fn check_pat(
         // ```
         //
         // The reason we might get an error is that `z` might be
-        // assigned a type like `&'x int`, and then we would have
+        // assigned a type like `&'x i32`, and then we would have
         // a problem when we try to assign `&a` to `z`, because
         // the lifetime of `&a` (i.e., the enclosing block) is
         // shorter than `'x`.
@@ -229,11 +229,11 @@ fn check_pat(
         // expected type here is whatever type the user wrote, not
         // the initializer's type. In this case the user wrote
         // nothing, so we are going to create a type variable `Z`.
-        // Then we will assign the type of the initializer (`&'x
-        // int`) as a subtype of `Z`: `&'x int <: Z`. And hence we
-        // will instantiate `Z` as a type `&'0 int` where `'0` is
-        // a fresh region variable, with the constraint that `'x :
-        // '0`.  So basically we're all set.
+        // Then we will assign the type of the initializer (`&'x i32`)
+        // as a subtype of `Z`: `&'x i32 <: Z`. And hence we
+        // will instantiate `Z` as a type `&'0 i32` where `'0` is
+        // a fresh region variable, with the constraint that `'x : '0`.
+        // So basically we're all set.
         //
         // Note that there are two tests to check that this remains true
         // (`regions-reassign-{match,let}-bound-pointer.rs`).