commit
951bcc78f6
@ -0,0 +1,106 @@
|
|||||||
|
From 7c78a4f62814c261bc81eadf3600523bf35579c3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Fabio Valentini <decathorpe@gmail.com>
|
||||||
|
Date: Thu, 14 Jul 2022 12:24:27 +0200
|
||||||
|
Subject: [PATCH] ignore broken / non-exported macro_rules! macros doctests
|
||||||
|
|
||||||
|
This fixes building doctests with Rust 1.62, which now actually runs
|
||||||
|
doctests for non-exported macros.
|
||||||
|
|
||||||
|
Additionally, doctests that (intentionally or not) create unaligned
|
||||||
|
access to struct fields are also disabled. This was always a problem,
|
||||||
|
but it started being an error with Rust 1.62.
|
||||||
|
---
|
||||||
|
src/lib.rs | 10 +---------
|
||||||
|
src/offset_of.rs | 4 +++-
|
||||||
|
src/span_of.rs | 4 +++-
|
||||||
|
3 files changed, 7 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/lib.rs b/src/lib.rs
|
||||||
|
index c85fb01..5f6816b 100644
|
||||||
|
--- a/src/lib.rs
|
||||||
|
+++ b/src/lib.rs
|
||||||
|
@@ -23,7 +23,7 @@
|
||||||
|
//! This functionality currently can not be used in compile time code such as `const` or `const fn` definitions.
|
||||||
|
//!
|
||||||
|
//! ## Examples
|
||||||
|
-//! ```
|
||||||
|
+//! ```ignore
|
||||||
|
//! #[macro_use]
|
||||||
|
//! extern crate memoffset;
|
||||||
|
//!
|
||||||
|
@@ -69,14 +69,6 @@
|
||||||
|
)]
|
||||||
|
#![cfg_attr(feature = "unstable_raw", feature(raw_ref_macros))]
|
||||||
|
|
||||||
|
-#[macro_use]
|
||||||
|
-#[cfg(doctests)]
|
||||||
|
-#[cfg(doctest)]
|
||||||
|
-extern crate doc_comment;
|
||||||
|
-#[cfg(doctests)]
|
||||||
|
-#[cfg(doctest)]
|
||||||
|
-doctest!("../README.md");
|
||||||
|
-
|
||||||
|
// This `use` statement enables the macros to use `$crate::mem`.
|
||||||
|
// Doing this enables this crate to function under both std and no-std crates.
|
||||||
|
#[doc(hidden)]
|
||||||
|
diff --git a/src/offset_of.rs b/src/offset_of.rs
|
||||||
|
index bb2bce1..ae187e1 100644
|
||||||
|
--- a/src/offset_of.rs
|
||||||
|
+++ b/src/offset_of.rs
|
||||||
|
@@ -69,7 +69,7 @@ macro_rules! _memoffset_offset_from {
|
||||||
|
/// Calculates the offset of the specified field from the start of the struct.
|
||||||
|
///
|
||||||
|
/// ## Examples
|
||||||
|
-/// ```
|
||||||
|
+/// ```ignore
|
||||||
|
/// #[macro_use]
|
||||||
|
/// extern crate memoffset;
|
||||||
|
///
|
||||||
|
@@ -113,6 +113,7 @@ mod tests {
|
||||||
|
assert_eq!(offset_of!(Foo, c), 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
#[test]
|
||||||
|
#[cfg_attr(miri, ignore)] // this creates unaligned references
|
||||||
|
fn offset_simple_packed() {
|
||||||
|
@@ -127,6 +128,7 @@ mod tests {
|
||||||
|
assert_eq!(offset_of!(Foo, b), 4);
|
||||||
|
assert_eq!(offset_of!(Foo, c), 6);
|
||||||
|
}
|
||||||
|
+ */
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn tuple_struct() {
|
||||||
|
diff --git a/src/span_of.rs b/src/span_of.rs
|
||||||
|
index 0592dbd..0646fa8 100644
|
||||||
|
--- a/src/span_of.rs
|
||||||
|
+++ b/src/span_of.rs
|
||||||
|
@@ -58,7 +58,7 @@ macro_rules! _memoffset__compile_error {
|
||||||
|
/// In order to raise the limit, the compiler's recursion limit should be lifted.
|
||||||
|
///
|
||||||
|
/// ## Examples
|
||||||
|
-/// ```
|
||||||
|
+/// ```ignore
|
||||||
|
/// #[macro_use]
|
||||||
|
/// extern crate memoffset;
|
||||||
|
///
|
||||||
|
@@ -171,6 +171,7 @@ mod tests {
|
||||||
|
assert_eq!(span_of!(Foo, c), 8..8 + 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
#[test]
|
||||||
|
#[cfg_attr(miri, ignore)] // this creates unaligned references
|
||||||
|
fn span_simple_packed() {
|
||||||
|
@@ -185,6 +186,7 @@ mod tests {
|
||||||
|
assert_eq!(span_of!(Foo, b), 4..6);
|
||||||
|
assert_eq!(span_of!(Foo, c), 6..6 + 8);
|
||||||
|
}
|
||||||
|
+ */
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn span_forms() {
|
||||||
|
--
|
||||||
|
2.37.1
|
||||||
|
|
Binary file not shown.
@ -0,0 +1,120 @@
|
|||||||
|
# Generated by rust2rpm 13
|
||||||
|
%bcond_without check
|
||||||
|
%global debug_package %{nil}
|
||||||
|
|
||||||
|
%global crate memoffset
|
||||||
|
|
||||||
|
Name: rust-%{crate}0.5
|
||||||
|
Version: 0.5.6
|
||||||
|
Release: 6%{?dist}
|
||||||
|
Summary: Offset_of functionality for Rust structs
|
||||||
|
|
||||||
|
# Upstream license specification: MIT
|
||||||
|
License: MIT
|
||||||
|
URL: https://crates.io/crates/memoffset
|
||||||
|
Source: %{crates_source}
|
||||||
|
|
||||||
|
# * patch to fix doctests with Rust 1.62+
|
||||||
|
Patch1: 0001-ignore-broken-non-exported-macro_rules-macros-doctes.patch
|
||||||
|
|
||||||
|
ExclusiveArch: %{rust_arches}
|
||||||
|
%if %{__cargo_skip_build}
|
||||||
|
BuildArch: noarch
|
||||||
|
%endif
|
||||||
|
|
||||||
|
BuildRequires: rust-packaging
|
||||||
|
|
||||||
|
%global _description %{expand:
|
||||||
|
Offset_of functionality for Rust structs.}
|
||||||
|
|
||||||
|
%description %{_description}
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages
|
||||||
|
which use "%{crate}" crate.
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%license LICENSE
|
||||||
|
%doc README.md
|
||||||
|
%{cargo_registry}/%{crate}-%{version_no_tilde}/
|
||||||
|
|
||||||
|
%package -n %{name}+default-devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description -n %{name}+default-devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages
|
||||||
|
which use "default" feature of "%{crate}" crate.
|
||||||
|
|
||||||
|
%files -n %{name}+default-devel
|
||||||
|
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
|
||||||
|
|
||||||
|
%package -n %{name}+unstable_const-devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description -n %{name}+unstable_const-devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages
|
||||||
|
which use "unstable_const" feature of "%{crate}" crate.
|
||||||
|
|
||||||
|
%files -n %{name}+unstable_const-devel
|
||||||
|
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
|
||||||
|
|
||||||
|
%package -n %{name}+unstable_raw-devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description -n %{name}+unstable_raw-devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages
|
||||||
|
which use "unstable_raw" feature of "%{crate}" crate.
|
||||||
|
|
||||||
|
%files -n %{name}+unstable_raw-devel
|
||||||
|
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{crate}-%{version_no_tilde} -p1
|
||||||
|
%cargo_prep
|
||||||
|
|
||||||
|
%generate_buildrequires
|
||||||
|
%cargo_generate_buildrequires
|
||||||
|
|
||||||
|
%build
|
||||||
|
%cargo_build
|
||||||
|
|
||||||
|
%install
|
||||||
|
%cargo_install
|
||||||
|
|
||||||
|
%if %{with check}
|
||||||
|
%check
|
||||||
|
%cargo_test
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Sat Jan 13 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.5.6-6
|
||||||
|
- Rebuilt for MSVSphere 9.3
|
||||||
|
|
||||||
|
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.6-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Jul 14 2022 Fabio Valentini <decathorpe@gmail.com> - 0.5.6-5
|
||||||
|
- Include patch to fix doctests with Rust 1.62+.
|
||||||
|
|
||||||
|
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.6-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.6-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.6-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Nov 30 2020 Fabio Valentini <decathorpe@gmail.com> - 0.5.6-1
|
||||||
|
- Initial compat package for memoffset 0.5
|
Loading…
Reference in new issue