@@ -195,7 +195,7 @@ mod break_keyword {}
195195/// to be most things that would be reasonable to have in a constant (barring `const fn`s). For
196196/// example, you can't have a [`File`] as a `const`.
197197///
198- /// [`File`]: crate::fs:: File
198+ /// [`File`]: ../std/fs/struct. File.html
199199///
200200/// The only lifetime allowed in a constant is `'static`, which is the lifetime that encompasses
201201/// all others in a Rust program. For example, if you wanted to define a constant string, it would
@@ -484,7 +484,7 @@ mod extern_keyword {}
484484
485485#[ doc( keyword = "false" ) ]
486486//
487- /// A value of type [`bool`] representing logical **false**.
487+ /// A value of type [`prim@ bool`] representing logical **false**.
488488///
489489/// `false` is the logical opposite of [`true`].
490490///
@@ -1060,7 +1060,8 @@ mod mod_keyword {}
10601060///
10611061/// `move` is often used when [threads] are involved.
10621062///
1063- /// ```rust
1063+ #[ cfg_attr( target_os = "wasi" , doc = "```rust,ignore (thread::spawn not supported)" ) ]
1064+ #[ cfg_attr( not( target_os = "wasi" ) , doc = "```rust" ) ]
10641065/// let data = vec![1, 2, 3];
10651066///
10661067/// std::thread::spawn(move || {
@@ -1235,31 +1236,18 @@ mod ref_keyword {}
12351236/// `return` returns from the function immediately (an "early return"):
12361237///
12371238/// ```no_run
1238- /// use std::fs::File;
1239- /// use std::io::{Error, ErrorKind, Read, Result};
1240- ///
1241- /// fn main() -> Result<()> {
1242- /// let mut file = match File::open("foo.txt") {
1243- /// Ok(f) => f,
1244- /// Err(e) => return Err(e),
1245- /// };
1239+ /// fn main() -> Result<(), &'static str> {
1240+ /// let contents = "Hello, world!";
12461241///
1247- /// let mut contents = String::new();
1248- /// let size = match file.read_to_string(&mut contents) {
1249- /// Ok(s) => s,
1250- /// Err(e) => return Err(e),
1251- /// };
1242+ /// if contents.contains("impossible!") {
1243+ /// return Err("oh no!");
1244+ /// }
12521245///
1253- /// if contents.contains("impossible!") {
1254- /// return Err(Error::new(ErrorKind::Other, "oh no!") );
1255- /// }
1246+ /// if contents.len() > 9000 {
1247+ /// return Err("over 9000!" );
1248+ /// }
12561249///
1257- /// if size > 9000 {
1258- /// return Err(Error::new(ErrorKind::Other, "over 9000!"));
1259- /// }
1260- ///
1261- /// assert_eq!(contents, "Hello, world!");
1262- /// Ok(())
1250+ /// Ok(())
12631251/// }
12641252/// ```
12651253///
@@ -1306,7 +1294,8 @@ mod return_keyword {}
13061294/// manner to computed goto).
13071295///
13081296/// Example of using `become` to implement functional-style `fold`:
1309- /// ```
1297+ ///
1298+ /// ```ignore-wasm (tail-call target feature not enabled by default on wasm)
13101299/// #![feature(explicit_tail_calls)]
13111300/// #![expect(incomplete_features)]
13121301///
@@ -1360,7 +1349,8 @@ mod return_keyword {}
13601349/// (unless it's coerced to a function pointer)
13611350///
13621351/// It is possible to tail-call a function pointer:
1363- /// ```
1352+ ///
1353+ /// ```ignore-wasm (tail-call target feature not enabled by default on wasm)
13641354/// #![feature(explicit_tail_calls)]
13651355/// #![expect(incomplete_features)]
13661356///
@@ -1631,8 +1621,8 @@ mod self_upper_keyword {}
16311621/// [`extern`]: keyword.extern.html
16321622/// [`mut`]: keyword.mut.html
16331623/// [`unsafe`]: keyword.unsafe.html
1634- /// [`Mutex`]: sync:: Mutex
1635- /// [`OnceLock`]: sync:: OnceLock
1624+ /// [`Mutex`]: ../std/ sync/struct. Mutex.html
1625+ /// [`OnceLock`]: ../std/ sync/struct. OnceLock.html
16361626/// [`RefCell`]: cell::RefCell
16371627/// [atomic]: sync::atomic
16381628/// [Reference]: ../reference/items/static-items.html
@@ -1959,7 +1949,7 @@ mod trait_keyword {}
19591949
19601950#[ doc( keyword = "true" ) ]
19611951//
1962- /// A value of type [`bool`] representing logical **true**.
1952+ /// A value of type [`prim@ bool`] representing logical **true**.
19631953///
19641954/// Logically `true` is not equal to [`false`].
19651955///
@@ -2312,6 +2302,7 @@ mod type_keyword {}
23122302/// [`static`]: keyword.static.html
23132303/// [`union`]: keyword.union.html
23142304/// [`impl`]: keyword.impl.html
2305+ /// [`Vec::set_len`]: ../std/vec/struct.Vec.html#method.set_len
23152306/// [raw pointers]: ../reference/types/pointer.html
23162307/// [memory safety]: ../book/ch19-01-unsafe-rust.html
23172308/// [Rustonomicon]: ../nomicon/index.html
@@ -2502,7 +2493,7 @@ mod use_keyword {}
25022493/// ```
25032494///
25042495/// `where` is available anywhere generic and lifetime parameters are available,
2505- /// as can be seen with the [`Cow`](crate:: borrow:: Cow) type from the standard
2496+ /// as can be seen with the [`Cow`](../std/ borrow/enum. Cow.html ) type from the standard
25062497/// library:
25072498///
25082499/// ```rust
0 commit comments