Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement variance RFC #738 #22286

Closed
wants to merge 34 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2594d56
Introduce the new phantomdata/phantomfn markers and integrate them
nikomatsakis Feb 12, 2015
91eedfe
Report errors for type parameters that are not constrained, either by
nikomatsakis Feb 12, 2015
8c841f2
Extend coherence check to understand subtyping.
nikomatsakis Feb 12, 2015
801bc48
Rewrite `Unique<T>` so that it is covariant in T, implies `NonZero` a…
nikomatsakis Feb 12, 2015
f2529ac
Constrain operands to outlive the operation. Fixes #21422.
nikomatsakis Feb 12, 2015
c5579ca
Fallout: Port Vec to use `Unique`
nikomatsakis Feb 12, 2015
b3c00a6
Fallout: btree. Rephrase invariant lifetime in terms of PhantomData.
nikomatsakis Feb 12, 2015
68ebe64
Fallout: port btree to use Unique, some markers.
nikomatsakis Feb 12, 2015
c2891cc
Fallout: EnumSet, add Marker.
nikomatsakis Feb 12, 2015
8dbdcdb
Fallout: RingBuf, use Unique.
nikomatsakis Feb 12, 2015
2bcf3a4
Fallout: arena needs to use phantomdata since invariantlifetime is gone
nikomatsakis Feb 12, 2015
1735e41
Fallout: AtomicPtr needs phantom data to indicate that it contains an…
nikomatsakis Feb 12, 2015
d801a4d
Fallout: iter, add markers or other changes such that all type parame…
nikomatsakis Feb 12, 2015
ef42c2b
Fallout: docs, elided examples often elided too much.
nikomatsakis Feb 12, 2015
872ce47
Fallout: tests. As tests frequently elide things, lots of changes
nikomatsakis Feb 12, 2015
60f507b
Fallout: remove unused type and region parameters.
nikomatsakis Feb 12, 2015
aaf4176
Fallout: Port slice to use `PhantomData` instead of `ContravariantLif…
nikomatsakis Feb 12, 2015
2953710
Fallout: port libflate to new Unique API
nikomatsakis Feb 12, 2015
199b992
Fallout: add phantom data to librand
nikomatsakis Feb 12, 2015
62b5177
Fallout: add phantom data to the type inferencer
nikomatsakis Feb 12, 2015
1ed5842
Fallout: extend thread with phantomdata for `'a` lifetime
nikomatsakis Feb 12, 2015
9e0bb52
Fallout: add phantomdata for 'a in path
nikomatsakis Feb 12, 2015
ae7c534
Fallout: port hashmap to use Unique
nikomatsakis Feb 12, 2015
6f2a1c9
Fallout: add phantomdata to hash
nikomatsakis Feb 12, 2015
df76442
Fallout: Accepter trait needs phantomdata. This seems like it should
nikomatsakis Feb 12, 2015
d179bb5
Add regression test for #20533. Fixes #20533.
nikomatsakis Feb 13, 2015
e8cb11c
Missing test.
nikomatsakis Feb 18, 2015
a2393e6
WIP -- improve documentation on the phantom traits
nikomatsakis Feb 18, 2015
d622235
Add deprecated versions of the old markers and integrate them back in…
nikomatsakis Feb 18, 2015
74199c2
Try to write some basic docs.
nikomatsakis Feb 18, 2015
f5491e6
Stabilize Send/Sync.
nikomatsakis Feb 18, 2015
cc61f9c
Minor unused imports etc.
nikomatsakis Feb 18, 2015
9f8b9d6
Update tests to use #[feature(rustc_attrs)]
nikomatsakis Feb 18, 2015
2e482cd
Mark intentionally buggy test as ignore
nikomatsakis Feb 18, 2015
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
Prev Previous commit
Next Next commit
Fallout: extend thread with phantomdata for 'a lifetime
  • Loading branch information
nikomatsakis committed Feb 18, 2015
commit 1ed58428297611f60a6b5c7cf7024a4cd25b672c
6 changes: 3 additions & 3 deletions src/libstd/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ use any::Any;
use cell::UnsafeCell;
use fmt;
use io;
use marker;
use marker::{PhantomData, Send, Sync};
use old_io::stdio;
use rt::{self, unwind};
use sync::{Mutex, Condvar, Arc};
Expand Down Expand Up @@ -260,7 +260,7 @@ impl Builder {
T: Send + 'a, F: FnOnce() -> T, F: Send + 'a
{
self.spawn_inner(Thunk::new(f)).map(|inner| {
JoinGuard { inner: inner, _marker: marker::CovariantType }
JoinGuard { inner: inner, _marker: PhantomData }
})
}

Expand Down Expand Up @@ -642,7 +642,7 @@ impl Drop for JoinHandle {
#[stable(feature = "rust1", since = "1.0.0")]
pub struct JoinGuard<'a, T: 'a> {
inner: JoinInner<T>,
_marker: marker::CovariantType<&'a T>,
_marker: PhantomData<&'a T>,
}

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