|
5 | 5 | //! Here's a link to [`Vec<T>`] and one to [`Box<Vec<Option<T>>>`]. |
6 | 6 | //! Here's a link to [`Iterator<Box<T>>::Item`]. |
7 | 7 | //! |
| 8 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html"]' 'Vec<T>' |
| 9 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html"]' 'Box<Vec<Option<T>>>' |
| 10 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item"]' 'Iterator<Box<T>>::Item' |
| 11 | + |
8 | 12 | //! And what about a link to [just `Option`](Option) and, [with the generic, `Option<T>`](Option<T>)? |
9 | 13 | //! |
| 14 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"]' 'just Option' |
| 15 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"]' 'with the generic, Option<T>' |
| 16 | + |
10 | 17 | //! We should also try linking to [`Result<T, E>`]; it has *two* generics! |
11 | 18 | //! |
| 19 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"]' 'Result<T, E>' |
| 20 | + |
12 | 21 | //! Now let's test a trickier case: [`Vec::<T>::new`], or you could write it |
13 | 22 | //! [with parentheses as `Vec::<T>::new()`][Vec::<T>::new()]. |
14 | 23 | //! And what about something even harder? That would be [`Vec::<Box<T>>::new()`]. |
15 | 24 | //! |
| 25 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html#method.new"]' 'Vec::<T>::new' |
| 26 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html#method.new"]' 'with parentheses as Vec::<T>::new()' |
| 27 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html#method.new"]' 'Vec::<Box<T>>::new()' |
| 28 | + |
16 | 29 | //! This is also pretty tricky: [`TypeId::of::<String>()`]. |
17 | 30 | //! And this too: [`Vec::<std::error::Error>::len`]. |
18 | 31 | //! |
| 32 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html#method.of"]' 'TypeId::of::<String>()' |
| 33 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html#method.len"]' 'Vec::<std::error::Error>::len' |
| 34 | + |
19 | 35 | //! We unofficially and implicitly support things that aren't valid in the actual Rust syntax, like |
20 | 36 | //! [`Box::<T>new()`]. We may not support them in the future! |
21 | 37 | //! |
| 38 | +// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html#method.new"]' 'Box::<T>new()' |
| 39 | + |
22 | 40 | //! These will be resolved as regular links: |
23 | 41 | //! - [`this is <invalid syntax> first`](https://www.rust-lang.org) |
24 | 42 | //! - [`this is <invalid syntax> twice`] |
|
30 | 48 | //! [`this is <invalid syntax> twice`]: https://www.rust-lang.org |
31 | 49 | //! [rlo]: https://www.rust-lang.org |
32 | 50 | //! [c > d]: https://www.rust-lang.org |
33 | | -
|
34 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html"]' 'Vec<T>' |
35 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html"]' 'Box<Vec<Option<T>>>' |
36 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item"]' 'Iterator<Box<T>>::Item' |
37 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"]' 'just Option' |
38 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"]' 'with the generic, Option<T>' |
39 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"]' 'Result<T, E>' |
40 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html#method.new"]' 'Vec::<T>::new' |
41 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html#method.new"]' 'with parentheses as Vec::<T>::new()' |
42 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html#method.new"]' 'Vec::<Box<T>>::new()' |
43 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html#method.of"]' 'TypeId::of::<String>()' |
44 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html#method.len"]' 'Vec::<std::error::Error>::len' |
45 | | - |
46 | | -// @has foo/index.html '//a[@href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html#method.new"]' 'Box::<T>new()' |
47 | | - |
| 51 | +//! |
48 | 52 | // @has foo/index.html '//a[@href="https://www.rust-lang.org"]' 'this is <invalid syntax> first' |
49 | 53 | // @has foo/index.html '//a[@href="https://www.rust-lang.org"]' 'this is <invalid syntax> twice' |
50 | 54 | // @has foo/index.html '//a[@href="https://www.rust-lang.org"]' '<invalid syntax> thrice' |
|
0 commit comments