File: gate-tests-atomic-u64

package info (click to toggle)
rust-tower-http-0.4 0.4.4-7
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,236 kB
  • sloc: makefile: 2
file content (53 lines) | stat: -rw-r--r-- 1,637 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
Index: rust-tower-http-0.4.4/src/request_id.rs
===================================================================
--- rust-tower-http-0.4.4.orig/src/request_id.rs
+++ rust-tower-http-0.4.4/src/request_id.rs
@@ -486,10 +486,12 @@ mod tests {
     use std::{
         convert::Infallible,
         sync::{
-            atomic::{AtomicU64, Ordering},
+            atomic::Ordering,
             Arc,
         },
     };
+    #[cfg(target_has_atomic = "64")]
+    use std::sync::atomic::AtomicU64;
     use tower::{ServiceBuilder, ServiceExt};
 
     #[allow(unused_imports)]
@@ -497,6 +499,7 @@ mod tests {
 
     #[tokio::test]
     #[cfg(feature = "util")]
+    #[cfg(target_has_atomic = "64")]
     async fn basic() {
         let svc = ServiceBuilder::new()
             .set_x_request_id(Counter::default())
@@ -527,6 +530,7 @@ mod tests {
     }
 
     #[tokio::test]
+    #[cfg(target_has_atomic = "64")]
     async fn other_middleware_setting_request_id() {
         let svc = ServiceBuilder::new()
             .override_request_header(
@@ -555,6 +559,7 @@ mod tests {
     }
 
     #[tokio::test]
+    #[cfg(target_has_atomic = "64")]
     async fn other_middleware_setting_request_id_on_response() {
         let svc = ServiceBuilder::new()
             .set_x_request_id(Counter::default())
@@ -575,8 +580,10 @@ mod tests {
     }
 
     #[derive(Clone, Default)]
+    #[cfg(target_has_atomic = "64")]
     struct Counter(Arc<AtomicU64>);
 
+    #[cfg(target_has_atomic = "64")]
     impl MakeRequestId for Counter {
         fn make_request_id<B>(&mut self, _request: &Request<B>) -> Option<RequestId> {
             let id =