File: 2001_assert_no_alloc.patch

package info (click to toggle)
rust-ureq 3.0.11%2B~0.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,740 kB
  • sloc: sh: 23; makefile: 13
file content (105 lines) | stat: -rw-r--r-- 2,368 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Description: avoid not-in-Debian crate assert_no_alloc
Author: Jonas Smedegaard <dr@jones.dk>
Forwarded: not-needed
Last-Update: 2025-04-04
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -93,7 +93,6 @@
 env_logger = "0.11.7"
 auto-args = "0.3.0"
 serde = { version = "1.0.204", features = ["std", "derive"] }
-assert_no_alloc = "1.1.2"
 # Enable aws-lc-rs for tests so we can demonstrate using ureq without compiling ring.
 rustls = { version = "0.23", features = ["aws-lc-rs"] }
 
--- a/src/agent.rs
+++ b/src/agent.rs
@@ -390,15 +390,3 @@
         self.pool.pool_count()
     }
 }
-
-#[cfg(test)]
-mod test {
-    use super::*;
-    use assert_no_alloc::*;
-
-    #[test]
-    fn agent_clone_does_not_allocate() {
-        let a = Agent::new_with_defaults();
-        assert_no_alloc(|| a.clone());
-    }
-}
--- a/src/config.rs
+++ b/src/config.rs
@@ -997,15 +997,3 @@
             .finish()
     }
 }
-
-#[cfg(test)]
-mod test {
-    use super::*;
-    use assert_no_alloc::*;
-
-    #[test]
-    fn default_config_clone_does_not_allocate() {
-        let c = Config::default();
-        assert_no_alloc(|| c.clone());
-    }
-}
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -699,16 +699,11 @@
 pub(crate) mod test {
     use std::{io, sync::OnceLock};
 
-    use assert_no_alloc::AllocDisabler;
     use config::{Config, ConfigBuilder};
     use typestate::AgentScope;
 
     use super::*;
 
-    #[global_allocator]
-    // Some tests checks that we are not allocating
-    static A: AllocDisabler = AllocDisabler;
-
     pub fn init_test_log() {
         static INIT_LOG: OnceLock<()> = OnceLock::new();
         INIT_LOG.get_or_init(env_logger::init);
--- a/src/proxy.rs
+++ b/src/proxy.rs
@@ -482,13 +482,6 @@
 #[cfg(test)]
 mod test {
     use super::*;
-    use assert_no_alloc::*;
-
-    #[test]
-    fn proxy_clone_does_not_allocate() {
-        let c = Proxy::new("socks://1.2.3.4").unwrap();
-        assert_no_alloc(|| c.clone());
-    }
 
     #[test]
     fn proxy_new_default_scheme() {
--- a/src/tls/mod.rs
+++ b/src/tls/mod.rs
@@ -370,15 +370,3 @@
         }
     }
 }
-
-#[cfg(test)]
-mod test {
-    use super::*;
-    use assert_no_alloc::*;
-
-    #[test]
-    fn tls_config_clone_does_not_allocate() {
-        let c = TlsConfig::default();
-        assert_no_alloc(|| c.clone());
-    }
-}