Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/header/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =====

Expand Down Expand Up @@ -3399,7 +3401,7 @@ mod as_header_name {

#[test]
fn test_bounds() {
fn check_bounds<T: Send + Send>() {}
fn check_bounds<T: Send + Sync>() {}

check_bounds::<HeaderMap<()>>();
check_bounds::<Iter<'static, ()>>();
Expand All @@ -3414,7 +3416,7 @@ fn test_bounds() {
check_bounds::<OccupiedEntry<'static, ()>>();
check_bounds::<ValueIter<'static, ()>>();
check_bounds::<ValueIterMut<'static, ()>>();
check_bounds::<ValueDrain<'static, ()>>();
// cannot: ValueDrain<'static, ()>
}

#[test]
Expand Down