github rust-lang/rust 1.2.0
Rust 1.2.0

latest releases: 1.78.0, 1.77.2, 1.77.1...
3 years ago
  • ~1200 changes, numerous bugfixes

Highlights

Breaking Changes

Language

  • Patterns with ref mut now correctly invoke DerefMut when matching against dereferenceable values.

Libraries

  • The Extend trait, which grows a collection from an iterator, is implemented over iterators of references, for String, Vec, LinkedList, VecDeque, EnumSet, BinaryHeap, VecMap, BTreeSet and BTreeMap. RFC.
  • The iter::once function returns an iterator that yields a single element, and iter::empty returns an iterator that yields no elements.
  • The matches and rmatches methods on str return iterators over substring matches.
  • Cell and RefCell both implement Eq.
  • A number of methods for wrapping arithmetic are added to the integral types, wrapping_div, wrapping_rem, wrapping_neg, wrapping_shl, wrapping_shr. These are in addition to the existing wrapping_add, wrapping_sub, and wrapping_mul methods, and alternatives to the Wrapping type.. It is illegal for the default arithmetic operations in Rust to overflow; the desire to wrap must be explicit.
  • The {:#?} formatting specifier displays the alternate, pretty-printed form of the Debug formatter. This feature was actually introduced prior to 1.0 with little fanfare.
  • fmt::Formatter implements fmt::Write, a fmt-specific trait for writing data to formatted strings, similar to io::Write.
  • fmt::Formatter adds 'debug builder' methods, debug_struct, debug_tuple, debug_list, debug_set, debug_map. These are used by code generators to emit implementations of Debug.
  • str has new to_uppercase and to_lowercase methods that convert case, following Unicode case mapping.
  • It is now easier to handle poisoned locks. The PoisonError type, returned by failing lock operations, exposes into_inner, get_ref, and get_mut, which all give access to the inner lock guard, and allow the poisoned lock to continue to operate. The is_poisoned method of RwLock and Mutex can poll for a poisoned lock without attempting to take the lock.
  • On Unix the FromRawFd trait is implemented for Stdio, and AsRawFd for ChildStdin, ChildStdout, ChildStderr. On Windows the FromRawHandle trait is implemented for Stdio, and AsRawHandle for ChildStdin, ChildStdout, ChildStderr.
  • io::ErrorKind has a new variant, InvalidData, which indicates malformed input.

Misc

Don't miss a new rust release

NewReleases is sending notifications on new releases.