From cfc18531b16fbef41b5d9846fa3843a9f678457f Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Mon, 25 Nov 2019 15:59:28 -0800 Subject: [PATCH] Remove Send from ValueDrain iterator --- src/header/map.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/header/map.rs b/src/header/map.rs index 38447fa5..066105e9 100644 --- a/src/header/map.rs +++ b/src/header/map.rs @@ -3030,8 +3030,10 @@ impl<'a, T> Drop for ValueDrain<'a, T> { } } -unsafe impl<'a, T: Sync> Sync for ValueDrain<'a, T> {} -unsafe impl<'a, T: Send> Send for ValueDrain<'a, T> {} +// `ValueDrain` cannot be `Send` because it has un-synchronized mutation of +// the `extra_values` vector. +// +// See https://github.com/hyperium/http/issues/355 // ===== impl RawLinks ===== @@ -3399,7 +3401,7 @@ mod as_header_name { #[test] fn test_bounds() { - fn check_bounds() {} + fn check_bounds() {} check_bounds::>(); check_bounds::>(); @@ -3414,7 +3416,7 @@ fn test_bounds() { check_bounds::>(); check_bounds::>(); check_bounds::>(); - check_bounds::>(); + // cannot: ValueDrain<'static, ()> } #[test]