You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/doc/book/syntax-index.md
+9-3
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Keywords
4
4
5
-
*`as`: primitive casting. See [Casting Between Types (`as`)].
5
+
*`as`: primitive casting, or disambiguating the specific trait containing an item. See [Casting Between Types (`as`)], [Universal Function Call Syntax (Angle-bracket Form)], [Associated Types].
6
6
*`break`: break out of loop. See [Loops (Ending Iteration Early)].
7
7
*`const`: constant items and constant raw pointers. See [`const` and `static`], [Raw Pointers].
8
8
*`continue`: continue to next loop iteration. See [Loops (Ending Iteration Early)].
@@ -115,8 +115,11 @@
115
115
*`::path`: path relative to the crate root (*i.e.* an explicitly absolute path). See [Crates and Modules (Re-exporting with `pub use`)].
116
116
*`self::path`: path relative to the current module (*i.e.* an explicitly relative path). See [Crates and Modules (Re-exporting with `pub use`)].
117
117
*`super::path`: path relative to the parent of the current module. See [Crates and Modules (Re-exporting with `pub use`)].
118
-
*`type::ident`: associated constants, functions, and types. See [Associated Types].
118
+
*`type::ident`, `<type as trait>::ident`: associated constants, functions, and types. See [Associated Types].
119
119
*`<type>::…`: associated item for a type which cannot be directly named (*e.g.*`<&T>::…`, `<[T]>::…`, *etc.*). See [Associated Types].
120
+
*`trait::method(…)`: disambiguating a method call by naming the trait which defines it. See [Universal Function Call Syntax].
121
+
*`type::method(…)`: disambiguating a method call by naming the type for which it's defined. See [Universal Function Call Syntax].
122
+
*`<type as trait>::method(…)`: disambiguating a method call by naming the trait _and_ type. See [Universal Function Call Syntax (Angle-bracket Form)].
120
123
121
124
<!-- Generics -->
122
125
@@ -132,7 +135,8 @@
132
135
<!-- Constraints -->
133
136
134
137
*`T: U`: generic parameter `T` constrained to types that implement `U`. See [Traits].
135
-
*`T: 'a`: generic type `T` must outlive lifetime `'a`.
138
+
*`T: 'a`: generic type `T` must outlive lifetime `'a`. When we say that a type 'outlives' the lifetime, we mean that it cannot transitively contain any references with lifetimes shorter than `'a`.
139
+
*`T : 'static`: The generic type `T` contains no borrowed references other than `'static` ones.
136
140
*`'b: 'a`: generic lifetime `'b` must outlive lifetime `'a`.
137
141
*`T: ?Sized`: allow generic type parameter to be a dynamically-sized type. See [Unsized Types (`?Sized`)].
138
142
*`'a + trait`, `trait + trait`: compound type constraint. See [Traits (Multiple Trait Bounds)].
0 commit comments