Skip to content

Commit adfcd93

Browse files
committed
Add missing marker to std::thread::JoinGuard.
The lifetime was previously, incorrectly unconstrained.
1 parent 22c8832 commit adfcd93

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libstd/thread.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ use any::Any;
151151
use boxed::Box;
152152
use cell::UnsafeCell;
153153
use clone::Clone;
154-
use marker::{Send, Sync};
154+
use marker::{Send, Sync, CovariantType};
155155
use ops::{Drop, FnOnce};
156156
use option::Option::{self, Some, None};
157157
use result::Result::{Err, Ok};
@@ -255,6 +255,7 @@ impl Builder {
255255
joined: false,
256256
packet: my_packet,
257257
thread: thread,
258+
_marker: CovariantType,
258259
}
259260
}
260261

@@ -487,6 +488,7 @@ pub struct JoinGuard<'a, T: 'a> {
487488
thread: Thread,
488489
joined: bool,
489490
packet: Packet<T>,
491+
_marker: CovariantType<&'a T>,
490492
}
491493

492494
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)