1. 29 4月, 2015 1 次提交
  2. 25 4月, 2015 1 次提交
  3. 23 4月, 2015 1 次提交
  4. 14 4月, 2015 1 次提交
  5. 09 4月, 2015 1 次提交
    • S
      Implement reentrant mutexes and make stdio use them · 45aa6c8d
      Simonas Kazlauskas 提交于
      write_fmt calls write for each formatted field. The default implementation of write_fmt is used,
      which will call write on not-yet-locked stdout (and write locking after), therefore making print!
      in multithreaded environment still interleave contents of two separate prints.
      
      This patch implements reentrant mutexes, changes stdio handles to use these mutexes and overrides
      write_fmt to lock the stdio handle for the whole duration of the call.
      45aa6c8d
  6. 02 4月, 2015 1 次提交
  7. 25 3月, 2015 2 次提交
    • F
      Reject specialized Drop impls. · 5b2e8693
      Felix S. Klock II 提交于
      See Issue 8142 for discussion.
      
      This makes it illegal for a Drop impl to be more specialized than the
      original item.
      
      So for example, all of the following are now rejected (when they would
      have been blindly accepted before):
      
      ```rust
      struct S<A> { ... };
      impl Drop for S<i8> { ... } // error: specialized to concrete type
      
      struct T<'a> { ... };
      impl Drop for T<'static> { ... } // error: specialized to concrete region
      
      struct U<A> { ... };
      impl<A:Clone> Drop for U<A> { ... } // error: added extra type requirement
      
      struct V<'a,'b>;
      impl<'a,'b:a> Drop for V<'a,'b> { ... } // error: added extra region requirement
      ```
      
      Due to examples like the above, this is a [breaking-change].
      
      (The fix is to either remove the specialization from the `Drop` impl,
      or to transcribe the requirements into the struct/enum definition;
      examples of both are shown in the PR's fixed to `libstd`.)
      
      ----
      
      This is likely to be the last thing blocking the removal of the
      `#[unsafe_destructor]` attribute.
      
      Includes two new error codes for the new dropck check.
      
      Update run-pass tests to accommodate new dropck pass.
      
      Update tests and docs to reflect new destructor restriction.
      
      ----
      
      Implementation notes:
      
      We identify Drop impl specialization by not being as parametric as the
      struct/enum definition via unification.
      
      More specifically:
      
       1. Attempt unification of a skolemized instance of the struct/enum
          with an instance of the Drop impl's type expression where all of
          the impl's generics (i.e. the free variables of the type
          expression) have been replaced with unification variables.
      
       2. If unification fails, then reject Drop impl as specialized.
      
       3. If unification succeeds, check if any of the skolemized
          variables "leaked" into the constraint set for the inference
          context; if so, then reject Drop impl as specialized.
      
       4. Otherwise, unification succeeded without leaking skolemized
          variables: accept the Drop impl.
      
      We identify whether a Drop impl is injecting new predicates by simply
      looking whether the predicate, after an appropriate substitution,
      appears on the struct/enum definition.
      5b2e8693
    • F
  8. 24 3月, 2015 1 次提交
  9. 21 3月, 2015 1 次提交
  10. 14 3月, 2015 1 次提交
  11. 12 3月, 2015 1 次提交
  12. 08 3月, 2015 1 次提交
    • H
      Remove unneeded `Send`/`Sync` bounds from `Mutex`/`RwLock`. · 25d070f2
      Huon Wilson 提交于
      The requirements `T: Send` and `T: Send + Sync` for `Mutex` and `RwLock`
      respectively only matter if those types are shared/sent across thread
      boundaries, and that is adequately controlled by the impls of
      `Send`/`Sync` for them. If `T` doesn't satisfy the bounds, then
      the types cannot cross thread boundaries and so everything is still
      safe (the two types just act like an expensive `RefCell`).
      25d070f2
  13. 03 3月, 2015 1 次提交
    • F
      Use `const`s instead of `static`s where appropriate · f35f973c
      Florian Zeitz 提交于
      This changes the type of some public constants/statics in libunicode.
      Notably some `&'static &'static [(char, char)]` have changed
      to `&'static [(char, char)]`. The regexp crate seems to be the
      sole user of these, yet this is technically a [breaking-change]
      f35f973c
  14. 26 2月, 2015 1 次提交
  15. 23 2月, 2015 1 次提交
  16. 21 2月, 2015 2 次提交
    • H
      Remove `'static` bound from sync::mpsc, Mutex and RwLock. · 380d23b5
      Huon Wilson 提交于
      Adds some basic tests to check that the types still catch the most
      glaring errors that could occur.
      
      cc #22444.
      380d23b5
    • A
      std: Tidy up some `unsafe impl`s for `sync` · 64fe93e4
      Alex Crichton 提交于
      This commit removes many unnecessary `unsafe impl` blocks as well as pushing the
      needed implementations to the lowest level possible. I noticed that the bounds
      for `RwLock` are a little off when reviewing #22574 and wanted to ensure that we
      had our story straight on these implementations.
      64fe93e4
  17. 18 2月, 2015 3 次提交
  18. 07 2月, 2015 1 次提交
  19. 30 1月, 2015 1 次提交
  20. 29 1月, 2015 1 次提交
  21. 24 1月, 2015 2 次提交
  22. 22 1月, 2015 2 次提交
  23. 21 1月, 2015 1 次提交
  24. 16 1月, 2015 1 次提交
  25. 07 1月, 2015 3 次提交
  26. 06 1月, 2015 1 次提交
  27. 04 1月, 2015 1 次提交
  28. 03 1月, 2015 3 次提交
  29. 30 12月, 2014 2 次提交
    • A
      Test fixes and rebase conflicts · 470ae101
      Alex Crichton 提交于
      470ae101
    • A
      std: Stabilization pass for mutex/rwlock/condvar · 35e63e38
      Alex Crichton 提交于
      This commit performs a stabilization pass over the sync::{mutex, rwlock,
      condvar} modules, marking the following items as stable:
      
      * Mutex
      * Mutex::new
      * Mutex::lock
      * Mutex::try_lock
      * MutexGuard
      * RWLock
      * RWLock::new
      * RWLock::read
      * RWLock::try_read
      * RWLock::write
      * RWLock::try_write
      * RWLockReadGuard
      * RWLockWriteGuard
      * Condvar
      * Condvar::new
      * Condvar::wait
      * Condvar::notify_one
      * Condvar::notify_all
      * PoisonError
      * TryLockError
      * TryLockError::Poisoned
      * TryLockError::WouldBlock
      * LockResult
      * TryLockResult
      
      The following items remain unstable to explore future possibilities of unifying
      the static/non-static variants of the types:
      
      * StaticMutex
      * StaticMutex::new
      * StaticMutex::lock
      * StaticMutex::try_lock
      * StaticMutex::desroy
      * StaticRWLock
      * StaticRWLock::new
      * StaticRWLock::read
      * StaticRWLock::try_read
      * StaticRWLock::write
      * StaticRWLock::try_write
      * StaticRWLock::destroy
      
      The following items were removed in favor of `Guard<'static, ()>` instead.
      
      * StaticMutexGuard
      * StaticRWLockReadGuard
      * StaticRWLockWriteGuard
      35e63e38