@@ -75,7 +75,6 @@ for referring to a type. It may refer to:
7575* The [ never] type.
7676* [ Macros] which expand to a type expression.
7777
78-
7978### Parenthesized types
8079
8180> _ ParenthesizedType_ :\
@@ -93,46 +92,6 @@ require this disambiguation use the [_TypeNoBounds_] rule instead of
9392type T <'a > = & 'a (dyn Any + Send );
9493```
9594
96- ### Inferred type
97- > ** <sup >Syntax</sup >** \
98- > _ InferredType_ : ` _ `
99-
100- The inferred type asks the compiler to infer the type if possible based on the
101- surrounding information available. It cannot be used in item signatures. It is
102- often used in generic arguments:
103-
104- ``` rust
105- let x : Vec <_ > = (0 .. 10 ). collect ();
106- ```
107-
108- <!--
109- What else should be said here?
110- The only documentation I am aware of is https://rust-lang-nursery.github.io/rustc-guide/type-inference.html
111- There should be a broader discussion of type inference somewhere.
112- -->
113-
114-
115- ### Type parameters
116-
117- Within the body of an item that has type parameter declarations, the names of
118- its type parameters are types:
119-
120- ``` rust
121- fn to_vec <A : Clone >(xs : & [A ]) -> Vec <A > {
122- if xs . is_empty () {
123- return vec! [];
124- }
125- let first : A = xs [0 ]. clone ();
126- let mut rest : Vec <A > = to_vec (& xs [1 .. ]);
127- rest . insert (0 , first );
128- rest
129- }
130- ```
131-
132- Here, ` first ` has type ` A ` , referring to ` to_vec ` 's ` A ` type parameter; and
133- ` rest ` has type ` Vec<A> ` , a vector with element type ` A ` .
134-
135-
13695## Recursive types
13796
13897Nominal types &mdash ; [ structs] , [ enumerations] and [ unions] &mdash ; may be
@@ -164,7 +123,7 @@ let a: List<i32> = List::Cons(7, Box::new(List::Cons(13, Box::new(List::Nil))));
164123[ _BareFunctionType_ ] : types/function-pointer.html
165124[ _ImplTraitTypeOneBound_ ] : types/impl-trait.html
166125[ _ImplTraitType_ ] : types/impl-trait.html
167- [ _InferredType_ ] : types.html#inferred-type
126+ [ _InferredType_ ] : types/inferred .html
168127[ _MacroInvocation_ ] : macros.html#macro-invocation
169128[ _NeverType_ ] : types/never.html
170129[ _ParenthesizedType_ ] : types.html#parenthesized-types
@@ -202,7 +161,7 @@ let a: List<i32> = List::Cons(7, Box::new(List::Cons(13, Box::new(List::Nil))));
202161[ arrays ] : types/array.html
203162[ enumerations ] : types/enum.html
204163[ function pointer ] : types/function-pointer.html
205- [ inferred type ] : types.html#inferred-type
164+ [ inferred type ] : types/inferred .html
206165[ item ] : items.html
207166[ never ] : types/never.html
208167[ pointer types ] : types/pointer.html
@@ -215,5 +174,5 @@ let a: List<i32> = List::Cons(7, Box::new(List::Cons(13, Box::new(List::Nil))));
215174[ type alias ] : items/type-aliases.html
216175[ type aliases ] : items/type-aliases.html
217176[ type boundaries ] : trait-bounds.html
218- [ type parameters ] : #type- parameters
177+ [ type parameters ] : types/ parameters.html
219178[ unions ] : types/union.html
0 commit comments