|
50 | 50 | //! v[1] = v[1] + 5;
|
51 | 51 | //! ```
|
52 | 52 | //!
|
53 |
| -//! [`Vec<T>`]: ../../std/vec/struct.Vec.html |
54 |
| -//! [`new`]: ../../std/vec/struct.Vec.html#method.new |
55 |
| -//! [`push`]: ../../std/vec/struct.Vec.html#method.push |
56 |
| -//! [`Index`]: ../../std/ops/trait.Index.html |
57 |
| -//! [`IndexMut`]: ../../std/ops/trait.IndexMut.html |
58 |
| -//! [`vec!`]: ../../std/macro.vec.html |
| 53 | +//! [`Vec<T>`]: Vec |
| 54 | +//! [`new`]: Vec::new |
| 55 | +//! [`push`]: Vec::push |
59 | 56 |
|
60 | 57 | #![stable(feature = "rust1", since = "1.0.0")]
|
61 | 58 |
|
@@ -278,22 +275,18 @@ use crate::raw_vec::RawVec;
|
278 | 275 | /// `Vec` does not currently guarantee the order in which elements are dropped.
|
279 | 276 | /// The order has changed in the past and may change again.
|
280 | 277 | ///
|
281 |
| -/// [`vec!`]: ../../std/macro.vec.html |
282 | 278 | /// [`get`]: ../../std/vec/struct.Vec.html#method.get
|
283 | 279 | /// [`get_mut`]: ../../std/vec/struct.Vec.html#method.get_mut
|
284 |
| -/// [`Index`]: ../../std/ops/trait.Index.html |
285 |
| -/// [`String`]: ../../std/string/struct.String.html |
286 |
| -/// [`&str`]: ../../std/primitive.str.html |
287 |
| -/// [`Vec::with_capacity`]: ../../std/vec/struct.Vec.html#method.with_capacity |
288 |
| -/// [`Vec::new`]: ../../std/vec/struct.Vec.html#method.new |
289 |
| -/// [`shrink_to_fit`]: ../../std/vec/struct.Vec.html#method.shrink_to_fit |
290 |
| -/// [`capacity`]: ../../std/vec/struct.Vec.html#method.capacity |
291 |
| -/// [`mem::size_of::<T>`]: ../../std/mem/fn.size_of.html |
292 |
| -/// [`len`]: ../../std/vec/struct.Vec.html#method.len |
293 |
| -/// [`push`]: ../../std/vec/struct.Vec.html#method.push |
294 |
| -/// [`insert`]: ../../std/vec/struct.Vec.html#method.insert |
295 |
| -/// [`reserve`]: ../../std/vec/struct.Vec.html#method.reserve |
296 |
| -/// [owned slice]: ../../std/boxed/struct.Box.html |
| 280 | +/// [`String`]: crate::string::String |
| 281 | +/// [`&str`]: type@str |
| 282 | +/// [`shrink_to_fit`]: Vec::shrink_to_fit |
| 283 | +/// [`capacity`]: Vec::capacity |
| 284 | +/// [`mem::size_of::<T>`]: core::mem::size_of |
| 285 | +/// [`len`]: Vec::len |
| 286 | +/// [`push`]: Vec::push |
| 287 | +/// [`insert`]: Vec::insert |
| 288 | +/// [`reserve`]: Vec::reserve |
| 289 | +/// [owned slice]: Box |
297 | 290 | #[stable(feature = "rust1", since = "1.0.0")]
|
298 | 291 | #[cfg_attr(not(test), rustc_diagnostic_item = "vec_type")]
|
299 | 292 | pub struct Vec<T> {
|
@@ -430,8 +423,8 @@ impl<T> Vec<T> {
|
430 | 423 | /// that nothing else uses the pointer after calling this
|
431 | 424 | /// function.
|
432 | 425 | ///
|
433 |
| - /// [`String`]: ../../std/string/struct.String.html |
434 |
| - /// [`dealloc`]: ../../alloc/alloc/trait.GlobalAlloc.html#tymethod.dealloc |
| 426 | + /// [`String`]: crate::string::String |
| 427 | + /// [`dealloc`]: crate::alloc::GlobalAlloc::dealloc |
435 | 428 | ///
|
436 | 429 | /// # Examples
|
437 | 430 | ///
|
@@ -658,7 +651,7 @@ impl<T> Vec<T> {
|
658 | 651 | ///
|
659 | 652 | /// Note that this will drop any excess capacity.
|
660 | 653 | ///
|
661 |
| - /// [owned slice]: ../../std/boxed/struct.Box.html |
| 654 | + /// [owned slice]: Box |
662 | 655 | ///
|
663 | 656 | /// # Examples
|
664 | 657 | ///
|
@@ -867,7 +860,7 @@ impl<T> Vec<T> {
|
867 | 860 | ///
|
868 | 861 | /// [`truncate`]: #method.truncate
|
869 | 862 | /// [`resize`]: #method.resize
|
870 |
| - /// [`extend`]: ../../std/iter/trait.Extend.html#tymethod.extend |
| 863 | + /// [`extend`]: Extend::extend |
871 | 864 | /// [`clear`]: #method.clear
|
872 | 865 | ///
|
873 | 866 | /// # Safety
|
@@ -1214,8 +1207,6 @@ impl<T> Vec<T> {
|
1214 | 1207 | /// Removes the last element from a vector and returns it, or [`None`] if it
|
1215 | 1208 | /// is empty.
|
1216 | 1209 | ///
|
1217 |
| - /// [`None`]: ../../std/option/enum.Option.html#variant.None |
1218 |
| - /// |
1219 | 1210 | /// # Examples
|
1220 | 1211 | ///
|
1221 | 1212 | /// ```
|
@@ -1480,7 +1471,6 @@ impl<T> Vec<T> {
|
1480 | 1471 | /// ```
|
1481 | 1472 | ///
|
1482 | 1473 | /// [`resize`]: #method.resize
|
1483 |
| - /// [`Clone`]: ../../std/clone/trait.Clone.html |
1484 | 1474 | #[stable(feature = "vec_resize_with", since = "1.33.0")]
|
1485 | 1475 | pub fn resize_with<F>(&mut self, new_len: usize, f: F)
|
1486 | 1476 | where
|
@@ -1590,8 +1580,6 @@ impl<T: Clone> Vec<T> {
|
1590 | 1580 | /// assert_eq!(vec, [1, 2]);
|
1591 | 1581 | /// ```
|
1592 | 1582 | ///
|
1593 |
| - /// [`Clone`]: ../../std/clone/trait.Clone.html |
1594 |
| - /// [`Default`]: ../../std/default/trait.Default.html |
1595 | 1583 | /// [`resize_with`]: #method.resize_with
|
1596 | 1584 | #[stable(feature = "vec_resize", since = "1.5.0")]
|
1597 | 1585 | pub fn resize(&mut self, new_len: usize, value: T) {
|
@@ -1655,9 +1643,7 @@ impl<T: Default> Vec<T> {
|
1655 | 1643 | /// ```
|
1656 | 1644 | ///
|
1657 | 1645 | /// [`resize`]: #method.resize
|
1658 |
| - /// [`Default::default()`]: ../../std/default/trait.Default.html#tymethod.default |
1659 |
| - /// [`Default`]: ../../std/default/trait.Default.html |
1660 |
| - /// [`Clone`]: ../../std/clone/trait.Clone.html |
| 1646 | + /// [`Default::default()`]: Default::default |
1661 | 1647 | #[unstable(feature = "vec_resize_default", issue = "41758")]
|
1662 | 1648 | #[rustc_deprecated(
|
1663 | 1649 | reason = "This is moving towards being removed in favor \
|
@@ -2338,7 +2324,6 @@ impl<T> Vec<T> {
|
2338 | 2324 | /// Note that `drain_filter` also lets you mutate every element in the filter closure,
|
2339 | 2325 | /// regardless of whether you choose to keep or remove it.
|
2340 | 2326 | ///
|
2341 |
| - /// |
2342 | 2327 | /// # Examples
|
2343 | 2328 | ///
|
2344 | 2329 | /// Splitting an array into evens and odds, reusing the original allocation:
|
|
0 commit comments