]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/regionck.rs
Auto merge of #30036 - mitaa:doc_id, r=alexcrichton
[rust.git] / src / librustc_typeck / check / regionck.rs
index 549824d22a4ae1264965676f8b6ac4fbbabf1a5f..f980945dbf2206f12b02410727e0ce1f4850b078 100644 (file)
@@ -59,9 +59,9 @@
 //! There are a number of troublesome scenarios in the tests
 //! `region-dependent-*.rs`, but here is one example:
 //!
-//!     struct Foo { i: int }
+//!     struct Foo { i: i32 }
 //!     struct Bar { foo: Foo  }
-//!     fn get_i(x: &'a Bar) -> &'a int {
+//!     fn get_i(x: &'a Bar) -> &'a i32 {
 //!        let foo = &x.foo; // Lifetime L1
 //!        &foo.i            // Lifetime L2
 //!     }
@@ -233,8 +233,8 @@ fn set_repeating_scope(&mut self, scope: ast::NodeId) -> ast::NodeId {
     /// Consider this silly example:
     ///
     /// ```
-    /// fn borrow(x: &int) -> &int {x}
-    /// fn foo(x: @int) -> int {  // block: B
+    /// fn borrow(x: &i32) -> &i32 {x}
+    /// fn foo(x: @i32) -> i32 {  // block: B
     ///     let b = borrow(x);    // region: <R0>
     ///     *b
     /// }
@@ -243,7 +243,7 @@ fn set_repeating_scope(&mut self, scope: ast::NodeId) -> ast::NodeId {
     /// Here, the region of `b` will be `<R0>`.  `<R0>` is constrained to be some subregion of the
     /// block B and some superregion of the call.  If we forced it now, we'd choose the smaller
     /// region (the call).  But that would make the *b illegal.  Since we don't resolve, the type
-    /// of b will be `&<R0>.int` and then `*b` will require that `<R0>` be bigger than the let and
+    /// of b will be `&<R0>.i32` and then `*b` will require that `<R0>` be bigger than the let and
     /// the `*b` expression, so we will effectively resolve `<R0>` to be the block B.
     pub fn resolve_type(&self, unresolved_ty: Ty<'tcx>) -> Ty<'tcx> {
         self.fcx.infcx().resolve_type_vars_if_possible(&unresolved_ty)
@@ -1733,7 +1733,7 @@ fn projection_declared_bounds<'a, 'tcx>(rcx: &Rcx<'a,'tcx>,
     let mut declared_bounds =
         declared_generic_bounds_from_env(rcx, GenericKind::Projection(projection_ty));
 
-    declared_bounds.push_all(
+    declared_bounds.extend_from_slice(
         &declared_projection_bounds_from_trait(rcx, span, projection_ty));
 
     declared_bounds