Skip to content

Rust 0.5

Compare
Choose a tag to compare
@rustbot rustbot released this 10 Sep 05:53
· 257801 commits to master since this release
  • ~900 changes, numerous bugfixes

  • Syntax changes

    • Removed <- move operator
    • Completed the transition from the #fmt extension syntax to fmt!
    • Removed old fixed length vector syntax - [T]/N
    • New token-based quasi-quoters, quote_tokens!, quote_expr!, etc.
    • Macros may now expand to items and statements
    • a.b() is always parsed as a method call, never as a field projection
    • Eq and IterBytes implementations can be automatically generated with #[deriving_eq] and #[deriving_iter_bytes] respectively
    • Removed the special crate language for .rc files
    • Function arguments may consist of any irrefutable pattern
  • Semantic changes

    • & and ~ pointers may point to objects
    • Tuple structs - struct Foo(Bar, Baz). Will replace newtype enums.
    • Enum variants may be structs
    • Destructors can be added to all nominal types with the Drop trait
    • Structs and nullary enum variants may be constants
    • Values that cannot be implicitly copied are now automatically moved without writing move explicitly
    • &T may now be coerced to *T
    • Coercions happen in let statements as well as function calls
    • use statements now take crate-relative paths
    • The module and type namespaces have been merged so that static method names can be resolved under the trait in which they are declared
  • Improved support for language features

    • Trait inheritance works in many scenarios
    • More support for explicit self arguments in methods - self, &self @self, and ~self all generally work as expected
    • Static methods work in more situations
    • Experimental: Traits may declare default methods for the implementations to use
  • Libraries

    • New condition handling system in core::condition
    • Timsort added to std::sort
    • New priority queue, std::priority_queue
    • Pipes for serializable types, `std::flatpipes'
    • Serialization overhauled to be trait-based
    • Expanded getopts definitions
    • Moved futures to std
    • More functions are pure now
    • core::comm renamed to oldcomm. Still deprecated
    • rustdoc and cargo are libraries now
  • Misc

    • Added a preliminary REPL, rusti
    • License changed from MIT to dual MIT/APL2