/// [Reference]: ../reference/expressions/operator-expr.html#type-cast-expressions
/// [`crate`]: keyword.crate.html
/// [`use`]: keyword.use.html
-/// [const-cast]: primitive.pointer.html#method.cast
+/// [const-cast]: pointer::cast
/// [mut-cast]: primitive.pointer.html#method.cast-1
mod as_keyword {}
/// The `const` keyword is also used in raw pointers in combination with `mut`, as seen in `*const
/// T` and `*mut T`. More about `const` as used in raw pointers can be read at the Rust docs for the [pointer primitive].
///
-/// [pointer primitive]: primitive.pointer.html
-/// [Rust Book]:
-/// ../book/ch03-01-variables-and-mutability.html#differences-between-variables-and-constants
+/// [pointer primitive]: pointer
+/// [Rust Book]: ../book/ch03-01-variables-and-mutability.html#differences-between-variables-and-constants
/// [Reference]: ../reference/items/constant-items.html
/// [const-eval]: ../reference/const_eval.html
mod const_keyword {}
/// [ADT]: https://en.wikipedia.org/wiki/Algebraic_data_type
/// [Rust Book]: ../book/ch06-01-defining-an-enum.html
/// [Reference]: ../reference/items/enumerations.html
-/// [`!`]: primitive.never.html
mod enum_keyword {}
#[doc(keyword = "extern")]
/// # fn code() { }
/// # let iterator = 0..2;
/// {
-/// let mut _iter = std::iter::IntoIterator::into_iter(iterator);
-/// loop {
-/// match _iter.next() {
-/// Some(loop_variable) => {
-/// code()
-/// },
-/// None => break,
-/// }
-/// }
+/// let result = match IntoIterator::into_iter(iterator) {
+/// mut iter => loop {
+/// let next;
+/// match iter.next() {
+/// Some(val) => next = val,
+/// None => break,
+/// };
+/// let loop_variable = next;
+/// let () = { code(); };
+/// },
+/// };
+/// result
/// }
/// ```
///
/// Capture a [closure]'s environment by value.
///
/// `move` converts any variables captured by reference or mutable reference
-/// to owned by value variables.
+/// to variables captured by value.
///
/// ```rust
-/// let capture = "hello";
-/// let closure = move || {
-/// println!("rust says {}", capture);
-/// };
+/// let data = vec![1, 2, 3];
+/// let closure = move || println!("captured {:?} by value", data);
+///
+/// // data is no longer available, it is owned by the closure
/// ```
///
/// Note: `move` closures may still implement [`Fn`] or [`FnMut`], even though
/// ```rust
/// fn create_fn() -> impl Fn() {
/// let text = "Fn".to_owned();
-///
/// move || println!("This is a: {}", text)
/// }
///
-/// let fn_plain = create_fn();
-///
-/// fn_plain();
+/// let fn_plain = create_fn();
+/// fn_plain();
/// ```
///
/// `move` is often used when [threads] are involved.
///
/// ```rust
-/// let x = 5;
+/// let data = vec![1, 2, 3];
///
/// std::thread::spawn(move || {
-/// println!("captured {} by value", x)
+/// println!("captured {:?} by value", data)
/// }).join().unwrap();
///
-/// // x is no longer available
+/// // data was moved to the spawned thread, so we cannot use it here
/// ```
///
/// `move` is also valid before an async block.
///
/// ```rust
-/// let capture = "hello";
+/// let capture = "hello".to_owned();
/// let block = async move {
/// println!("rust says {} from async block", capture);
/// };
/// ```
///
-/// For more information on the `move` keyword, see the [closure]'s section
-/// of the Rust book or the [threads] section
+/// For more information on the `move` keyword, see the [closures][closure] section
+/// of the Rust book or the [threads] section.
///
/// [closure]: ../book/ch13-01-closures.html
/// [threads]: ../book/ch16-01-threads.html#using-move-closures-with-threads
/// [Reference]: ../reference/items/associated-items.html#methods
mod self_keyword {}
-#[doc(keyword = "Self")]
+// FIXME: Once rustdoc can handle URL conflicts on case insensitive file systems, we can remove the
+// three next lines and put back: `#[doc(keyword = "Self")]`.
+#[doc(alias = "Self")]
+#[allow(rustc::existing_doc_keyword)]
+#[doc(keyword = "SelfTy")]
//
/// The implementing type within a [`trait`] or [`impl`] block, or the current type within a type
/// definition.
/// In the 2015 edition the parameters pattern was not needed for traits:
///
/// ```rust,edition2015
+/// # #![allow(anonymous_parameters)]
/// trait Tr {
/// fn f(i32);
/// }