diff options
| author | bors <bors@rust-lang.org> | 2015-08-14 15:26:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-08-14 15:26:09 +0000 |
| commit | e7261f3ab60e0d1e6c808004ecd25c88e04f3683 (patch) | |
| tree | 43c443aa413ef4bec429ae0f29b7c802943a8c74 /src/libstd | |
| parent | 0649b16ade40d1fb02ea5c390293278bd876854a (diff) | |
| parent | 7f8942c18d552837033dc543e03a4156200896e8 (diff) | |
| download | rust-e7261f3ab60e0d1e6c808004ecd25c88e04f3683.tar.gz rust-e7261f3ab60e0d1e6c808004ecd25c88e04f3683.zip | |
Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc
This PR implements the majority of RFC 1214. In particular, it implements: - the new outlives relation - comprehensive WF checking For the most part, new code receives warnings, not errors, though 3 regressions were found via a crater run. There are some deviations from RFC 1214. Most notably: - we still consider implied bounds from fn ret; this intersects other soundness issues that I intend to address in detail in a follow-up RFC. Fixing this without breaking a lot of code probably requires rewriting compare-method somewhat (which is probably a good thing). - object types do not check trait bounds for fear of encountering `Self`; this was left as an unresolved question in RFC 1214, but ultimately feels inconsistent. Both of those two issues are highlighted in the tracking issue, https://github.com/rust-lang/rust/issues/27579. #27579 also includes a testing matrix with new tests that I wrote -- these probably duplicate some existing tests, I tried to check but wasn't quite sure what to look for. I tried to be thorough in testing the WF relation, at least, but would welcome suggestions for missing tests. r? @nrc (or perhaps someone else?)
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sync/mutex.rs | 2 | ||||
| -rw-r--r-- | src/libstd/thread/local.rs | 2 | ||||
| -rw-r--r-- | src/libstd/thread/scoped_tls.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 4b62434d068..773bd7f5606 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -369,7 +369,7 @@ mod tests { use sync::{Arc, Mutex, StaticMutex, Condvar}; use thread; - struct Packet<T: Send>(Arc<(Mutex<T>, Condvar)>); + struct Packet<T>(Arc<(Mutex<T>, Condvar)>); unsafe impl<T: Send> Send for Packet<T> {} unsafe impl<T> Sync for Packet<T> {} diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs index 3bf170b5fe2..a228cbfd85b 100644 --- a/src/libstd/thread/local.rs +++ b/src/libstd/thread/local.rs @@ -60,7 +60,7 @@ pub use self::imp::Key as __KeyInner; /// }); /// ``` #[stable(feature = "rust1", since = "1.0.0")] -pub struct LocalKey<T> { +pub struct LocalKey<T:'static> { // The key itself may be tagged with #[thread_local], and this `Key` is // stored as a `static`, and it's not valid for a static to reference the // address of another thread_local static. For this reason we kinda wonkily diff --git a/src/libstd/thread/scoped_tls.rs b/src/libstd/thread/scoped_tls.rs index 303ab0f9f01..810e3bb62f7 100644 --- a/src/libstd/thread/scoped_tls.rs +++ b/src/libstd/thread/scoped_tls.rs @@ -55,7 +55,7 @@ pub use self::imp::KeyInner as __KeyInner; #[unstable(feature = "scoped_tls", reason = "scoped TLS has yet to have wide enough use to fully consider \ stabilizing its interface")] -pub struct ScopedKey<T> { inner: fn() -> &'static imp::KeyInner<T> } +pub struct ScopedKey<T:'static> { inner: fn() -> &'static imp::KeyInner<T> } /// Declare a new scoped thread local storage key. /// |
