| author | bors <bors@rust-lang.org> 2025-12-14 12:32:36 UTC |
| committer | bors <bors@rust-lang.org> 2025-12-14 12:32:36 UTC |
| log | 0208ee09be465f69005a7a12c28d5eccac7d5f34 |
| tree | ea160ae18905a5e0866117d0d49b7e2421786235 |
| parent | 08de25c4ea16d7ecc3ceeb093d4f343a2be30df5 |
| parent | fbd259da35de52ac484124f3ad6002d3376bb9ac |
Rollup of 8 pull requests
Successful merges:
- rust-lang/rust#148755 (Constify `DropGuard::dismiss` and trait impls)
- rust-lang/rust#148825 (Add SystemTime::{MIN, MAX})
- rust-lang/rust#149272 (Fix vec iter zst alignment)
- rust-lang/rust#149417 (tidy: Detect outdated workspaces in workspace list)
- rust-lang/rust#149773 (fix va_list test by adding a llvmir signext check)
- rust-lang/rust#149894 (Update to mdbook 0.5)
- rust-lang/rust#149955 (Fix typo in armv7a-vex-v5 documentation)
- rust-lang/rust#149972 (Enable to ping LoongArch group via triagebot)
r? `@ghost`
`@rustbot` modify labels: rollup34 files changed, 677 insertions(+), 879 deletions(-)
library/alloc/src/vec/into_iter.rs+6-1| ... | ... | @@ -411,7 +411,12 @@ impl<T, A: Allocator> DoubleEndedIterator for IntoIter<T, A> { |
| 411 | 411 | // SAFETY: same as for advance_by() |
| 412 | 412 | self.end = unsafe { self.end.sub(step_size) }; |
| 413 | 413 | } |
| 414 | let to_drop = ptr::slice_from_raw_parts_mut(self.end as *mut T, step_size); | |
| 414 | let to_drop = if T::IS_ZST { | |
| 415 | // ZST may cause unalignment | |
| 416 | ptr::slice_from_raw_parts_mut(ptr::NonNull::<T>::dangling().as_ptr(), step_size) | |
| 417 | } else { | |
| 418 | ptr::slice_from_raw_parts_mut(self.end as *mut T, step_size) | |
| 419 | }; | |
| 415 | 420 | // SAFETY: same as for advance_by() |
| 416 | 421 | unsafe { |
| 417 | 422 | ptr::drop_in_place(to_drop); |
library/alloctests/tests/vec.rs+32| ... | ... | @@ -2717,3 +2717,35 @@ fn vec_null_ptr_roundtrip() { |
| 2717 | 2717 | let new = roundtripped.with_addr(ptr.addr()); |
| 2718 | 2718 | unsafe { new.read() }; |
| 2719 | 2719 | } |
| 2720 | ||
| 2721 | // Regression test for Undefined Behavior (UB) caused by IntoIter::nth_back (#148682) | |
| 2722 | // when dealing with high-aligned Zero-Sized Types (ZSTs). | |
| 2723 | use std::collections::{BTreeMap, BinaryHeap, HashMap, LinkedList, VecDeque}; | |
| 2724 | #[test] | |
| 2725 | fn zst_collections_iter_nth_back_regression() { | |
| 2726 | #[repr(align(8))] | |
| 2727 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] | |
| 2728 | struct Thing; | |
| 2729 | let v = vec![Thing, Thing]; | |
| 2730 | let _ = v.into_iter().nth_back(1); | |
| 2731 | let mut d = VecDeque::new(); | |
| 2732 | d.push_back(Thing); | |
| 2733 | d.push_back(Thing); | |
| 2734 | let _ = d.into_iter().nth_back(1); | |
| 2735 | let mut map = BTreeMap::new(); | |
| 2736 | map.insert(0, Thing); | |
| 2737 | map.insert(1, Thing); | |
| 2738 | let _ = map.into_values().nth_back(0); | |
| 2739 | let mut hash_map = HashMap::new(); | |
| 2740 | hash_map.insert(1, Thing); | |
| 2741 | hash_map.insert(2, Thing); | |
| 2742 | let _ = hash_map.into_values().nth(1); | |
| 2743 | let mut heap = BinaryHeap::new(); | |
| 2744 | heap.push(Thing); | |
| 2745 | heap.push(Thing); | |
| 2746 | let _ = heap.into_iter().nth_back(1); | |
| 2747 | let mut list = LinkedList::new(); | |
| 2748 | list.push_back(Thing); | |
| 2749 | list.push_back(Thing); | |
| 2750 | let _ = list.into_iter().nth_back(1); | |
| 2751 | } |
library/core/src/mem/drop_guard.rs+17-9| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | use crate::fmt::{self, Debug}; |
| 2 | use crate::marker::Destruct; | |
| 2 | 3 | use crate::mem::ManuallyDrop; |
| 3 | 4 | use crate::ops::{Deref, DerefMut}; |
| 4 | 5 | |
| ... | ... | @@ -78,32 +79,37 @@ where |
| 78 | 79 | /// |
| 79 | 80 | /// let value = String::from("Nori likes chicken"); |
| 80 | 81 | /// let guard = DropGuard::new(value, |s| println!("{s}")); |
| 81 | /// assert_eq!(guard.dismiss(), "Nori likes chicken"); | |
| 82 | /// assert_eq!(DropGuard::dismiss(guard), "Nori likes chicken"); | |
| 82 | 83 | /// ``` |
| 83 | 84 | #[unstable(feature = "drop_guard", issue = "144426")] |
| 85 | #[rustc_const_unstable(feature = "const_drop_guard", issue = "none")] | |
| 84 | 86 | #[inline] |
| 85 | pub fn dismiss(self) -> T { | |
| 87 | pub const fn dismiss(guard: Self) -> T | |
| 88 | where | |
| 89 | F: [const] Destruct, | |
| 90 | { | |
| 86 | 91 | // First we ensure that dropping the guard will not trigger |
| 87 | 92 | // its destructor |
| 88 | let mut this = ManuallyDrop::new(self); | |
| 93 | let mut guard = ManuallyDrop::new(guard); | |
| 89 | 94 | |
| 90 | 95 | // Next we manually read the stored value from the guard. |
| 91 | 96 | // |
| 92 | 97 | // SAFETY: this is safe because we've taken ownership of the guard. |
| 93 | let value = unsafe { ManuallyDrop::take(&mut this.inner) }; | |
| 98 | let value = unsafe { ManuallyDrop::take(&mut guard.inner) }; | |
| 94 | 99 | |
| 95 | 100 | // Finally we drop the stored closure. We do this *after* having read |
| 96 | 101 | // the value, so that even if the closure's `drop` function panics, |
| 97 | 102 | // unwinding still tries to drop the value. |
| 98 | 103 | // |
| 99 | 104 | // SAFETY: this is safe because we've taken ownership of the guard. |
| 100 | unsafe { ManuallyDrop::drop(&mut this.f) }; | |
| 105 | unsafe { ManuallyDrop::drop(&mut guard.f) }; | |
| 101 | 106 | value |
| 102 | 107 | } |
| 103 | 108 | } |
| 104 | 109 | |
| 105 | 110 | #[unstable(feature = "drop_guard", issue = "144426")] |
| 106 | impl<T, F> Deref for DropGuard<T, F> | |
| 111 | #[rustc_const_unstable(feature = "const_convert", issue = "143773")] | |
| 112 | impl<T, F> const Deref for DropGuard<T, F> | |
| 107 | 113 | where |
| 108 | 114 | F: FnOnce(T), |
| 109 | 115 | { |
| ... | ... | @@ -115,7 +121,8 @@ where |
| 115 | 121 | } |
| 116 | 122 | |
| 117 | 123 | #[unstable(feature = "drop_guard", issue = "144426")] |
| 118 | impl<T, F> DerefMut for DropGuard<T, F> | |
| 124 | #[rustc_const_unstable(feature = "const_convert", issue = "143773")] | |
| 125 | impl<T, F> const DerefMut for DropGuard<T, F> | |
| 119 | 126 | where |
| 120 | 127 | F: FnOnce(T), |
| 121 | 128 | { |
| ... | ... | @@ -125,9 +132,10 @@ where |
| 125 | 132 | } |
| 126 | 133 | |
| 127 | 134 | #[unstable(feature = "drop_guard", issue = "144426")] |
| 128 | impl<T, F> Drop for DropGuard<T, F> | |
| 135 | #[rustc_const_unstable(feature = "const_drop_guard", issue = "none")] | |
| 136 | impl<T, F> const Drop for DropGuard<T, F> | |
| 129 | 137 | where |
| 130 | F: FnOnce(T), | |
| 138 | F: [const] FnOnce(T), | |
| 131 | 139 | { |
| 132 | 140 | fn drop(&mut self) { |
| 133 | 141 | // SAFETY: `DropGuard` is in the process of being dropped. |
library/coretests/tests/mem.rs+2-2| ... | ... | @@ -815,7 +815,7 @@ fn drop_guard_into_inner() { |
| 815 | 815 | let dropped = Cell::new(false); |
| 816 | 816 | let value = DropGuard::new(42, |_| dropped.set(true)); |
| 817 | 817 | let guard = DropGuard::new(value, |_| dropped.set(true)); |
| 818 | let inner = guard.dismiss(); | |
| 818 | let inner = DropGuard::dismiss(guard); | |
| 819 | 819 | assert_eq!(dropped.get(), false); |
| 820 | 820 | assert_eq!(*inner, 42); |
| 821 | 821 | } |
| ... | ... | @@ -837,7 +837,7 @@ fn drop_guard_always_drops_value_if_closure_drop_unwinds() { |
| 837 | 837 | // run the destructor of the value we passed, which we validate. |
| 838 | 838 | let _ = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { |
| 839 | 839 | let guard = DropGuard::new(value_with_tracked_destruction, closure_that_panics_on_drop); |
| 840 | guard.dismiss(); | |
| 840 | DropGuard::dismiss(guard); | |
| 841 | 841 | })); |
| 842 | 842 | assert!(value_was_dropped); |
| 843 | 843 | } |
library/std/src/sys/pal/hermit/time.rs+8| ... | ... | @@ -15,6 +15,10 @@ struct Timespec { |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | impl Timespec { |
| 18 | const MAX: Timespec = Self::new(i64::MAX, 1_000_000_000 - 1); | |
| 19 | ||
| 20 | const MIN: Timespec = Self::new(i64::MIN, 0); | |
| 21 | ||
| 18 | 22 | const fn zero() -> Timespec { |
| 19 | 23 | Timespec { t: timespec { tv_sec: 0, tv_nsec: 0 } } |
| 20 | 24 | } |
| ... | ... | @@ -209,6 +213,10 @@ pub struct SystemTime(Timespec); |
| 209 | 213 | pub const UNIX_EPOCH: SystemTime = SystemTime(Timespec::zero()); |
| 210 | 214 | |
| 211 | 215 | impl SystemTime { |
| 216 | pub const MAX: SystemTime = SystemTime { t: Timespec::MAX }; | |
| 217 | ||
| 218 | pub const MIN: SystemTime = SystemTime { t: Timespec::MIN }; | |
| 219 | ||
| 212 | 220 | pub fn new(tv_sec: i64, tv_nsec: i32) -> SystemTime { |
| 213 | 221 | SystemTime(Timespec::new(tv_sec, tv_nsec)) |
| 214 | 222 | } |
library/std/src/sys/pal/sgx/time.rs+4| ... | ... | @@ -28,6 +28,10 @@ impl Instant { |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | impl SystemTime { |
| 31 | pub const MAX: SystemTime = SystemTime(Duration::MAX); | |
| 32 | ||
| 33 | pub const MIN: SystemTime = SystemTime(Duration::ZERO); | |
| 34 | ||
| 31 | 35 | pub fn now() -> SystemTime { |
| 32 | 36 | SystemTime(usercalls::insecure_time()) |
| 33 | 37 | } |
library/std/src/sys/pal/solid/time.rs+4| ... | ... | @@ -10,6 +10,10 @@ pub struct SystemTime(abi::time_t); |
| 10 | 10 | pub const UNIX_EPOCH: SystemTime = SystemTime(0); |
| 11 | 11 | |
| 12 | 12 | impl SystemTime { |
| 13 | pub const MAX: SystemTime = SystemTime(abi::time_t::MAX); | |
| 14 | ||
| 15 | pub const MIN: SystemTime = SystemTime(abi::time_t::MIN); | |
| 16 | ||
| 13 | 17 | pub fn now() -> SystemTime { |
| 14 | 18 | let rtc = unsafe { |
| 15 | 19 | let mut out = MaybeUninit::zeroed(); |
library/std/src/sys/pal/uefi/time.rs+17| ... | ... | @@ -70,6 +70,23 @@ impl Instant { |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | impl SystemTime { |
| 73 | pub const MAX: SystemTime = MAX_UEFI_TIME; | |
| 74 | ||
| 75 | pub const MIN: SystemTime = SystemTime::from_uefi(r_efi::efi::Time { | |
| 76 | year: 1900, | |
| 77 | month: 1, | |
| 78 | day: 1, | |
| 79 | hour: 0, | |
| 80 | minute: 0, | |
| 81 | second: 0, | |
| 82 | nanosecond: 0, | |
| 83 | timezone: -1440, | |
| 84 | daylight: 0, | |
| 85 | pad1: 0, | |
| 86 | pad2: 0, | |
| 87 | }) | |
| 88 | .unwrap(); | |
| 89 | ||
| 73 | 90 | pub(crate) const fn from_uefi(t: r_efi::efi::Time) -> Option<Self> { |
| 74 | 91 | match system_time_internal::from_uefi(&t) { |
| 75 | 92 | Some(x) => Some(Self(x)), |
library/std/src/sys/pal/unix/time.rs+11| ... | ... | @@ -30,6 +30,10 @@ pub(crate) struct Timespec { |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | impl SystemTime { |
| 33 | pub const MAX: SystemTime = SystemTime { t: Timespec::MAX }; | |
| 34 | ||
| 35 | pub const MIN: SystemTime = SystemTime { t: Timespec::MIN }; | |
| 36 | ||
| 33 | 37 | #[cfg_attr(any(target_os = "horizon", target_os = "hurd"), allow(unused))] |
| 34 | 38 | pub fn new(tv_sec: i64, tv_nsec: i64) -> Result<SystemTime, io::Error> { |
| 35 | 39 | Ok(SystemTime { t: Timespec::new(tv_sec, tv_nsec)? }) |
| ... | ... | @@ -62,6 +66,13 @@ impl fmt::Debug for SystemTime { |
| 62 | 66 | } |
| 63 | 67 | |
| 64 | 68 | impl Timespec { |
| 69 | const MAX: Timespec = unsafe { Self::new_unchecked(i64::MAX, 1_000_000_000 - 1) }; | |
| 70 | ||
| 71 | // As described below, on Apple OS, dates before epoch are represented differently. | |
| 72 | // This is not an issue here however, because we are using tv_sec = i64::MIN, | |
| 73 | // which will cause the compatibility wrapper to not be executed at all. | |
| 74 | const MIN: Timespec = unsafe { Self::new_unchecked(i64::MIN, 0) }; | |
| 75 | ||
| 65 | 76 | const unsafe fn new_unchecked(tv_sec: i64, tv_nsec: i64) -> Timespec { |
| 66 | 77 | Timespec { tv_sec, tv_nsec: unsafe { Nanoseconds::new_unchecked(tv_nsec as u32) } } |
| 67 | 78 | } |
library/std/src/sys/pal/unsupported/time.rs+4| ... | ... | @@ -27,6 +27,10 @@ impl Instant { |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | impl SystemTime { |
| 30 | pub const MAX: SystemTime = SystemTime(Duration::MAX); | |
| 31 | ||
| 32 | pub const MIN: SystemTime = SystemTime(Duration::ZERO); | |
| 33 | ||
| 30 | 34 | pub fn now() -> SystemTime { |
| 31 | 35 | panic!("time not implemented on this platform") |
| 32 | 36 | } |
library/std/src/sys/pal/windows/time.rs+17-2| ... | ... | @@ -64,6 +64,16 @@ impl Instant { |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | impl SystemTime { |
| 67 | pub const MAX: SystemTime = SystemTime { | |
| 68 | t: c::FILETIME { | |
| 69 | dwLowDateTime: (i64::MAX & 0xFFFFFFFF) as u32, | |
| 70 | dwHighDateTime: (i64::MAX >> 32) as u32, | |
| 71 | }, | |
| 72 | }; | |
| 73 | ||
| 74 | pub const MIN: SystemTime = | |
| 75 | SystemTime { t: c::FILETIME { dwLowDateTime: 0, dwHighDateTime: 0 } }; | |
| 76 | ||
| 67 | 77 | pub fn now() -> SystemTime { |
| 68 | 78 | unsafe { |
| 69 | 79 | let mut t: SystemTime = mem::zeroed(); |
| ... | ... | @@ -101,8 +111,13 @@ impl SystemTime { |
| 101 | 111 | } |
| 102 | 112 | |
| 103 | 113 | pub fn checked_sub_duration(&self, other: &Duration) -> Option<SystemTime> { |
| 104 | let intervals = self.intervals().checked_sub(checked_dur2intervals(other)?)?; | |
| 105 | Some(SystemTime::from_intervals(intervals)) | |
| 114 | // Windows does not support times before 1601, hence why we don't | |
| 115 | // support negatives. In order to tackle this, we try to convert the | |
| 116 | // resulting value into an u64, which should obviously fail in the case | |
| 117 | // that the value is below zero. | |
| 118 | let intervals: u64 = | |
| 119 | self.intervals().checked_sub(checked_dur2intervals(other)?)?.try_into().ok()?; | |
| 120 | Some(SystemTime::from_intervals(intervals as i64)) | |
| 106 | 121 | } |
| 107 | 122 | } |
| 108 | 123 |
library/std/src/sys/pal/xous/time.rs+4| ... | ... | @@ -35,6 +35,10 @@ impl Instant { |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | impl SystemTime { |
| 38 | pub const MAX: SystemTime = SystemTime(Duration::MAX); | |
| 39 | ||
| 40 | pub const MIN: SystemTime = SystemTime(Duration::ZERO); | |
| 41 | ||
| 38 | 42 | pub fn now() -> SystemTime { |
| 39 | 43 | let result = blocking_scalar(systime_server(), GetUtcTimeMs.into()) |
| 40 | 44 | .expect("failed to request utc time in ms"); |
library/std/src/time.rs+83| ... | ... | @@ -511,6 +511,83 @@ impl SystemTime { |
| 511 | 511 | #[stable(feature = "assoc_unix_epoch", since = "1.28.0")] |
| 512 | 512 | pub const UNIX_EPOCH: SystemTime = UNIX_EPOCH; |
| 513 | 513 | |
| 514 | /// Represents the maximum value representable by [`SystemTime`] on this platform. | |
| 515 | /// | |
| 516 | /// This value differs a lot between platforms, but it is always the case | |
| 517 | /// that any positive addition of a [`Duration`], whose value is greater | |
| 518 | /// than or equal to the time precision of the operating system, to | |
| 519 | /// [`SystemTime::MAX`] will fail. | |
| 520 | /// | |
| 521 | /// # Examples | |
| 522 | /// | |
| 523 | /// ```no_run | |
| 524 | /// #![feature(time_systemtime_limits)] | |
| 525 | /// use std::time::{Duration, SystemTime}; | |
| 526 | /// | |
| 527 | /// // Adding zero will change nothing. | |
| 528 | /// assert_eq!(SystemTime::MAX.checked_add(Duration::ZERO), Some(SystemTime::MAX)); | |
| 529 | /// | |
| 530 | /// // But adding just one second will already fail ... | |
| 531 | /// // | |
| 532 | /// // Keep in mind that this in fact may succeed, if the Duration is | |
| 533 | /// // smaller than the time precision of the operating system, which | |
| 534 | /// // happens to be 1ns on most operating systems, with Windows being the | |
| 535 | /// // notable exception by using 100ns, hence why this example uses 1s. | |
| 536 | /// assert_eq!(SystemTime::MAX.checked_add(Duration::new(1, 0)), None); | |
| 537 | /// | |
| 538 | /// // Utilize this for saturating arithmetic to improve error handling. | |
| 539 | /// // In this case, we will use a certificate with a timestamp in the | |
| 540 | /// // future as a practical example. | |
| 541 | /// let configured_offset = Duration::from_secs(60 * 60 * 24); | |
| 542 | /// let valid_after = | |
| 543 | /// SystemTime::now() | |
| 544 | /// .checked_add(configured_offset) | |
| 545 | /// .unwrap_or(SystemTime::MAX); | |
| 546 | /// ``` | |
| 547 | #[unstable(feature = "time_systemtime_limits", issue = "149067")] | |
| 548 | pub const MAX: SystemTime = SystemTime(time::SystemTime::MAX); | |
| 549 | ||
| 550 | /// Represents the minimum value representable by [`SystemTime`] on this platform. | |
| 551 | /// | |
| 552 | /// This value differs a lot between platforms, but it is always the case | |
| 553 | /// that any positive subtraction of a [`Duration`] from, whose value is | |
| 554 | /// greater than or equal to the time precision of the operating system, to | |
| 555 | /// [`SystemTime::MIN`] will fail. | |
| 556 | /// | |
| 557 | /// Depending on the platform, this may be either less than or equal to | |
| 558 | /// [`SystemTime::UNIX_EPOCH`], depending on whether the operating system | |
| 559 | /// supports the representation of timestamps before the Unix epoch or not. | |
| 560 | /// However, it is always guaranteed that a [`SystemTime::UNIX_EPOCH`] fits | |
| 561 | /// between a [`SystemTime::MIN`] and [`SystemTime::MAX`]. | |
| 562 | /// | |
| 563 | /// # Examples | |
| 564 | /// | |
| 565 | /// ``` | |
| 566 | /// #![feature(time_systemtime_limits)] | |
| 567 | /// use std::time::{Duration, SystemTime}; | |
| 568 | /// | |
| 569 | /// // Subtracting zero will change nothing. | |
| 570 | /// assert_eq!(SystemTime::MIN.checked_sub(Duration::ZERO), Some(SystemTime::MIN)); | |
| 571 | /// | |
| 572 | /// // But subtracting just one second will already fail. | |
| 573 | /// // | |
| 574 | /// // Keep in mind that this in fact may succeed, if the Duration is | |
| 575 | /// // smaller than the time precision of the operating system, which | |
| 576 | /// // happens to be 1ns on most operating systems, with Windows being the | |
| 577 | /// // notable exception by using 100ns, hence why this example uses 1s. | |
| 578 | /// assert_eq!(SystemTime::MIN.checked_sub(Duration::new(1, 0)), None); | |
| 579 | /// | |
| 580 | /// // Utilize this for saturating arithmetic to improve error handling. | |
| 581 | /// // In this case, we will use a cache expiry as a practical example. | |
| 582 | /// let configured_expiry = Duration::from_secs(60 * 3); | |
| 583 | /// let expiry_threshold = | |
| 584 | /// SystemTime::now() | |
| 585 | /// .checked_sub(configured_expiry) | |
| 586 | /// .unwrap_or(SystemTime::MIN); | |
| 587 | /// ``` | |
| 588 | #[unstable(feature = "time_systemtime_limits", issue = "149067")] | |
| 589 | pub const MIN: SystemTime = SystemTime(time::SystemTime::MIN); | |
| 590 | ||
| 514 | 591 | /// Returns the system time corresponding to "now". |
| 515 | 592 | /// |
| 516 | 593 | /// # Examples |
| ... | ... | @@ -588,6 +665,9 @@ impl SystemTime { |
| 588 | 665 | /// Returns `Some(t)` where `t` is the time `self + duration` if `t` can be represented as |
| 589 | 666 | /// `SystemTime` (which means it's inside the bounds of the underlying data structure), `None` |
| 590 | 667 | /// otherwise. |
| 668 | /// | |
| 669 | /// In the case that the `duration` is smaller than the time precision of the operating | |
| 670 | /// system, `Some(self)` will be returned. | |
| 591 | 671 | #[stable(feature = "time_checked_add", since = "1.34.0")] |
| 592 | 672 | pub fn checked_add(&self, duration: Duration) -> Option<SystemTime> { |
| 593 | 673 | self.0.checked_add_duration(&duration).map(SystemTime) |
| ... | ... | @@ -596,6 +676,9 @@ impl SystemTime { |
| 596 | 676 | /// Returns `Some(t)` where `t` is the time `self - duration` if `t` can be represented as |
| 597 | 677 | /// `SystemTime` (which means it's inside the bounds of the underlying data structure), `None` |
| 598 | 678 | /// otherwise. |
| 679 | /// | |
| 680 | /// In the case that the `duration` is smaller than the time precision of the operating | |
| 681 | /// system, `Some(self)` will be returned. | |
| 599 | 682 | #[stable(feature = "time_checked_add", since = "1.34.0")] |
| 600 | 683 | pub fn checked_sub(&self, duration: Duration) -> Option<SystemTime> { |
| 601 | 684 | self.0.checked_sub_duration(&duration).map(SystemTime) |
library/std/tests/time.rs+26| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | #![feature(duration_constants)] |
| 2 | #![feature(time_systemtime_limits)] | |
| 2 | 3 | |
| 3 | 4 | use std::fmt::Debug; |
| 4 | 5 | use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; |
| ... | ... | @@ -237,9 +238,34 @@ fn system_time_duration_since_max_range_on_unix() { |
| 237 | 238 | let min = SystemTime::UNIX_EPOCH - (Duration::new(i64::MAX as u64 + 1, 0)); |
| 238 | 239 | let max = SystemTime::UNIX_EPOCH + (Duration::new(i64::MAX as u64, 999_999_999)); |
| 239 | 240 | |
| 241 | assert_eq!(min, SystemTime::MIN); | |
| 242 | assert_eq!(max, SystemTime::MAX); | |
| 243 | ||
| 240 | 244 | let delta_a = max.duration_since(min).expect("duration_since overflow"); |
| 241 | 245 | let delta_b = min.duration_since(max).expect_err("duration_since overflow").duration(); |
| 242 | 246 | |
| 243 | 247 | assert_eq!(Duration::MAX, delta_a); |
| 244 | 248 | assert_eq!(Duration::MAX, delta_b); |
| 245 | 249 | } |
| 250 | ||
| 251 | #[test] | |
| 252 | fn system_time_max_min() { | |
| 253 | #[cfg(not(target_os = "windows"))] | |
| 254 | /// Most (all?) non-Windows systems have nanosecond precision. | |
| 255 | const MIN_INTERVAL: Duration = Duration::new(0, 1); | |
| 256 | #[cfg(target_os = "windows")] | |
| 257 | /// Windows' time precision is at 100ns. | |
| 258 | const MIN_INTERVAL: Duration = Duration::new(0, 100); | |
| 259 | ||
| 260 | // First, test everything with checked_* and Duration::ZERO. | |
| 261 | assert_eq!(SystemTime::MAX.checked_add(Duration::ZERO), Some(SystemTime::MAX)); | |
| 262 | assert_eq!(SystemTime::MAX.checked_sub(Duration::ZERO), Some(SystemTime::MAX)); | |
| 263 | assert_eq!(SystemTime::MIN.checked_add(Duration::ZERO), Some(SystemTime::MIN)); | |
| 264 | assert_eq!(SystemTime::MIN.checked_sub(Duration::ZERO), Some(SystemTime::MIN)); | |
| 265 | ||
| 266 | // Now do the same again with checked_* but try by ± the lowest time precision. | |
| 267 | assert!(SystemTime::MAX.checked_add(MIN_INTERVAL).is_none()); | |
| 268 | assert!(SystemTime::MAX.checked_sub(MIN_INTERVAL).is_some()); | |
| 269 | assert!(SystemTime::MIN.checked_add(MIN_INTERVAL).is_some()); | |
| 270 | assert!(SystemTime::MIN.checked_sub(MIN_INTERVAL).is_none()); | |
| 271 | } |
src/doc/book+1-1| ... | ... | @@ -1 +1 @@ |
| 1 | Subproject commit 8c0eacd5c4acbb650497454f3a58c9e8083202a4 | |
| 1 | Subproject commit 39aeceaa3aeab845bc4517e7a44e48727d3b9dbe |
src/doc/edition-guide+1-1| ... | ... | @@ -1 +1 @@ |
| 1 | Subproject commit 9cf5443d632673c4d41edad5e8ed8be86eeb3b8f | |
| 1 | Subproject commit c3c0f0b3da26610138b7ba7663f60cd2c68cf184 |
src/doc/nomicon+1-1| ... | ... | @@ -1 +1 @@ |
| 1 | Subproject commit 0fe83ab28985b99aba36a1f0dbde3e08286fefda | |
| 1 | Subproject commit 9fe8fa599ad228dda74f240cc32b54bc5c1aa3e6 |
src/doc/reference+1-1| ... | ... | @@ -1 +1 @@ |
| 1 | Subproject commit b14b4e40f53ca468beaf2f5d0dfb4f4c4ba6bc7b | |
| 1 | Subproject commit 50c5de90487b68d429a30cc9466dc8f5b410128f |
src/doc/rust-by-example+1-1| ... | ... | @@ -1 +1 @@ |
| 1 | Subproject commit 111cfae2f9c3a43f7b0ff8fa68c51cc8f930637c | |
| 1 | Subproject commit 7d21279e40e8f0e91c2a22c5148dd2d745aef8b6 |
src/doc/rustc/book.toml-4| ... | ... | @@ -1,13 +1,9 @@ |
| 1 | 1 | [book] |
| 2 | multilingual = false | |
| 3 | src = "src" | |
| 4 | 2 | title = "The rustc book" |
| 5 | 3 | |
| 6 | 4 | [output.html] |
| 7 | 5 | git-repository-url = "https://github.com/rust-lang/rust/tree/HEAD/src/doc/rustc" |
| 8 | 6 | edit-url-template = "https://github.com/rust-lang/rust/edit/HEAD/src/doc/rustc/{path}" |
| 9 | additional-css = ["theme/pagetoc.css"] | |
| 10 | additional-js = ["theme/pagetoc.js"] | |
| 11 | 7 | |
| 12 | 8 | [output.html.search] |
| 13 | 9 | use-boolean-and = true |
src/doc/rustc/src/platform-support/armv7a-vex-v5.md+1-1| ... | ... | @@ -21,7 +21,7 @@ This target is cross-compiled. Dynamic linking is unsupported. |
| 21 | 21 | |
| 22 | 22 | `#![no_std]` crates can be built using `build-std` to build `core` and `panic_abort` and optionally `alloc`. Unwinding panics are not yet supported on this target. |
| 23 | 23 | |
| 24 | `std` has only partial support due platform limitations. Notably: | |
| 24 | `std` has only partial support due to platform limitations. Notably: | |
| 25 | 25 | - `std::process` and `std::net` are unimplemented. `std::thread` only supports sleeping and yielding, as this is a single-threaded environment. |
| 26 | 26 | - `std::time` has full support for `Instant`, but no support for `SystemTime`. |
| 27 | 27 | - `std::io` has full support for `stdin`/`stdout`/`stderr`. `stdout` and `stderr` both write to to USB channel 1 on this platform and are not differentiated. |
src/doc/rustc/theme/pagetoc.css deleted-84| ... | ... | @@ -1,84 +0,0 @@ |
| 1 | /* Inspired by https://github.com/JorelAli/mdBook-pagetoc/tree/98ee241 (under WTFPL) */ | |
| 2 | ||
| 3 | :root { | |
| 4 | --toc-width: 270px; | |
| 5 | --center-content-toc-shift: calc(-1 * var(--toc-width) / 2); | |
| 6 | } | |
| 7 | ||
| 8 | .nav-chapters { | |
| 9 | /* adjust width of buttons that bring to the previous or the next page */ | |
| 10 | min-width: 50px; | |
| 11 | } | |
| 12 | ||
| 13 | @media only screen { | |
| 14 | @media (max-width: 1179px) { | |
| 15 | .sidebar-hidden #sidetoc { | |
| 16 | display: none; | |
| 17 | } | |
| 18 | } | |
| 19 | ||
| 20 | @media (max-width: 1439px) { | |
| 21 | .sidebar-visible #sidetoc { | |
| 22 | display: none; | |
| 23 | } | |
| 24 | } | |
| 25 | ||
| 26 | @media (1180px <= width <= 1439px) { | |
| 27 | .sidebar-hidden main { | |
| 28 | position: relative; | |
| 29 | left: var(--center-content-toc-shift); | |
| 30 | } | |
| 31 | } | |
| 32 | ||
| 33 | @media (1440px <= width <= 1700px) { | |
| 34 | .sidebar-visible main { | |
| 35 | position: relative; | |
| 36 | left: var(--center-content-toc-shift); | |
| 37 | } | |
| 38 | } | |
| 39 | ||
| 40 | #sidetoc { | |
| 41 | margin-left: calc(100% + 20px); | |
| 42 | } | |
| 43 | #pagetoc { | |
| 44 | position: fixed; | |
| 45 | /* adjust TOC width */ | |
| 46 | width: var(--toc-width); | |
| 47 | height: calc(100vh - var(--menu-bar-height) - 0.67em * 4); | |
| 48 | overflow: auto; | |
| 49 | } | |
| 50 | #pagetoc a { | |
| 51 | border-left: 1px solid var(--sidebar-bg); | |
| 52 | color: var(--fg); | |
| 53 | display: block; | |
| 54 | padding-bottom: 5px; | |
| 55 | padding-top: 5px; | |
| 56 | padding-left: 10px; | |
| 57 | text-align: left; | |
| 58 | text-decoration: none; | |
| 59 | } | |
| 60 | #pagetoc a:hover, | |
| 61 | #pagetoc a.active { | |
| 62 | background: var(--sidebar-bg); | |
| 63 | color: var(--sidebar-active) !important; | |
| 64 | } | |
| 65 | #pagetoc .active { | |
| 66 | background: var(--sidebar-bg); | |
| 67 | color: var(--sidebar-active); | |
| 68 | } | |
| 69 | #pagetoc .pagetoc-H2 { | |
| 70 | padding-left: 20px; | |
| 71 | } | |
| 72 | #pagetoc .pagetoc-H3 { | |
| 73 | padding-left: 40px; | |
| 74 | } | |
| 75 | #pagetoc .pagetoc-H4 { | |
| 76 | padding-left: 60px; | |
| 77 | } | |
| 78 | } | |
| 79 | ||
| 80 | @media print { | |
| 81 | #sidetoc { | |
| 82 | display: none; | |
| 83 | } | |
| 84 | } |
src/doc/rustc/theme/pagetoc.js deleted-104| ... | ... | @@ -1,104 +0,0 @@ |
| 1 | // Inspired by https://github.com/JorelAli/mdBook-pagetoc/tree/98ee241 (under WTFPL) | |
| 2 | ||
| 3 | let activeHref = location.href; | |
| 4 | function updatePageToc(elem = undefined) { | |
| 5 | let selectedPageTocElem = elem; | |
| 6 | const pagetoc = document.getElementById("pagetoc"); | |
| 7 | ||
| 8 | function getRect(element) { | |
| 9 | return element.getBoundingClientRect(); | |
| 10 | } | |
| 11 | ||
| 12 | function overflowTop(container, element) { | |
| 13 | return getRect(container).top - getRect(element).top; | |
| 14 | } | |
| 15 | ||
| 16 | function overflowBottom(container, element) { | |
| 17 | return getRect(container).bottom - getRect(element).bottom; | |
| 18 | } | |
| 19 | ||
| 20 | // We've not selected a heading to highlight, and the URL needs updating | |
| 21 | // so we need to find a heading based on the URL | |
| 22 | if (selectedPageTocElem === undefined && location.href !== activeHref) { | |
| 23 | activeHref = location.href; | |
| 24 | for (const pageTocElement of pagetoc.children) { | |
| 25 | if (pageTocElement.href === activeHref) { | |
| 26 | selectedPageTocElem = pageTocElement; | |
| 27 | } | |
| 28 | } | |
| 29 | } | |
| 30 | ||
| 31 | // We still don't have a selected heading, let's try and find the most | |
| 32 | // suitable heading based on the scroll position | |
| 33 | if (selectedPageTocElem === undefined) { | |
| 34 | const margin = window.innerHeight / 3; | |
| 35 | ||
| 36 | const headers = document.getElementsByClassName("header"); | |
| 37 | for (let i = 0; i < headers.length; i++) { | |
| 38 | const header = headers[i]; | |
| 39 | if (selectedPageTocElem === undefined && getRect(header).top >= 0) { | |
| 40 | if (getRect(header).top < margin) { | |
| 41 | selectedPageTocElem = header; | |
| 42 | } else { | |
| 43 | selectedPageTocElem = headers[Math.max(0, i - 1)]; | |
| 44 | } | |
| 45 | } | |
| 46 | // a very long last section's heading is over the screen | |
| 47 | if (selectedPageTocElem === undefined && i === headers.length - 1) { | |
| 48 | selectedPageTocElem = header; | |
| 49 | } | |
| 50 | } | |
| 51 | } | |
| 52 | ||
| 53 | // Remove the active flag from all pagetoc elements | |
| 54 | for (const pageTocElement of pagetoc.children) { | |
| 55 | pageTocElement.classList.remove("active"); | |
| 56 | } | |
| 57 | ||
| 58 | // If we have a selected heading, set it to active and scroll to it | |
| 59 | if (selectedPageTocElem !== undefined) { | |
| 60 | for (const pageTocElement of pagetoc.children) { | |
| 61 | if (selectedPageTocElem.href.localeCompare(pageTocElement.href) === 0) { | |
| 62 | pageTocElement.classList.add("active"); | |
| 63 | if (overflowTop(pagetoc, pageTocElement) > 0) { | |
| 64 | pagetoc.scrollTop = pageTocElement.offsetTop; | |
| 65 | } | |
| 66 | if (overflowBottom(pagetoc, pageTocElement) < 0) { | |
| 67 | pagetoc.scrollTop -= overflowBottom(pagetoc, pageTocElement); | |
| 68 | } | |
| 69 | } | |
| 70 | } | |
| 71 | } | |
| 72 | } | |
| 73 | ||
| 74 | if (document.getElementById("sidetoc") === null && | |
| 75 | document.getElementsByClassName("header").length > 0) { | |
| 76 | // The sidetoc element doesn't exist yet, let's create it | |
| 77 | ||
| 78 | // Create the empty sidetoc and pagetoc elements | |
| 79 | const sidetoc = document.createElement("div"); | |
| 80 | const pagetoc = document.createElement("div"); | |
| 81 | sidetoc.id = "sidetoc"; | |
| 82 | pagetoc.id = "pagetoc"; | |
| 83 | sidetoc.appendChild(pagetoc); | |
| 84 | ||
| 85 | // And append them to the current DOM | |
| 86 | const main = document.querySelector('main'); | |
| 87 | main.insertBefore(sidetoc, main.firstChild); | |
| 88 | ||
| 89 | // Populate sidebar on load | |
| 90 | window.addEventListener("load", () => { | |
| 91 | for (const header of document.getElementsByClassName("header")) { | |
| 92 | const link = document.createElement("a"); | |
| 93 | link.innerHTML = header.innerHTML; | |
| 94 | link.href = header.hash; | |
| 95 | link.classList.add("pagetoc-" + header.parentElement.tagName); | |
| 96 | document.getElementById("pagetoc").appendChild(link); | |
| 97 | link.onclick = () => updatePageToc(link); | |
| 98 | } | |
| 99 | updatePageToc(); | |
| 100 | }); | |
| 101 | ||
| 102 | // Update page table of contents selected heading on scroll | |
| 103 | window.addEventListener("scroll", () => updatePageToc()); | |
| 104 | } |
src/doc/rustdoc/src/read-documentation/in-doc-settings.md+1-1| ... | ... | @@ -4,7 +4,7 @@ Rustdoc's HTML output includes a settings menu, and this chapter describes what |
| 4 | 4 | each setting in this menu does. |
| 5 | 5 | |
| 6 | 6 | It can be accessed by clicking on the gear button |
| 7 | (<i class="fa fa-cog" aria-hidden="true"></i>) in the upper right. | |
| 7 | (<i class="fas fa-gear" aria-hidden="true"></i>) in the upper right. | |
| 8 | 8 | |
| 9 | 9 | ## Changing displayed theme |
| 10 | 10 |
src/doc/style-guide/book.toml+1-3| ... | ... | @@ -1,8 +1,6 @@ |
| 1 | 1 | [book] |
| 2 | 2 | title = "The Rust Style Guide" |
| 3 | author = "The Rust Style Team" | |
| 4 | multilingual = false | |
| 5 | src = "src" | |
| 3 | authors = ["The Rust Style Team"] | |
| 6 | 4 | |
| 7 | 5 | [output.html] |
| 8 | 6 | git-repository-url = "https://github.com/rust-lang/rust/tree/HEAD/src/doc/style-guide/" |
src/doc/unstable-book/book.toml-1| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | [book] |
| 2 | 2 | title = "The Rust Unstable Book" |
| 3 | author = "The Rust Community" | |
| 4 | 3 | |
| 5 | 4 | [output.html] |
| 6 | 5 | git-repository-url = "https://github.com/rust-lang/rust/tree/HEAD/src/doc/unstable-book" |
src/tools/error_index_generator/Cargo.toml+2-1| ... | ... | @@ -5,7 +5,8 @@ edition = "2021" |
| 5 | 5 | workspace = "../rustbook" |
| 6 | 6 | |
| 7 | 7 | [dependencies] |
| 8 | mdbook = { version = "0.4", default-features = false, features = ["search"] } | |
| 8 | mdbook-driver = { version = "0.5.1", features = ["search"] } | |
| 9 | mdbook-summary = "0.5.1" | |
| 9 | 10 | |
| 10 | 11 | [[bin]] |
| 11 | 12 | name = "error_index_generator" |
src/tools/error_index_generator/main.rs+5-3| ... | ... | @@ -12,8 +12,10 @@ use std::io::Write; |
| 12 | 12 | use std::path::{Path, PathBuf}; |
| 13 | 13 | use std::str::FromStr; |
| 14 | 14 | |
| 15 | use mdbook::book::{BookItem, Chapter, parse_summary}; | |
| 16 | use mdbook::{Config, MDBook}; | |
| 15 | use mdbook_driver::MDBook; | |
| 16 | use mdbook_driver::book::{BookItem, Chapter}; | |
| 17 | use mdbook_driver::config::Config; | |
| 18 | use mdbook_summary::parse_summary; | |
| 17 | 19 | use rustc_errors::codes::DIAGNOSTICS; |
| 18 | 20 | |
| 19 | 21 | enum OutputFormat { |
| ... | ... | @@ -121,7 +123,7 @@ This page lists all the error codes emitted by the Rust compiler. |
| 121 | 123 | source_path: None, |
| 122 | 124 | parent_names: Vec::new(), |
| 123 | 125 | }; |
| 124 | book.book.sections.push(BookItem::Chapter(chapter)); | |
| 126 | book.book.items.push(BookItem::Chapter(chapter)); | |
| 125 | 127 | book.build()?; |
| 126 | 128 | |
| 127 | 129 | // The error-index used to be generated manually (without mdbook), and the |
src/tools/rustbook/Cargo.lock+313-586| ... | ... | @@ -17,19 +17,6 @@ dependencies = [ |
| 17 | 17 | "memchr", |
| 18 | 18 | ] |
| 19 | 19 | |
| 20 | [[package]] | |
| 21 | name = "ammonia" | |
| 22 | version = "4.1.2" | |
| 23 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 24 | checksum = "17e913097e1a2124b46746c980134e8c954bc17a6a59bb3fde96f088d126dde6" | |
| 25 | dependencies = [ | |
| 26 | "cssparser", | |
| 27 | "html5ever", | |
| 28 | "maplit", | |
| 29 | "tendril", | |
| 30 | "url", | |
| 31 | ] | |
| 32 | ||
| 33 | 20 | [[package]] |
| 34 | 21 | name = "android_system_properties" |
| 35 | 22 | version = "0.1.5" |
| ... | ... | @@ -110,6 +97,21 @@ dependencies = [ |
| 110 | 97 | "serde", |
| 111 | 98 | ] |
| 112 | 99 | |
| 100 | [[package]] | |
| 101 | name = "bit-set" | |
| 102 | version = "0.8.0" | |
| 103 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 104 | checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" | |
| 105 | dependencies = [ | |
| 106 | "bit-vec", | |
| 107 | ] | |
| 108 | ||
| 109 | [[package]] | |
| 110 | name = "bit-vec" | |
| 111 | version = "0.8.0" | |
| 112 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 113 | checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" | |
| 114 | ||
| 113 | 115 | [[package]] |
| 114 | 116 | name = "bitflags" |
| 115 | 117 | version = "2.10.0" |
| ... | ... | @@ -125,17 +127,6 @@ dependencies = [ |
| 125 | 127 | "generic-array", |
| 126 | 128 | ] |
| 127 | 129 | |
| 128 | [[package]] | |
| 129 | name = "bstr" | |
| 130 | version = "1.12.1" | |
| 131 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 132 | checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" | |
| 133 | dependencies = [ | |
| 134 | "memchr", | |
| 135 | "regex-automata", | |
| 136 | "serde", | |
| 137 | ] | |
| 138 | ||
| 139 | 130 | [[package]] |
| 140 | 131 | name = "bumpalo" |
| 141 | 132 | version = "3.19.0" |
| ... | ... | @@ -191,16 +182,6 @@ dependencies = [ |
| 191 | 182 | "anstyle", |
| 192 | 183 | "clap_lex", |
| 193 | 184 | "strsim", |
| 194 | "terminal_size", | |
| 195 | ] | |
| 196 | ||
| 197 | [[package]] | |
| 198 | name = "clap_complete" | |
| 199 | version = "4.5.60" | |
| 200 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 201 | checksum = "8e602857739c5a4291dfa33b5a298aeac9006185229a700e5810a3ef7272d971" | |
| 202 | dependencies = [ | |
| 203 | "clap", | |
| 204 | 185 | ] |
| 205 | 186 | |
| 206 | 187 | [[package]] |
| ... | ... | @@ -261,29 +242,6 @@ dependencies = [ |
| 261 | 242 | "typenum", |
| 262 | 243 | ] |
| 263 | 244 | |
| 264 | [[package]] | |
| 265 | name = "cssparser" | |
| 266 | version = "0.35.0" | |
| 267 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 268 | checksum = "4e901edd733a1472f944a45116df3f846f54d37e67e68640ac8bb69689aca2aa" | |
| 269 | dependencies = [ | |
| 270 | "cssparser-macros", | |
| 271 | "dtoa-short", | |
| 272 | "itoa", | |
| 273 | "phf 0.11.3", | |
| 274 | "smallvec", | |
| 275 | ] | |
| 276 | ||
| 277 | [[package]] | |
| 278 | name = "cssparser-macros" | |
| 279 | version = "0.6.1" | |
| 280 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 281 | checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" | |
| 282 | dependencies = [ | |
| 283 | "quote", | |
| 284 | "syn", | |
| 285 | ] | |
| 286 | ||
| 287 | 245 | [[package]] |
| 288 | 246 | name = "darling" |
| 289 | 247 | version = "0.20.11" |
| ... | ... | @@ -372,17 +330,6 @@ dependencies = [ |
| 372 | 330 | "crypto-common", |
| 373 | 331 | ] |
| 374 | 332 | |
| 375 | [[package]] | |
| 376 | name = "displaydoc" | |
| 377 | version = "0.2.5" | |
| 378 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 379 | checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" | |
| 380 | dependencies = [ | |
| 381 | "proc-macro2", | |
| 382 | "quote", | |
| 383 | "syn", | |
| 384 | ] | |
| 385 | ||
| 386 | 333 | [[package]] |
| 387 | 334 | name = "doc-comment" |
| 388 | 335 | version = "0.3.4" |
| ... | ... | @@ -390,19 +337,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" |
| 390 | 337 | checksum = "780955b8b195a21ab8e4ac6b60dd1dbdcec1dc6c51c0617964b08c81785e12c9" |
| 391 | 338 | |
| 392 | 339 | [[package]] |
| 393 | name = "dtoa" | |
| 394 | version = "1.0.10" | |
| 340 | name = "ego-tree" | |
| 341 | version = "0.10.0" | |
| 395 | 342 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 396 | checksum = "d6add3b8cff394282be81f3fc1a0605db594ed69890078ca6e2cab1c408bcf04" | |
| 397 | ||
| 398 | [[package]] | |
| 399 | name = "dtoa-short" | |
| 400 | version = "0.3.5" | |
| 401 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 402 | checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" | |
| 403 | dependencies = [ | |
| 404 | "dtoa", | |
| 405 | ] | |
| 343 | checksum = "b2972feb8dffe7bc8c5463b1dacda1b0dfbed3710e50f977d965429692d74cd8" | |
| 406 | 344 | |
| 407 | 345 | [[package]] |
| 408 | 346 | name = "elasticlunr-rs" |
| ... | ... | @@ -416,29 +354,6 @@ dependencies = [ |
| 416 | 354 | "serde_json", |
| 417 | 355 | ] |
| 418 | 356 | |
| 419 | [[package]] | |
| 420 | name = "env_filter" | |
| 421 | version = "0.1.4" | |
| 422 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 423 | checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" | |
| 424 | dependencies = [ | |
| 425 | "log", | |
| 426 | "regex", | |
| 427 | ] | |
| 428 | ||
| 429 | [[package]] | |
| 430 | name = "env_logger" | |
| 431 | version = "0.11.8" | |
| 432 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 433 | checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" | |
| 434 | dependencies = [ | |
| 435 | "anstream", | |
| 436 | "anstyle", | |
| 437 | "env_filter", | |
| 438 | "jiff", | |
| 439 | "log", | |
| 440 | ] | |
| 441 | ||
| 442 | 357 | [[package]] |
| 443 | 358 | name = "equivalent" |
| 444 | 359 | version = "1.0.2" |
| ... | ... | @@ -459,7 +374,19 @@ dependencies = [ |
| 459 | 374 | name = "error_index_generator" |
| 460 | 375 | version = "0.0.0" |
| 461 | 376 | dependencies = [ |
| 462 | "mdbook", | |
| 377 | "mdbook-driver", | |
| 378 | "mdbook-summary", | |
| 379 | ] | |
| 380 | ||
| 381 | [[package]] | |
| 382 | name = "fancy-regex" | |
| 383 | version = "0.16.2" | |
| 384 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 385 | checksum = "998b056554fbe42e03ae0e152895cd1a7e1002aec800fdc6635d20270260c46f" | |
| 386 | dependencies = [ | |
| 387 | "bit-set", | |
| 388 | "regex-automata", | |
| 389 | "regex-syntax", | |
| 463 | 390 | ] |
| 464 | 391 | |
| 465 | 392 | [[package]] |
| ... | ... | @@ -491,13 +418,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" |
| 491 | 418 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" |
| 492 | 419 | |
| 493 | 420 | [[package]] |
| 494 | name = "form_urlencoded" | |
| 495 | version = "1.2.2" | |
| 421 | name = "font-awesome-as-a-crate" | |
| 422 | version = "0.3.0" | |
| 496 | 423 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 497 | checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" | |
| 498 | dependencies = [ | |
| 499 | "percent-encoding", | |
| 500 | ] | |
| 424 | checksum = "932dcfbd51320af5f27f1ba02d2e567dec332cac7d2c221ba45d8e767264c4dc" | |
| 501 | 425 | |
| 502 | 426 | [[package]] |
| 503 | 427 | name = "futf" |
| ... | ... | @@ -558,9 +482,9 @@ dependencies = [ |
| 558 | 482 | |
| 559 | 483 | [[package]] |
| 560 | 484 | name = "hashbrown" |
| 561 | version = "0.16.0" | |
| 485 | version = "0.16.1" | |
| 562 | 486 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 563 | checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" | |
| 487 | checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" | |
| 564 | 488 | |
| 565 | 489 | [[package]] |
| 566 | 490 | name = "heck" |
| ... | ... | @@ -576,13 +500,12 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" |
| 576 | 500 | |
| 577 | 501 | [[package]] |
| 578 | 502 | name = "html5ever" |
| 579 | version = "0.35.0" | |
| 503 | version = "0.36.1" | |
| 580 | 504 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 581 | checksum = "55d958c2f74b664487a2035fe1dadb032c48718a03b63f3ab0b8537db8549ed4" | |
| 505 | checksum = "6452c4751a24e1b99c3260d505eaeee76a050573e61f30ac2c924ddc7236f01e" | |
| 582 | 506 | dependencies = [ |
| 583 | 507 | "log", |
| 584 | 508 | "markup5ever", |
| 585 | "match_token", | |
| 586 | 509 | ] |
| 587 | 510 | |
| 588 | 511 | [[package]] |
| ... | ... | @@ -624,119 +547,17 @@ dependencies = [ |
| 624 | 547 | "cc", |
| 625 | 548 | ] |
| 626 | 549 | |
| 627 | [[package]] | |
| 628 | name = "icu_collections" | |
| 629 | version = "2.1.1" | |
| 630 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 631 | checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" | |
| 632 | dependencies = [ | |
| 633 | "displaydoc", | |
| 634 | "potential_utf", | |
| 635 | "yoke", | |
| 636 | "zerofrom", | |
| 637 | "zerovec", | |
| 638 | ] | |
| 639 | ||
| 640 | [[package]] | |
| 641 | name = "icu_locale_core" | |
| 642 | version = "2.1.1" | |
| 643 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 644 | checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" | |
| 645 | dependencies = [ | |
| 646 | "displaydoc", | |
| 647 | "litemap", | |
| 648 | "tinystr", | |
| 649 | "writeable", | |
| 650 | "zerovec", | |
| 651 | ] | |
| 652 | ||
| 653 | [[package]] | |
| 654 | name = "icu_normalizer" | |
| 655 | version = "2.1.1" | |
| 656 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 657 | checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" | |
| 658 | dependencies = [ | |
| 659 | "icu_collections", | |
| 660 | "icu_normalizer_data", | |
| 661 | "icu_properties", | |
| 662 | "icu_provider", | |
| 663 | "smallvec", | |
| 664 | "zerovec", | |
| 665 | ] | |
| 666 | ||
| 667 | [[package]] | |
| 668 | name = "icu_normalizer_data" | |
| 669 | version = "2.1.1" | |
| 670 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 671 | checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" | |
| 672 | ||
| 673 | [[package]] | |
| 674 | name = "icu_properties" | |
| 675 | version = "2.1.1" | |
| 676 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 677 | checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99" | |
| 678 | dependencies = [ | |
| 679 | "icu_collections", | |
| 680 | "icu_locale_core", | |
| 681 | "icu_properties_data", | |
| 682 | "icu_provider", | |
| 683 | "zerotrie", | |
| 684 | "zerovec", | |
| 685 | ] | |
| 686 | ||
| 687 | [[package]] | |
| 688 | name = "icu_properties_data" | |
| 689 | version = "2.1.1" | |
| 690 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 691 | checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899" | |
| 692 | ||
| 693 | [[package]] | |
| 694 | name = "icu_provider" | |
| 695 | version = "2.1.1" | |
| 696 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 697 | checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" | |
| 698 | dependencies = [ | |
| 699 | "displaydoc", | |
| 700 | "icu_locale_core", | |
| 701 | "writeable", | |
| 702 | "yoke", | |
| 703 | "zerofrom", | |
| 704 | "zerotrie", | |
| 705 | "zerovec", | |
| 706 | ] | |
| 707 | ||
| 708 | 550 | [[package]] |
| 709 | 551 | name = "ident_case" |
| 710 | 552 | version = "1.0.1" |
| 711 | 553 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 712 | 554 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" |
| 713 | 555 | |
| 714 | [[package]] | |
| 715 | name = "idna" | |
| 716 | version = "1.1.0" | |
| 717 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 718 | checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" | |
| 719 | dependencies = [ | |
| 720 | "idna_adapter", | |
| 721 | "smallvec", | |
| 722 | "utf8_iter", | |
| 723 | ] | |
| 724 | ||
| 725 | [[package]] | |
| 726 | name = "idna_adapter" | |
| 727 | version = "1.2.1" | |
| 728 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 729 | checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" | |
| 730 | dependencies = [ | |
| 731 | "icu_normalizer", | |
| 732 | "icu_properties", | |
| 733 | ] | |
| 734 | ||
| 735 | 556 | [[package]] |
| 736 | 557 | name = "indexmap" |
| 737 | version = "2.12.0" | |
| 558 | version = "2.12.1" | |
| 738 | 559 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 739 | checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" | |
| 560 | checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" | |
| 740 | 561 | dependencies = [ |
| 741 | 562 | "equivalent", |
| 742 | 563 | "hashbrown", |
| ... | ... | @@ -754,30 +575,6 @@ version = "1.0.15" |
| 754 | 575 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 755 | 576 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" |
| 756 | 577 | |
| 757 | [[package]] | |
| 758 | name = "jiff" | |
| 759 | version = "0.2.16" | |
| 760 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 761 | checksum = "49cce2b81f2098e7e3efc35bc2e0a6b7abec9d34128283d7a26fa8f32a6dbb35" | |
| 762 | dependencies = [ | |
| 763 | "jiff-static", | |
| 764 | "log", | |
| 765 | "portable-atomic", | |
| 766 | "portable-atomic-util", | |
| 767 | "serde_core", | |
| 768 | ] | |
| 769 | ||
| 770 | [[package]] | |
| 771 | name = "jiff-static" | |
| 772 | version = "0.2.16" | |
| 773 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 774 | checksum = "980af8b43c3ad5d8d349ace167ec8170839f753a42d233ba19e08afe1850fa69" | |
| 775 | dependencies = [ | |
| 776 | "proc-macro2", | |
| 777 | "quote", | |
| 778 | "syn", | |
| 779 | ] | |
| 780 | ||
| 781 | 578 | [[package]] |
| 782 | 579 | name = "js-sys" |
| 783 | 580 | version = "0.3.82" |
| ... | ... | @@ -815,12 +612,6 @@ version = "0.11.0" |
| 815 | 612 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 816 | 613 | checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" |
| 817 | 614 | |
| 818 | [[package]] | |
| 819 | name = "litemap" | |
| 820 | version = "0.8.1" | |
| 821 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 822 | checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" | |
| 823 | ||
| 824 | 615 | [[package]] |
| 825 | 616 | name = "lock_api" |
| 826 | 617 | version = "0.4.14" |
| ... | ... | @@ -842,17 +633,11 @@ version = "0.1.1" |
| 842 | 633 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 843 | 634 | checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" |
| 844 | 635 | |
| 845 | [[package]] | |
| 846 | name = "maplit" | |
| 847 | version = "1.0.2" | |
| 848 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 849 | checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" | |
| 850 | ||
| 851 | 636 | [[package]] |
| 852 | 637 | name = "markup5ever" |
| 853 | version = "0.35.0" | |
| 638 | version = "0.36.1" | |
| 854 | 639 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 855 | checksum = "311fe69c934650f8f19652b3946075f0fc41ad8757dbb68f1ca14e7900ecc1c3" | |
| 640 | checksum = "6c3294c4d74d0742910f8c7b466f44dda9eb2d5742c1e430138df290a1e8451c" | |
| 856 | 641 | dependencies = [ |
| 857 | 642 | "log", |
| 858 | 643 | "tendril", |
| ... | ... | @@ -860,58 +645,91 @@ dependencies = [ |
| 860 | 645 | ] |
| 861 | 646 | |
| 862 | 647 | [[package]] |
| 863 | name = "match_token" | |
| 864 | version = "0.35.0" | |
| 648 | name = "matchers" | |
| 649 | version = "0.2.0" | |
| 865 | 650 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 866 | checksum = "ac84fd3f360fcc43dc5f5d186f02a94192761a080e8bc58621ad4d12296a58cf" | |
| 651 | checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" | |
| 867 | 652 | dependencies = [ |
| 868 | "proc-macro2", | |
| 869 | "quote", | |
| 870 | "syn", | |
| 653 | "regex-automata", | |
| 871 | 654 | ] |
| 872 | 655 | |
| 873 | 656 | [[package]] |
| 874 | name = "mdbook" | |
| 875 | version = "0.4.52" | |
| 657 | name = "mdbook-core" | |
| 658 | version = "0.5.2" | |
| 876 | 659 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 877 | checksum = "93c284d2855916af7c5919cf9ad897cfc77d3c2db6f55429c7cfb769182030ec" | |
| 660 | checksum = "39a3873d4afac65583f1acb56ff058df989d5b4a2464bb02c785549727d307ee" | |
| 878 | 661 | dependencies = [ |
| 879 | "ammonia", | |
| 880 | 662 | "anyhow", |
| 881 | "chrono", | |
| 882 | "clap", | |
| 883 | "clap_complete", | |
| 663 | "regex", | |
| 664 | "serde", | |
| 665 | "serde_json", | |
| 666 | "toml 0.9.8", | |
| 667 | "tracing", | |
| 668 | ] | |
| 669 | ||
| 670 | [[package]] | |
| 671 | name = "mdbook-driver" | |
| 672 | version = "0.5.2" | |
| 673 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 674 | checksum = "a229930b29a9908560883e1f386eae25d8a971d259a80f49916a50627f04a42d" | |
| 675 | dependencies = [ | |
| 676 | "anyhow", | |
| 677 | "indexmap", | |
| 678 | "mdbook-core", | |
| 679 | "mdbook-html", | |
| 680 | "mdbook-markdown", | |
| 681 | "mdbook-preprocessor", | |
| 682 | "mdbook-renderer", | |
| 683 | "mdbook-summary", | |
| 684 | "regex", | |
| 685 | "serde", | |
| 686 | "serde_json", | |
| 687 | "shlex", | |
| 688 | "tempfile", | |
| 689 | "toml 0.9.8", | |
| 690 | "topological-sort", | |
| 691 | "tracing", | |
| 692 | ] | |
| 693 | ||
| 694 | [[package]] | |
| 695 | name = "mdbook-html" | |
| 696 | version = "0.5.2" | |
| 697 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 698 | checksum = "9dee80c03c65e3212fb528b8c9be5568a6a85cf795d03cf9fd6ba39ad52069ca" | |
| 699 | dependencies = [ | |
| 700 | "anyhow", | |
| 701 | "ego-tree", | |
| 884 | 702 | "elasticlunr-rs", |
| 885 | "env_logger", | |
| 703 | "font-awesome-as-a-crate", | |
| 886 | 704 | "handlebars", |
| 887 | 705 | "hex", |
| 888 | "log", | |
| 889 | "memchr", | |
| 890 | "opener", | |
| 891 | "pulldown-cmark 0.10.3", | |
| 706 | "html5ever", | |
| 707 | "indexmap", | |
| 708 | "mdbook-core", | |
| 709 | "mdbook-markdown", | |
| 710 | "mdbook-renderer", | |
| 711 | "pulldown-cmark 0.13.0", | |
| 892 | 712 | "regex", |
| 893 | 713 | "serde", |
| 894 | 714 | "serde_json", |
| 895 | 715 | "sha2", |
| 896 | "shlex", | |
| 897 | "tempfile", | |
| 898 | "toml 0.5.11", | |
| 899 | "topological-sort", | |
| 716 | "tracing", | |
| 900 | 717 | ] |
| 901 | 718 | |
| 902 | 719 | [[package]] |
| 903 | 720 | name = "mdbook-i18n-helpers" |
| 904 | version = "0.3.6" | |
| 721 | version = "0.4.0" | |
| 905 | 722 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 906 | checksum = "5644bf29b95683ea60979e30188221c374965c3a1dc0ad2d5c69e867dc0c09dc" | |
| 723 | checksum = "82a64b6c27dc99a20968cc85a89dcfe0d36f82e2c9bc3b4342a2ffc55158822f" | |
| 907 | 724 | dependencies = [ |
| 908 | 725 | "anyhow", |
| 909 | 726 | "chrono", |
| 910 | 727 | "dateparser", |
| 911 | "mdbook", | |
| 728 | "mdbook-preprocessor", | |
| 729 | "mdbook-renderer", | |
| 912 | 730 | "polib", |
| 913 | "pulldown-cmark 0.12.2", | |
| 914 | "pulldown-cmark-to-cmark 20.0.1", | |
| 731 | "pulldown-cmark 0.13.0", | |
| 732 | "pulldown-cmark-to-cmark 21.1.0", | |
| 915 | 733 | "regex", |
| 916 | 734 | "semver", |
| 917 | 735 | "serde_json", |
| ... | ... | @@ -919,15 +737,50 @@ dependencies = [ |
| 919 | 737 | "textwrap", |
| 920 | 738 | ] |
| 921 | 739 | |
| 740 | [[package]] | |
| 741 | name = "mdbook-markdown" | |
| 742 | version = "0.5.2" | |
| 743 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 744 | checksum = "07c41bf35212f5d8b83e543aa6a4887dc5709c8489c5fb9ed00f1b51ce1a2cc6" | |
| 745 | dependencies = [ | |
| 746 | "pulldown-cmark 0.13.0", | |
| 747 | "regex", | |
| 748 | "tracing", | |
| 749 | ] | |
| 750 | ||
| 751 | [[package]] | |
| 752 | name = "mdbook-preprocessor" | |
| 753 | version = "0.5.2" | |
| 754 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 755 | checksum = "4d87bf40be0597f26f0822f939a64f02bf92c4655ba04490aadbf83601a013bb" | |
| 756 | dependencies = [ | |
| 757 | "anyhow", | |
| 758 | "mdbook-core", | |
| 759 | "serde", | |
| 760 | "serde_json", | |
| 761 | ] | |
| 762 | ||
| 763 | [[package]] | |
| 764 | name = "mdbook-renderer" | |
| 765 | version = "0.5.2" | |
| 766 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 767 | checksum = "93ed59f225b3ae4283c56bea633db83184627a090d892908bd66990c68e10b43" | |
| 768 | dependencies = [ | |
| 769 | "anyhow", | |
| 770 | "mdbook-core", | |
| 771 | "serde", | |
| 772 | "serde_json", | |
| 773 | ] | |
| 774 | ||
| 922 | 775 | [[package]] |
| 923 | 776 | name = "mdbook-spec" |
| 924 | 777 | version = "0.1.2" |
| 925 | 778 | dependencies = [ |
| 926 | 779 | "anyhow", |
| 927 | "mdbook", | |
| 780 | "mdbook-markdown", | |
| 781 | "mdbook-preprocessor", | |
| 928 | 782 | "once_cell", |
| 929 | 783 | "pathdiff", |
| 930 | "pulldown-cmark 0.10.3", | |
| 931 | 784 | "railroad", |
| 932 | 785 | "regex", |
| 933 | 786 | "semver", |
| ... | ... | @@ -936,6 +789,20 @@ dependencies = [ |
| 936 | 789 | "walkdir", |
| 937 | 790 | ] |
| 938 | 791 | |
| 792 | [[package]] | |
| 793 | name = "mdbook-summary" | |
| 794 | version = "0.5.2" | |
| 795 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 796 | checksum = "c00d85b291d67a69c92e939450390fe34d6ea418a868c8f7b42f0b300af35a7b" | |
| 797 | dependencies = [ | |
| 798 | "anyhow", | |
| 799 | "mdbook-core", | |
| 800 | "memchr", | |
| 801 | "pulldown-cmark 0.13.0", | |
| 802 | "serde", | |
| 803 | "tracing", | |
| 804 | ] | |
| 805 | ||
| 939 | 806 | [[package]] |
| 940 | 807 | name = "mdbook-trpl" |
| 941 | 808 | version = "0.1.0" |
| ... | ... | @@ -943,9 +810,10 @@ dependencies = [ |
| 943 | 810 | "anyhow", |
| 944 | 811 | "clap", |
| 945 | 812 | "html_parser", |
| 946 | "mdbook", | |
| 813 | "mdbook-preprocessor", | |
| 947 | 814 | "pulldown-cmark 0.12.2", |
| 948 | 815 | "pulldown-cmark-to-cmark 19.0.1", |
| 816 | "serde", | |
| 949 | 817 | "serde_json", |
| 950 | 818 | "thiserror 1.0.69", |
| 951 | 819 | "toml 0.8.23", |
| ... | ... | @@ -974,10 +842,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" |
| 974 | 842 | checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" |
| 975 | 843 | |
| 976 | 844 | [[package]] |
| 977 | name = "normpath" | |
| 978 | version = "1.5.0" | |
| 845 | name = "nu-ansi-term" | |
| 846 | version = "0.50.3" | |
| 979 | 847 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 980 | checksum = "bf23ab2b905654b4cb177e30b629937b3868311d4e1cba859f899c041046e69b" | |
| 848 | checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" | |
| 981 | 849 | dependencies = [ |
| 982 | 850 | "windows-sys 0.61.2", |
| 983 | 851 | ] |
| ... | ... | @@ -1018,39 +886,6 @@ version = "1.70.2" |
| 1018 | 886 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1019 | 887 | checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" |
| 1020 | 888 | |
| 1021 | [[package]] | |
| 1022 | name = "onig" | |
| 1023 | version = "6.5.1" | |
| 1024 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1025 | checksum = "336b9c63443aceef14bea841b899035ae3abe89b7c486aaf4c5bd8aafedac3f0" | |
| 1026 | dependencies = [ | |
| 1027 | "bitflags", | |
| 1028 | "libc", | |
| 1029 | "once_cell", | |
| 1030 | "onig_sys", | |
| 1031 | ] | |
| 1032 | ||
| 1033 | [[package]] | |
| 1034 | name = "onig_sys" | |
| 1035 | version = "69.9.1" | |
| 1036 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1037 | checksum = "c7f86c6eef3d6df15f23bcfb6af487cbd2fed4e5581d58d5bf1f5f8b7f6727dc" | |
| 1038 | dependencies = [ | |
| 1039 | "cc", | |
| 1040 | "pkg-config", | |
| 1041 | ] | |
| 1042 | ||
| 1043 | [[package]] | |
| 1044 | name = "opener" | |
| 1045 | version = "0.8.3" | |
| 1046 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1047 | checksum = "cb9024962ab91e00c89d2a14352a8d0fc1a64346bf96f1839b45c09149564e47" | |
| 1048 | dependencies = [ | |
| 1049 | "bstr", | |
| 1050 | "normpath", | |
| 1051 | "windows-sys 0.60.2", | |
| 1052 | ] | |
| 1053 | ||
| 1054 | 889 | [[package]] |
| 1055 | 890 | name = "parking_lot" |
| 1056 | 891 | version = "0.12.5" |
| ... | ... | @@ -1080,12 +915,6 @@ version = "0.2.3" |
| 1080 | 915 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1081 | 916 | checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" |
| 1082 | 917 | |
| 1083 | [[package]] | |
| 1084 | name = "percent-encoding" | |
| 1085 | version = "2.3.2" | |
| 1086 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1087 | checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" | |
| 1088 | ||
| 1089 | 918 | [[package]] |
| 1090 | 919 | name = "pest" |
| 1091 | 920 | version = "2.8.3" |
| ... | ... | @@ -1129,23 +958,13 @@ dependencies = [ |
| 1129 | 958 | "sha2", |
| 1130 | 959 | ] |
| 1131 | 960 | |
| 1132 | [[package]] | |
| 1133 | name = "phf" | |
| 1134 | version = "0.11.3" | |
| 1135 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1136 | checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" | |
| 1137 | dependencies = [ | |
| 1138 | "phf_macros", | |
| 1139 | "phf_shared 0.11.3", | |
| 1140 | ] | |
| 1141 | ||
| 1142 | 961 | [[package]] |
| 1143 | 962 | name = "phf" |
| 1144 | 963 | version = "0.13.1" |
| 1145 | 964 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1146 | 965 | checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" |
| 1147 | 966 | dependencies = [ |
| 1148 | "phf_shared 0.13.1", | |
| 967 | "phf_shared", | |
| 1149 | 968 | "serde", |
| 1150 | 969 | ] |
| 1151 | 970 | |
| ... | ... | @@ -1155,18 +974,8 @@ version = "0.13.1" |
| 1155 | 974 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1156 | 975 | checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" |
| 1157 | 976 | dependencies = [ |
| 1158 | "phf_generator 0.13.1", | |
| 1159 | "phf_shared 0.13.1", | |
| 1160 | ] | |
| 1161 | ||
| 1162 | [[package]] | |
| 1163 | name = "phf_generator" | |
| 1164 | version = "0.11.3" | |
| 1165 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1166 | checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" | |
| 1167 | dependencies = [ | |
| 1168 | "phf_shared 0.11.3", | |
| 1169 | "rand", | |
| 977 | "phf_generator", | |
| 978 | "phf_shared", | |
| 1170 | 979 | ] |
| 1171 | 980 | |
| 1172 | 981 | [[package]] |
| ... | ... | @@ -1176,29 +985,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1176 | 985 | checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" |
| 1177 | 986 | dependencies = [ |
| 1178 | 987 | "fastrand", |
| 1179 | "phf_shared 0.13.1", | |
| 1180 | ] | |
| 1181 | ||
| 1182 | [[package]] | |
| 1183 | name = "phf_macros" | |
| 1184 | version = "0.11.3" | |
| 1185 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1186 | checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" | |
| 1187 | dependencies = [ | |
| 1188 | "phf_generator 0.11.3", | |
| 1189 | "phf_shared 0.11.3", | |
| 1190 | "proc-macro2", | |
| 1191 | "quote", | |
| 1192 | "syn", | |
| 1193 | ] | |
| 1194 | ||
| 1195 | [[package]] | |
| 1196 | name = "phf_shared" | |
| 1197 | version = "0.11.3" | |
| 1198 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1199 | checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" | |
| 1200 | dependencies = [ | |
| 1201 | "siphasher", | |
| 988 | "phf_shared", | |
| 1202 | 989 | ] |
| 1203 | 990 | |
| 1204 | 991 | [[package]] |
| ... | ... | @@ -1211,10 +998,10 @@ dependencies = [ |
| 1211 | 998 | ] |
| 1212 | 999 | |
| 1213 | 1000 | [[package]] |
| 1214 | name = "pkg-config" | |
| 1215 | version = "0.3.32" | |
| 1001 | name = "pin-project-lite" | |
| 1002 | version = "0.2.16" | |
| 1216 | 1003 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1217 | checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" | |
| 1004 | checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" | |
| 1218 | 1005 | |
| 1219 | 1006 | [[package]] |
| 1220 | 1007 | name = "polib" |
| ... | ... | @@ -1225,30 +1012,6 @@ dependencies = [ |
| 1225 | 1012 | "linereader", |
| 1226 | 1013 | ] |
| 1227 | 1014 | |
| 1228 | [[package]] | |
| 1229 | name = "portable-atomic" | |
| 1230 | version = "1.11.1" | |
| 1231 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1232 | checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" | |
| 1233 | ||
| 1234 | [[package]] | |
| 1235 | name = "portable-atomic-util" | |
| 1236 | version = "0.2.4" | |
| 1237 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1238 | checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" | |
| 1239 | dependencies = [ | |
| 1240 | "portable-atomic", | |
| 1241 | ] | |
| 1242 | ||
| 1243 | [[package]] | |
| 1244 | name = "potential_utf" | |
| 1245 | version = "0.1.4" | |
| 1246 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1247 | checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" | |
| 1248 | dependencies = [ | |
| 1249 | "zerovec", | |
| 1250 | ] | |
| 1251 | ||
| 1252 | 1015 | [[package]] |
| 1253 | 1016 | name = "precomputed-hash" |
| 1254 | 1017 | version = "0.1.1" |
| ... | ... | @@ -1266,35 +1029,29 @@ dependencies = [ |
| 1266 | 1029 | |
| 1267 | 1030 | [[package]] |
| 1268 | 1031 | name = "pulldown-cmark" |
| 1269 | version = "0.10.3" | |
| 1032 | version = "0.12.2" | |
| 1270 | 1033 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1271 | checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" | |
| 1034 | checksum = "f86ba2052aebccc42cbbb3ed234b8b13ce76f75c3551a303cb2bcffcff12bb14" | |
| 1272 | 1035 | dependencies = [ |
| 1273 | 1036 | "bitflags", |
| 1037 | "getopts", | |
| 1274 | 1038 | "memchr", |
| 1275 | "pulldown-cmark-escape 0.10.1", | |
| 1039 | "pulldown-cmark-escape", | |
| 1276 | 1040 | "unicase", |
| 1277 | 1041 | ] |
| 1278 | 1042 | |
| 1279 | 1043 | [[package]] |
| 1280 | 1044 | name = "pulldown-cmark" |
| 1281 | version = "0.12.2" | |
| 1045 | version = "0.13.0" | |
| 1282 | 1046 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1283 | checksum = "f86ba2052aebccc42cbbb3ed234b8b13ce76f75c3551a303cb2bcffcff12bb14" | |
| 1047 | checksum = "1e8bbe1a966bd2f362681a44f6edce3c2310ac21e4d5067a6e7ec396297a6ea0" | |
| 1284 | 1048 | dependencies = [ |
| 1285 | 1049 | "bitflags", |
| 1286 | "getopts", | |
| 1287 | 1050 | "memchr", |
| 1288 | "pulldown-cmark-escape 0.11.0", | |
| 1051 | "pulldown-cmark-escape", | |
| 1289 | 1052 | "unicase", |
| 1290 | 1053 | ] |
| 1291 | 1054 | |
| 1292 | [[package]] | |
| 1293 | name = "pulldown-cmark-escape" | |
| 1294 | version = "0.10.1" | |
| 1295 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1296 | checksum = "bd348ff538bc9caeda7ee8cad2d1d48236a1f443c1fa3913c6a02fe0043b1dd3" | |
| 1297 | ||
| 1298 | 1055 | [[package]] |
| 1299 | 1056 | name = "pulldown-cmark-escape" |
| 1300 | 1057 | version = "0.11.0" |
| ... | ... | @@ -1312,11 +1069,11 @@ dependencies = [ |
| 1312 | 1069 | |
| 1313 | 1070 | [[package]] |
| 1314 | 1071 | name = "pulldown-cmark-to-cmark" |
| 1315 | version = "20.0.1" | |
| 1072 | version = "21.1.0" | |
| 1316 | 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1317 | checksum = "6c0f333311d2d8fda65bcf76af35054e9f38e253332a0289746156a59656988b" | |
| 1074 | checksum = "8246feae3db61428fd0bb94285c690b460e4517d83152377543ca802357785f1" | |
| 1318 | 1075 | dependencies = [ |
| 1319 | "pulldown-cmark 0.12.2", | |
| 1076 | "pulldown-cmark 0.13.0", | |
| 1320 | 1077 | ] |
| 1321 | 1078 | |
| 1322 | 1079 | [[package]] |
| ... | ... | @@ -1343,21 +1100,6 @@ dependencies = [ |
| 1343 | 1100 | "unicode-width", |
| 1344 | 1101 | ] |
| 1345 | 1102 | |
| 1346 | [[package]] | |
| 1347 | name = "rand" | |
| 1348 | version = "0.8.5" | |
| 1349 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1350 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" | |
| 1351 | dependencies = [ | |
| 1352 | "rand_core", | |
| 1353 | ] | |
| 1354 | ||
| 1355 | [[package]] | |
| 1356 | name = "rand_core" | |
| 1357 | version = "0.6.4" | |
| 1358 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1359 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" | |
| 1360 | ||
| 1361 | 1103 | [[package]] |
| 1362 | 1104 | name = "redox_syscall" |
| 1363 | 1105 | version = "0.5.18" |
| ... | ... | @@ -1401,12 +1143,11 @@ name = "rustbook" |
| 1401 | 1143 | version = "0.1.0" |
| 1402 | 1144 | dependencies = [ |
| 1403 | 1145 | "clap", |
| 1404 | "env_logger", | |
| 1405 | "libc", | |
| 1406 | "mdbook", | |
| 1146 | "mdbook-driver", | |
| 1407 | 1147 | "mdbook-i18n-helpers", |
| 1408 | 1148 | "mdbook-spec", |
| 1409 | 1149 | "mdbook-trpl", |
| 1150 | "tracing-subscriber", | |
| 1410 | 1151 | ] |
| 1411 | 1152 | |
| 1412 | 1153 | [[package]] |
| ... | ... | @@ -1507,6 +1248,15 @@ dependencies = [ |
| 1507 | 1248 | "serde", |
| 1508 | 1249 | ] |
| 1509 | 1250 | |
| 1251 | [[package]] | |
| 1252 | name = "serde_spanned" | |
| 1253 | version = "1.0.3" | |
| 1254 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1255 | checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392" | |
| 1256 | dependencies = [ | |
| 1257 | "serde_core", | |
| 1258 | ] | |
| 1259 | ||
| 1510 | 1260 | [[package]] |
| 1511 | 1261 | name = "sha2" |
| 1512 | 1262 | version = "0.10.9" |
| ... | ... | @@ -1518,6 +1268,15 @@ dependencies = [ |
| 1518 | 1268 | "digest", |
| 1519 | 1269 | ] |
| 1520 | 1270 | |
| 1271 | [[package]] | |
| 1272 | name = "sharded-slab" | |
| 1273 | version = "0.1.7" | |
| 1274 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1275 | checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" | |
| 1276 | dependencies = [ | |
| 1277 | "lazy_static", | |
| 1278 | ] | |
| 1279 | ||
| 1521 | 1280 | [[package]] |
| 1522 | 1281 | name = "shlex" |
| 1523 | 1282 | version = "1.3.0" |
| ... | ... | @@ -1542,12 +1301,6 @@ version = "1.15.1" |
| 1542 | 1301 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1543 | 1302 | checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" |
| 1544 | 1303 | |
| 1545 | [[package]] | |
| 1546 | name = "stable_deref_trait" | |
| 1547 | version = "1.2.1" | |
| 1548 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1549 | checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" | |
| 1550 | ||
| 1551 | 1304 | [[package]] |
| 1552 | 1305 | name = "string_cache" |
| 1553 | 1306 | version = "0.9.0" |
| ... | ... | @@ -1556,7 +1309,7 @@ checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" |
| 1556 | 1309 | dependencies = [ |
| 1557 | 1310 | "new_debug_unreachable", |
| 1558 | 1311 | "parking_lot", |
| 1559 | "phf_shared 0.13.1", | |
| 1312 | "phf_shared", | |
| 1560 | 1313 | "precomputed-hash", |
| 1561 | 1314 | "serde", |
| 1562 | 1315 | ] |
| ... | ... | @@ -1567,8 +1320,8 @@ version = "0.6.1" |
| 1567 | 1320 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1568 | 1321 | checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" |
| 1569 | 1322 | dependencies = [ |
| 1570 | "phf_generator 0.13.1", | |
| 1571 | "phf_shared 0.13.1", | |
| 1323 | "phf_generator", | |
| 1324 | "phf_shared", | |
| 1572 | 1325 | "proc-macro2", |
| 1573 | 1326 | "quote", |
| 1574 | 1327 | ] |
| ... | ... | @@ -1590,17 +1343,6 @@ dependencies = [ |
| 1590 | 1343 | "unicode-ident", |
| 1591 | 1344 | ] |
| 1592 | 1345 | |
| 1593 | [[package]] | |
| 1594 | name = "synstructure" | |
| 1595 | version = "0.13.2" | |
| 1596 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1597 | checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" | |
| 1598 | dependencies = [ | |
| 1599 | "proc-macro2", | |
| 1600 | "quote", | |
| 1601 | "syn", | |
| 1602 | ] | |
| 1603 | ||
| 1604 | 1346 | [[package]] |
| 1605 | 1347 | name = "syntect" |
| 1606 | 1348 | version = "5.3.0" |
| ... | ... | @@ -1608,10 +1350,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1608 | 1350 | checksum = "656b45c05d95a5704399aeef6bd0ddec7b2b3531b7c9e900abbf7c4d2190c925" |
| 1609 | 1351 | dependencies = [ |
| 1610 | 1352 | "bincode", |
| 1353 | "fancy-regex", | |
| 1611 | 1354 | "flate2", |
| 1612 | 1355 | "fnv", |
| 1613 | 1356 | "once_cell", |
| 1614 | "onig", | |
| 1615 | 1357 | "regex-syntax", |
| 1616 | 1358 | "serde", |
| 1617 | 1359 | "serde_derive", |
| ... | ... | @@ -1643,16 +1385,6 @@ dependencies = [ |
| 1643 | 1385 | "utf-8", |
| 1644 | 1386 | ] |
| 1645 | 1387 | |
| 1646 | [[package]] | |
| 1647 | name = "terminal_size" | |
| 1648 | version = "0.4.3" | |
| 1649 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1650 | checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" | |
| 1651 | dependencies = [ | |
| 1652 | "rustix", | |
| 1653 | "windows-sys 0.60.2", | |
| 1654 | ] | |
| 1655 | ||
| 1656 | 1388 | [[package]] |
| 1657 | 1389 | name = "textwrap" |
| 1658 | 1390 | version = "0.16.2" |
| ... | ... | @@ -1700,34 +1432,39 @@ dependencies = [ |
| 1700 | 1432 | ] |
| 1701 | 1433 | |
| 1702 | 1434 | [[package]] |
| 1703 | name = "tinystr" | |
| 1704 | version = "0.8.2" | |
| 1435 | name = "thread_local" | |
| 1436 | version = "1.1.9" | |
| 1705 | 1437 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1706 | checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" | |
| 1438 | checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" | |
| 1707 | 1439 | dependencies = [ |
| 1708 | "displaydoc", | |
| 1709 | "zerovec", | |
| 1440 | "cfg-if", | |
| 1710 | 1441 | ] |
| 1711 | 1442 | |
| 1712 | 1443 | [[package]] |
| 1713 | 1444 | name = "toml" |
| 1714 | version = "0.5.11" | |
| 1445 | version = "0.8.23" | |
| 1715 | 1446 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1716 | checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" | |
| 1447 | checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" | |
| 1717 | 1448 | dependencies = [ |
| 1718 | 1449 | "serde", |
| 1450 | "serde_spanned 0.6.9", | |
| 1451 | "toml_datetime 0.6.11", | |
| 1452 | "toml_edit", | |
| 1719 | 1453 | ] |
| 1720 | 1454 | |
| 1721 | 1455 | [[package]] |
| 1722 | 1456 | name = "toml" |
| 1723 | version = "0.8.23" | |
| 1457 | version = "0.9.8" | |
| 1724 | 1458 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1725 | checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" | |
| 1459 | checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" | |
| 1726 | 1460 | dependencies = [ |
| 1727 | "serde", | |
| 1728 | "serde_spanned", | |
| 1729 | "toml_datetime", | |
| 1730 | "toml_edit", | |
| 1461 | "indexmap", | |
| 1462 | "serde_core", | |
| 1463 | "serde_spanned 1.0.3", | |
| 1464 | "toml_datetime 0.7.3", | |
| 1465 | "toml_parser", | |
| 1466 | "toml_writer", | |
| 1467 | "winnow", | |
| 1731 | 1468 | ] |
| 1732 | 1469 | |
| 1733 | 1470 | [[package]] |
| ... | ... | @@ -1739,6 +1476,15 @@ dependencies = [ |
| 1739 | 1476 | "serde", |
| 1740 | 1477 | ] |
| 1741 | 1478 | |
| 1479 | [[package]] | |
| 1480 | name = "toml_datetime" | |
| 1481 | version = "0.7.3" | |
| 1482 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1483 | checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" | |
| 1484 | dependencies = [ | |
| 1485 | "serde_core", | |
| 1486 | ] | |
| 1487 | ||
| 1742 | 1488 | [[package]] |
| 1743 | 1489 | name = "toml_edit" |
| 1744 | 1490 | version = "0.22.27" |
| ... | ... | @@ -1747,24 +1493,100 @@ checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" |
| 1747 | 1493 | dependencies = [ |
| 1748 | 1494 | "indexmap", |
| 1749 | 1495 | "serde", |
| 1750 | "serde_spanned", | |
| 1751 | "toml_datetime", | |
| 1496 | "serde_spanned 0.6.9", | |
| 1497 | "toml_datetime 0.6.11", | |
| 1752 | 1498 | "toml_write", |
| 1753 | 1499 | "winnow", |
| 1754 | 1500 | ] |
| 1755 | 1501 | |
| 1502 | [[package]] | |
| 1503 | name = "toml_parser" | |
| 1504 | version = "1.0.4" | |
| 1505 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1506 | checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" | |
| 1507 | dependencies = [ | |
| 1508 | "winnow", | |
| 1509 | ] | |
| 1510 | ||
| 1756 | 1511 | [[package]] |
| 1757 | 1512 | name = "toml_write" |
| 1758 | 1513 | version = "0.1.2" |
| 1759 | 1514 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1760 | 1515 | checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" |
| 1761 | 1516 | |
| 1517 | [[package]] | |
| 1518 | name = "toml_writer" | |
| 1519 | version = "1.0.4" | |
| 1520 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1521 | checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" | |
| 1522 | ||
| 1762 | 1523 | [[package]] |
| 1763 | 1524 | name = "topological-sort" |
| 1764 | 1525 | version = "0.2.2" |
| 1765 | 1526 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1766 | 1527 | checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" |
| 1767 | 1528 | |
| 1529 | [[package]] | |
| 1530 | name = "tracing" | |
| 1531 | version = "0.1.43" | |
| 1532 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1533 | checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" | |
| 1534 | dependencies = [ | |
| 1535 | "pin-project-lite", | |
| 1536 | "tracing-attributes", | |
| 1537 | "tracing-core", | |
| 1538 | ] | |
| 1539 | ||
| 1540 | [[package]] | |
| 1541 | name = "tracing-attributes" | |
| 1542 | version = "0.1.31" | |
| 1543 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1544 | checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" | |
| 1545 | dependencies = [ | |
| 1546 | "proc-macro2", | |
| 1547 | "quote", | |
| 1548 | "syn", | |
| 1549 | ] | |
| 1550 | ||
| 1551 | [[package]] | |
| 1552 | name = "tracing-core" | |
| 1553 | version = "0.1.35" | |
| 1554 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1555 | checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" | |
| 1556 | dependencies = [ | |
| 1557 | "once_cell", | |
| 1558 | "valuable", | |
| 1559 | ] | |
| 1560 | ||
| 1561 | [[package]] | |
| 1562 | name = "tracing-log" | |
| 1563 | version = "0.2.0" | |
| 1564 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1565 | checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" | |
| 1566 | dependencies = [ | |
| 1567 | "log", | |
| 1568 | "once_cell", | |
| 1569 | "tracing-core", | |
| 1570 | ] | |
| 1571 | ||
| 1572 | [[package]] | |
| 1573 | name = "tracing-subscriber" | |
| 1574 | version = "0.3.22" | |
| 1575 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1576 | checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" | |
| 1577 | dependencies = [ | |
| 1578 | "matchers", | |
| 1579 | "nu-ansi-term", | |
| 1580 | "once_cell", | |
| 1581 | "regex-automata", | |
| 1582 | "sharded-slab", | |
| 1583 | "smallvec", | |
| 1584 | "thread_local", | |
| 1585 | "tracing", | |
| 1586 | "tracing-core", | |
| 1587 | "tracing-log", | |
| 1588 | ] | |
| 1589 | ||
| 1768 | 1590 | [[package]] |
| 1769 | 1591 | name = "typenum" |
| 1770 | 1592 | version = "1.19.0" |
| ... | ... | @@ -1795,36 +1617,24 @@ version = "0.2.2" |
| 1795 | 1617 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1796 | 1618 | checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" |
| 1797 | 1619 | |
| 1798 | [[package]] | |
| 1799 | name = "url" | |
| 1800 | version = "2.5.7" | |
| 1801 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1802 | checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" | |
| 1803 | dependencies = [ | |
| 1804 | "form_urlencoded", | |
| 1805 | "idna", | |
| 1806 | "percent-encoding", | |
| 1807 | "serde", | |
| 1808 | ] | |
| 1809 | ||
| 1810 | 1620 | [[package]] |
| 1811 | 1621 | name = "utf-8" |
| 1812 | 1622 | version = "0.7.6" |
| 1813 | 1623 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1814 | 1624 | checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" |
| 1815 | 1625 | |
| 1816 | [[package]] | |
| 1817 | name = "utf8_iter" | |
| 1818 | version = "1.0.4" | |
| 1819 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1820 | checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" | |
| 1821 | ||
| 1822 | 1626 | [[package]] |
| 1823 | 1627 | name = "utf8parse" |
| 1824 | 1628 | version = "0.2.2" |
| 1825 | 1629 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1826 | 1630 | checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" |
| 1827 | 1631 | |
| 1632 | [[package]] | |
| 1633 | name = "valuable" | |
| 1634 | version = "0.1.1" | |
| 1635 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1636 | checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" | |
| 1637 | ||
| 1828 | 1638 | [[package]] |
| 1829 | 1639 | name = "version_check" |
| 1830 | 1640 | version = "0.9.5" |
| ... | ... | @@ -1897,11 +1707,11 @@ dependencies = [ |
| 1897 | 1707 | |
| 1898 | 1708 | [[package]] |
| 1899 | 1709 | name = "web_atoms" |
| 1900 | version = "0.1.4" | |
| 1710 | version = "0.2.0" | |
| 1901 | 1711 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1902 | checksum = "44b72896d90cfd22c495d0ee4960d3dd20ca64180895cb92cd5342ff7482a579" | |
| 1712 | checksum = "acd0c322f146d0f8aad130ce6c187953889359584497dac6561204c8e17bb43d" | |
| 1903 | 1713 | dependencies = [ |
| 1904 | "phf 0.13.1", | |
| 1714 | "phf", | |
| 1905 | 1715 | "phf_codegen", |
| 1906 | 1716 | "string_cache", |
| 1907 | 1717 | "string_cache_codegen", |
| ... | ... | @@ -2072,86 +1882,3 @@ name = "wit-bindgen" |
| 2072 | 1882 | version = "0.46.0" |
| 2073 | 1883 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 2074 | 1884 | checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" |
| 2075 | ||
| 2076 | [[package]] | |
| 2077 | name = "writeable" | |
| 2078 | version = "0.6.2" | |
| 2079 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2080 | checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" | |
| 2081 | ||
| 2082 | [[package]] | |
| 2083 | name = "yoke" | |
| 2084 | version = "0.8.1" | |
| 2085 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2086 | checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" | |
| 2087 | dependencies = [ | |
| 2088 | "stable_deref_trait", | |
| 2089 | "yoke-derive", | |
| 2090 | "zerofrom", | |
| 2091 | ] | |
| 2092 | ||
| 2093 | [[package]] | |
| 2094 | name = "yoke-derive" | |
| 2095 | version = "0.8.1" | |
| 2096 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2097 | checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" | |
| 2098 | dependencies = [ | |
| 2099 | "proc-macro2", | |
| 2100 | "quote", | |
| 2101 | "syn", | |
| 2102 | "synstructure", | |
| 2103 | ] | |
| 2104 | ||
| 2105 | [[package]] | |
| 2106 | name = "zerofrom" | |
| 2107 | version = "0.1.6" | |
| 2108 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2109 | checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" | |
| 2110 | dependencies = [ | |
| 2111 | "zerofrom-derive", | |
| 2112 | ] | |
| 2113 | ||
| 2114 | [[package]] | |
| 2115 | name = "zerofrom-derive" | |
| 2116 | version = "0.1.6" | |
| 2117 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2118 | checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" | |
| 2119 | dependencies = [ | |
| 2120 | "proc-macro2", | |
| 2121 | "quote", | |
| 2122 | "syn", | |
| 2123 | "synstructure", | |
| 2124 | ] | |
| 2125 | ||
| 2126 | [[package]] | |
| 2127 | name = "zerotrie" | |
| 2128 | version = "0.2.3" | |
| 2129 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2130 | checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" | |
| 2131 | dependencies = [ | |
| 2132 | "displaydoc", | |
| 2133 | "yoke", | |
| 2134 | "zerofrom", | |
| 2135 | ] | |
| 2136 | ||
| 2137 | [[package]] | |
| 2138 | name = "zerovec" | |
| 2139 | version = "0.11.5" | |
| 2140 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2141 | checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" | |
| 2142 | dependencies = [ | |
| 2143 | "yoke", | |
| 2144 | "zerofrom", | |
| 2145 | "zerovec-derive", | |
| 2146 | ] | |
| 2147 | ||
| 2148 | [[package]] | |
| 2149 | name = "zerovec-derive" | |
| 2150 | version = "0.11.2" | |
| 2151 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2152 | checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" | |
| 2153 | dependencies = [ | |
| 2154 | "proc-macro2", | |
| 2155 | "quote", | |
| 2156 | "syn", | |
| 2157 | ] |
src/tools/rustbook/Cargo.toml+5-10| ... | ... | @@ -8,14 +8,9 @@ license = "MIT OR Apache-2.0" |
| 8 | 8 | edition = "2021" |
| 9 | 9 | |
| 10 | 10 | [dependencies] |
| 11 | clap = "4.0.32" | |
| 12 | env_logger = "0.11" | |
| 13 | libc = "0.2" | |
| 14 | mdbook-trpl = { path = "../../doc/book/packages/mdbook-trpl" } | |
| 15 | mdbook-i18n-helpers = "0.3.3" | |
| 11 | clap = { version = "4.0.32", features = ["cargo"] } | |
| 12 | mdbook-driver = { version = "0.5.2", features = ["search"] } | |
| 13 | mdbook-i18n-helpers = "0.4.0" | |
| 16 | 14 | mdbook-spec = { path = "../../doc/reference/mdbook-spec" } |
| 17 | ||
| 18 | [dependencies.mdbook] | |
| 19 | version = "0.4.52" | |
| 20 | default-features = false | |
| 21 | features = ["search"] | |
| 15 | mdbook-trpl = { path = "../../doc/book/packages/mdbook-trpl" } | |
| 16 | tracing-subscriber = { version = "0.3.20", features = ["env-filter"] } |
src/tools/rustbook/src/main.rs+58-42| ... | ... | @@ -2,15 +2,27 @@ use std::env; |
| 2 | 2 | use std::path::{Path, PathBuf}; |
| 3 | 3 | |
| 4 | 4 | use clap::{ArgMatches, Command, arg, crate_version}; |
| 5 | use mdbook::MDBook; | |
| 6 | use mdbook::errors::Result as Result3; | |
| 5 | use mdbook_driver::MDBook; | |
| 6 | use mdbook_driver::errors::Result as Result3; | |
| 7 | 7 | use mdbook_i18n_helpers::preprocessors::Gettext; |
| 8 | 8 | use mdbook_spec::Spec; |
| 9 | 9 | use mdbook_trpl::{Figure, Listing, Note}; |
| 10 | 10 | |
| 11 | 11 | fn main() { |
| 12 | 12 | let crate_version = concat!("v", crate_version!()); |
| 13 | env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init(); | |
| 13 | let filter = tracing_subscriber::EnvFilter::builder() | |
| 14 | .with_env_var("MDBOOK_LOG") | |
| 15 | .with_default_directive(tracing_subscriber::filter::LevelFilter::INFO.into()) | |
| 16 | .from_env_lossy(); | |
| 17 | tracing_subscriber::fmt() | |
| 18 | .without_time() | |
| 19 | .with_ansi(std::io::IsTerminal::is_terminal(&std::io::stderr())) | |
| 20 | .with_writer(std::io::stderr) | |
| 21 | .with_env_filter(filter) | |
| 22 | .with_target(std::env::var_os("MDBOOK_LOG").is_some()) | |
| 23 | .init(); | |
| 24 | ||
| 25 | // env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init(); | |
| 14 | 26 | let d_arg = arg!(-d --"dest-dir" <DEST_DIR> |
| 15 | 27 | "The output directory for your book\n(Defaults to ./book when omitted)") |
| 16 | 28 | .required(false) |
| ... | ... | @@ -82,12 +94,45 @@ fn main() { |
| 82 | 94 | }; |
| 83 | 95 | } |
| 84 | 96 | |
| 85 | // Build command implementation | |
| 86 | pub fn build(args: &ArgMatches) -> Result3<()> { | |
| 97 | fn build(args: &ArgMatches) -> Result3<()> { | |
| 87 | 98 | let book_dir = get_book_dir(args); |
| 88 | let mut book = load_book(&book_dir)?; | |
| 99 | let dest_dir = args.get_one::<PathBuf>("dest-dir"); | |
| 100 | let lang = args.get_one::<String>("lang"); | |
| 101 | let rust_root = args.get_one::<PathBuf>("rust-root"); | |
| 102 | let book = load_book(&book_dir, dest_dir, lang, rust_root.cloned())?; | |
| 103 | book.build() | |
| 104 | } | |
| 105 | ||
| 106 | fn test(args: &ArgMatches) -> Result3<()> { | |
| 107 | let book_dir = get_book_dir(args); | |
| 108 | let mut book = load_book(&book_dir, None, None, None)?; | |
| 109 | let library_paths = args | |
| 110 | .try_get_one::<Vec<String>>("library-path")? | |
| 111 | .map(|v| v.iter().map(|s| s.as_str()).collect::<Vec<&str>>()) | |
| 112 | .unwrap_or_default(); | |
| 113 | book.test(library_paths) | |
| 114 | } | |
| 115 | ||
| 116 | fn get_book_dir(args: &ArgMatches) -> PathBuf { | |
| 117 | if let Some(p) = args.get_one::<PathBuf>("dir") { | |
| 118 | // Check if path is relative from current dir, or absolute... | |
| 119 | if p.is_relative() { env::current_dir().unwrap().join(p) } else { p.to_path_buf() } | |
| 120 | } else { | |
| 121 | env::current_dir().unwrap() | |
| 122 | } | |
| 123 | } | |
| 124 | ||
| 125 | fn load_book( | |
| 126 | book_dir: &Path, | |
| 127 | dest_dir: Option<&PathBuf>, | |
| 128 | lang: Option<&String>, | |
| 129 | rust_root: Option<PathBuf>, | |
| 130 | ) -> Result3<MDBook> { | |
| 131 | let mut book = MDBook::load(book_dir)?; | |
| 132 | book.config.set("output.html.input-404", "").unwrap(); | |
| 133 | book.config.set("output.html.hash-files", true).unwrap(); | |
| 89 | 134 | |
| 90 | if let Some(lang) = args.get_one::<String>("lang") { | |
| 135 | if let Some(lang) = lang { | |
| 91 | 136 | let gettext = Gettext; |
| 92 | 137 | book.with_preprocessor(gettext); |
| 93 | 138 | book.config.set("book.language", lang).unwrap(); |
| ... | ... | @@ -96,7 +141,7 @@ pub fn build(args: &ArgMatches) -> Result3<()> { |
| 96 | 141 | // Set this to allow us to catch bugs in advance. |
| 97 | 142 | book.config.build.create_missing = false; |
| 98 | 143 | |
| 99 | if let Some(dest_dir) = args.get_one::<PathBuf>("dest-dir") { | |
| 144 | if let Some(dest_dir) = dest_dir { | |
| 100 | 145 | book.config.build.build_dir = dest_dir.into(); |
| 101 | 146 | } |
| 102 | 147 | |
| ... | ... | @@ -107,51 +152,22 @@ pub fn build(args: &ArgMatches) -> Result3<()> { |
| 107 | 152 | // This should probably be fixed in mdbook to remove the existing |
| 108 | 153 | // preprocessor, or this should modify the config and use |
| 109 | 154 | // MDBook::load_with_config. |
| 110 | if book.config.get_preprocessor("trpl-note").is_some() { | |
| 155 | if book.config.contains_key("preprocessor.trpl-note") { | |
| 111 | 156 | book.with_preprocessor(Note); |
| 112 | 157 | } |
| 113 | 158 | |
| 114 | if book.config.get_preprocessor("trpl-listing").is_some() { | |
| 159 | if book.config.contains_key("preprocessor.trpl-listing") { | |
| 115 | 160 | book.with_preprocessor(Listing); |
| 116 | 161 | } |
| 117 | 162 | |
| 118 | if book.config.get_preprocessor("trpl-figure").is_some() { | |
| 163 | if book.config.contains_key("preprocessor.trpl-figure") { | |
| 119 | 164 | book.with_preprocessor(Figure); |
| 120 | 165 | } |
| 121 | 166 | |
| 122 | if book.config.get_preprocessor("spec").is_some() { | |
| 123 | let rust_root = args.get_one::<PathBuf>("rust-root").cloned(); | |
| 167 | if book.config.contains_key("preprocessor.spec") { | |
| 124 | 168 | book.with_preprocessor(Spec::new(rust_root)?); |
| 125 | 169 | } |
| 126 | 170 | |
| 127 | book.build()?; | |
| 128 | ||
| 129 | Ok(()) | |
| 130 | } | |
| 131 | ||
| 132 | fn test(args: &ArgMatches) -> Result3<()> { | |
| 133 | let book_dir = get_book_dir(args); | |
| 134 | let library_paths = args | |
| 135 | .try_get_one::<Vec<String>>("library-path")? | |
| 136 | .map(|v| v.iter().map(|s| s.as_str()).collect::<Vec<&str>>()) | |
| 137 | .unwrap_or_default(); | |
| 138 | let mut book = load_book(&book_dir)?; | |
| 139 | book.test(library_paths) | |
| 140 | } | |
| 141 | ||
| 142 | fn get_book_dir(args: &ArgMatches) -> PathBuf { | |
| 143 | if let Some(p) = args.get_one::<PathBuf>("dir") { | |
| 144 | // Check if path is relative from current dir, or absolute... | |
| 145 | if p.is_relative() { env::current_dir().unwrap().join(p) } else { p.to_path_buf() } | |
| 146 | } else { | |
| 147 | env::current_dir().unwrap() | |
| 148 | } | |
| 149 | } | |
| 150 | ||
| 151 | fn load_book(book_dir: &Path) -> Result3<MDBook> { | |
| 152 | let mut book = MDBook::load(book_dir)?; | |
| 153 | book.config.set("output.html.input-404", "").unwrap(); | |
| 154 | book.config.set("output.html.hash-files", true).unwrap(); | |
| 155 | 171 | Ok(book) |
| 156 | 172 | } |
| 157 | 173 | |
| ... | ... | @@ -159,7 +175,7 @@ fn parse_library_paths(input: &str) -> Result<Vec<String>, String> { |
| 159 | 175 | Ok(input.split(",").map(String::from).collect()) |
| 160 | 176 | } |
| 161 | 177 | |
| 162 | fn handle_error(error: mdbook::errors::Error) -> ! { | |
| 178 | fn handle_error(error: mdbook_driver::errors::Error) -> ! { | |
| 163 | 179 | eprintln!("Error: {}", error); |
| 164 | 180 | |
| 165 | 181 | for cause in error.chain().skip(1) { |
src/tools/tidy/src/deps.rs+37-17| ... | ... | @@ -1,6 +1,7 @@ |
| 1 | 1 | //! Checks the licenses of third-party dependencies. |
| 2 | 2 | |
| 3 | 3 | use std::collections::{HashMap, HashSet}; |
| 4 | use std::fmt::{Display, Formatter}; | |
| 4 | 5 | use std::fs::{File, read_dir}; |
| 5 | 6 | use std::io::Write; |
| 6 | 7 | use std::path::Path; |
| ... | ... | @@ -14,6 +15,25 @@ use crate::diagnostics::{RunningCheck, TidyCtx}; |
| 14 | 15 | #[path = "../../../bootstrap/src/utils/proc_macro_deps.rs"] |
| 15 | 16 | mod proc_macro_deps; |
| 16 | 17 | |
| 18 | #[derive(Clone, Copy)] | |
| 19 | struct ListLocation { | |
| 20 | path: &'static str, | |
| 21 | line: u32, | |
| 22 | } | |
| 23 | ||
| 24 | impl Display for ListLocation { | |
| 25 | fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { | |
| 26 | write!(f, "{}:{}", self.path, self.line) | |
| 27 | } | |
| 28 | } | |
| 29 | ||
| 30 | /// Creates a [`ListLocation`] for the current location (with an additional offset to the actual list start); | |
| 31 | macro_rules! location { | |
| 32 | (+ $offset:literal) => { | |
| 33 | ListLocation { path: file!(), line: line!() + $offset } | |
| 34 | }; | |
| 35 | } | |
| 36 | ||
| 17 | 37 | /// These are licenses that are allowed for all crates, including the runtime, |
| 18 | 38 | /// rustc, tools, etc. |
| 19 | 39 | #[rustfmt::skip] |
| ... | ... | @@ -87,6 +107,8 @@ pub(crate) struct WorkspaceInfo<'a> { |
| 87 | 107 | pub(crate) submodules: &'a [&'a str], |
| 88 | 108 | } |
| 89 | 109 | |
| 110 | const WORKSPACE_LOCATION: ListLocation = location!(+4); | |
| 111 | ||
| 90 | 112 | /// The workspaces to check for licensing and optionally permitted dependencies. |
| 91 | 113 | // FIXME auto detect all cargo workspaces |
| 92 | 114 | pub(crate) const WORKSPACES: &[WorkspaceInfo<'static>] = &[ |
| ... | ... | @@ -222,10 +244,14 @@ const EXCEPTIONS_RUSTC_PERF: ExceptionList = &[ |
| 222 | 244 | |
| 223 | 245 | const EXCEPTIONS_RUSTBOOK: ExceptionList = &[ |
| 224 | 246 | // tidy-alphabetical-start |
| 225 | ("cssparser", "MPL-2.0"), | |
| 226 | ("cssparser-macros", "MPL-2.0"), | |
| 227 | ("dtoa-short", "MPL-2.0"), | |
| 228 | ("mdbook", "MPL-2.0"), | |
| 247 | ("font-awesome-as-a-crate", "CC-BY-4.0 AND MIT"), | |
| 248 | ("mdbook-core", "MPL-2.0"), | |
| 249 | ("mdbook-driver", "MPL-2.0"), | |
| 250 | ("mdbook-html", "MPL-2.0"), | |
| 251 | ("mdbook-markdown", "MPL-2.0"), | |
| 252 | ("mdbook-preprocessor", "MPL-2.0"), | |
| 253 | ("mdbook-renderer", "MPL-2.0"), | |
| 254 | ("mdbook-summary", "MPL-2.0"), | |
| 229 | 255 | // tidy-alphabetical-end |
| 230 | 256 | ]; |
| 231 | 257 | |
| ... | ... | @@ -242,19 +268,6 @@ const EXCEPTIONS_BOOTSTRAP: ExceptionList = &[]; |
| 242 | 268 | |
| 243 | 269 | const EXCEPTIONS_UEFI_QEMU_TEST: ExceptionList = &[]; |
| 244 | 270 | |
| 245 | #[derive(Clone, Copy)] | |
| 246 | struct ListLocation { | |
| 247 | path: &'static str, | |
| 248 | line: u32, | |
| 249 | } | |
| 250 | ||
| 251 | /// Creates a [`ListLocation`] for the current location (with an additional offset to the actual list start); | |
| 252 | macro_rules! location { | |
| 253 | (+ $offset:literal) => { | |
| 254 | ListLocation { path: file!(), line: line!() + $offset } | |
| 255 | }; | |
| 256 | } | |
| 257 | ||
| 258 | 271 | const PERMITTED_RUSTC_DEPS_LOCATION: ListLocation = location!(+6); |
| 259 | 272 | |
| 260 | 273 | /// Crates rustc is allowed to depend on. Avoid adding to the list if possible. |
| ... | ... | @@ -641,6 +654,13 @@ pub fn check(root: &Path, cargo: &Path, tidy_ctx: TidyCtx) { |
| 641 | 654 | .other_options(vec!["--locked".to_owned()]); |
| 642 | 655 | let metadata = t!(cmd.exec()); |
| 643 | 656 | |
| 657 | // Check for packages which have been moved into a different workspace and not updated | |
| 658 | let absolute_root = | |
| 659 | if path == "." { root.to_path_buf() } else { t!(std::path::absolute(root.join(path))) }; | |
| 660 | let absolute_root_real = t!(std::path::absolute(&metadata.workspace_root)); | |
| 661 | if absolute_root_real != absolute_root { | |
| 662 | check.error(format!("{path} is part of another workspace ({} != {}), remove from `WORKSPACES` ({WORKSPACE_LOCATION})", absolute_root.display(), absolute_root_real.display())); | |
| 663 | } | |
| 644 | 664 | check_license_exceptions(&metadata, path, exceptions, &mut check); |
| 645 | 665 | if let Some((crates, permitted_deps, location)) = crates_and_deps { |
| 646 | 666 | let descr = crates.get(0).unwrap_or(&path); |
tests/codegen-llvm/cffi/c-variadic-va_list.rs+3-3| ... | ... | @@ -22,15 +22,15 @@ pub unsafe extern "C" fn use_foreign_c_variadic_1_0(ap: VaList) { |
| 22 | 22 | |
| 23 | 23 | // CHECK-LABEL: use_foreign_c_variadic_1_1 |
| 24 | 24 | pub unsafe extern "C" fn use_foreign_c_variadic_1_1(ap: VaList) { |
| 25 | // CHECK: call void ({{.*}}, ...) @foreign_c_variadic_1({{.*}} %ap, i32 noundef 42) | |
| 25 | // CHECK: call void ({{.*}}, ...) @foreign_c_variadic_1({{.*}} %ap, i32 noundef{{( signext)?}} 42) | |
| 26 | 26 | foreign_c_variadic_1(ap, 42i32); |
| 27 | 27 | } |
| 28 | 28 | pub unsafe extern "C" fn use_foreign_c_variadic_1_2(ap: VaList) { |
| 29 | // CHECK: call void ({{.*}}, ...) @foreign_c_variadic_1({{.*}} %ap, i32 noundef 2, i32 noundef 42) | |
| 29 | // CHECK: call void ({{.*}}, ...) @foreign_c_variadic_1({{.*}} %ap, i32 noundef{{( signext)?}} 2, i32 noundef{{( signext)?}} 42) | |
| 30 | 30 | foreign_c_variadic_1(ap, 2i32, 42i32); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | pub unsafe extern "C" fn use_foreign_c_variadic_1_3(ap: VaList) { |
| 34 | // CHECK: call void ({{.*}}, ...) @foreign_c_variadic_1({{.*}} %ap, i32 noundef 2, i32 noundef 42, i32 noundef 0) | |
| 34 | // CHECK: call void ({{.*}}, ...) @foreign_c_variadic_1({{.*}} %ap, i32 noundef{{( signext)?}} 2, i32 noundef{{( signext)?}} 42, i32 noundef{{( signext)?}} 0) | |
| 35 | 35 | foreign_c_variadic_1(ap, 2i32, 42i32, 0i32); |
| 36 | 36 | } |
triagebot.toml+11| ... | ... | @@ -96,6 +96,17 @@ Thanks! <3 |
| 96 | 96 | """ |
| 97 | 97 | label = "O-ARM" |
| 98 | 98 | |
| 99 | [ping.loongarch] | |
| 100 | message = """\ | |
| 101 | Hey LoongArch Group! This bug has been identified as a good "LoongArch candidate". | |
| 102 | In case it's useful, here are some [instructions] for tackling these sorts of | |
| 103 | bugs. Maybe take a look? | |
| 104 | Thanks! <3 | |
| 105 | ||
| 106 | [instructions]: https://rustc-dev-guide.rust-lang.org/notification-groups/loongarch.html | |
| 107 | """ | |
| 108 | label = "O-loongarch" | |
| 109 | ||
| 99 | 110 | [ping.risc-v] |
| 100 | 111 | message = """\ |
| 101 | 112 | Hey RISC-V Group! This bug has been identified as a good "RISC-V candidate". |