Add Send + Sync check to all services (#277)

Should prevent us accidentally introducing breaking changes.

Fixes https://github.com/tokio-rs/axum/issues/275
This commit is contained in:
David Pedersen
2021-08-26 20:59:55 +02:00
committed by GitHub
parent e6ca9e4b04
commit 4c5068c01f
8 changed files with 77 additions and 0 deletions
+29
View File
@@ -1106,4 +1106,33 @@ mod tests {
route_spec
);
}
#[test]
fn traits() {
use crate::tests::*;
assert_send::<Router<()>>();
assert_sync::<Router<()>>();
assert_send::<Route<(), ()>>();
assert_sync::<Route<(), ()>>();
assert_send::<EmptyRouter<NotSendSync>>();
assert_sync::<EmptyRouter<NotSendSync>>();
assert_send::<BoxRoute<(), ()>>();
assert_sync::<BoxRoute<(), ()>>();
assert_send::<Layered<()>>();
assert_sync::<Layered<()>>();
assert_send::<Nested<(), ()>>();
assert_sync::<Nested<(), ()>>();
assert_send::<CheckInfallible<()>>();
assert_sync::<CheckInfallible<()>>();
assert_send::<IntoMakeService<()>>();
assert_sync::<IntoMakeService<()>>();
}
}