Version 0.8 (2013-09-26)
-
~2200 changes, numerous bugfixes
-
Language
- The
forloop syntax has changed to work with theIteratortrait. - At long last, unwinding works on Windows.
- Default methods are ready for use.
- Many trait inheritance bugs fixed.
- Owned and borrowed trait objects work more reliably.
copyis no longer a keyword. It has been replaced by theClonetrait.- rustc can omit emission of code for the
debug!macro if it is passed--cfg ndebug - mod.rs is now "blessed". When loading
mod foo;, rustc will now look for foo.rs, then foo/mod.rs, and will generate an error when both are present. - Strings no longer contain trailing nulls. The new
std::c_strmodule provides new mechanisms for converting to C strings. - The type of foreign functions is now
extern "C" fninstead of `*u8'. - The FFI has been overhauled such that foreign functions are called directly, instead of through a stack-switching wrapper.
- Calling a foreign function must be done through a Rust function with the
#[fixed_stack_segment]attribute. - The
externfn!macro can be used to declare both a foreign function and a#[fixed_stack_segment]wrapper at once. pubandprivmodifiers onexternblocks are no longer parsed.unsafeis no longer allowed on extern fns - they are all unsafe.privis disallowed everywhere except for struct fields and enum variants.&T(besides&'static T) is no longer allowed in@T.refbindings in irrefutable patterns work correctly now.charis now prevented from containing invalid code points.- Casting to
boolis no longer allowed. \0is now accepted as an escape in chars and strings.yieldis a reserved keyword.typeofis a reserved keyword.- Crates may be imported by URL with
extern mod foo = "url";. - Explicit enum discriminants may be given as uints as in
enum E { V = 0u } - Static vectors can be initialized with repeating elements,
e.g.
static foo: [u8, .. 100]: [0, .. 100];. - Static structs can be initialized with functional record update,
e.g.
static foo: Foo = Foo { a: 5, .. bar };. cfg!can be used to conditionally execute code based on the crate configuration, similarly to#[cfg(...)].- The
unnecessary_qualificationlint detects unneeded module prefixes (default: allow). - Arithmetic operations have been implemented on the SIMD types in
std::unstable::simd. - Exchange allocation headers were removed, reducing memory usage.
format!implements a completely new, extensible, and higher-performance string formatting system. It will replacefmt!.print!andprintln!write formatted strings (using theformat!extension) to stdout.write!andwriteln!write formatted strings (using theformat!extension) to the new Writers instd::rt::io.- The library section in which a function or static is placed may
be specified with
#[link_section = "..."]. - The
proto!syntax extension for defining bounded message protocols was removed. macro_rules!is hygienic forletdeclarations.- The
#[export_name]attribute specifies the name of a symbol. unreachable!can be used to indicate unreachable code, and fails if executed.
- The
-
Libraries
- std: Transitioned to the new runtime, written in Rust.
- std: Added an experimental I/O library,
rt::io, based on the new runtime. - std: A new generic
rangefunction was added to the prelude, replacinguint::rangeand friends. - std:
range_revno longer exists. Since range is an iterator it can be reversed withrange(lo, hi).invert(). - std: The
chainmethod on option renamed toand_then;unwrap_or_defaultrenamed tounwrap_or. - std: The
iteratormodule was renamed toiter. - std: Integral types now support the
checked_add,checked_sub, andchecked_muloperations for detecting overflow. - std: Many methods in
str,vec,option,result` were renamed for consistency. - std: Methods are standardizing on conventions for casting methods:
to_foofor copying,into_foofor moving,as_foofor temporary and cheap casts. - std: The
CStringtype inc_strprovides new ways to convert to and from C strings. - std:
DoubleEndedIteratorcan yield elements in two directions. - std: The
mut_splitmethod on vectors partitions an&mut [T]into two splices. - std:
str::from_bytesrenamed tostr::from_utf8. - std:
pop_optandshift_optmethods added to vectors. - std: The task-local data interface no longer uses @, and keys are no longer function pointers.
- std: The
swap_unwrapmethod ofOptionrenamed totake_unwrap. - std: Added
SharedPorttocomm. - std:
Eqhas a default method forne; onlyeqis required in implementations. - std:
Ordhas default methods forle,gtandge; onlyltis required in implementations. - std:
is_utf8performance is improved, impacting many string functions. - std:
os::MemoryMapprovides cross-platform mmap. - std:
ptr::offsetis now unsafe, but also more optimized. Offsets that are not 'in-bounds' are considered undefined. - std: Many freestanding functions in
vecremoved in favor of methods. - std: Many freestanding functions on scalar types removed in favor of methods.
- std: Many options to task builders were removed since they don't make sense in the new scheduler design.
- std: More containers implement
FromIteratorso can be created by thecollectmethod. - std: More complete atomic types in
unstable::atomics. - std:
comm::PortSetremoved. - std: Mutating methods in the
SetandMaptraits have been moved into theMutableSetandMutableMaptraits.Container::is_empty,Map::contains_key,MutableMap::insert, andMutableMap::removehave default implementations. - std: Various
from_strfunctions were removed in favor of a genericfrom_strwhich is available in the prelude. - std:
util::unreachableremoved in favor of theunreachable!macro. - extra:
dlist, the doubly-linked list was modernized. - extra: Added a
hexmodule withToHexandFromHextraits. - extra: Added
globmodule, replacingstd::os::glob. - extra:
ropewas removed. - extra:
dequewas renamed toringbuf.RingBufimplementsDeque. - extra:
net, andtimerwere removed. The experimental replacements arestd::rt::io::netandstd::rt::io::timer. - extra: Iterators implemented for
SmallIntMap. - extra: Iterators implemented for
BitvandBitvSet. - extra:
SmallIntSetremoved. UseBitvSet. - extra: Performance of JSON parsing greatly improved.
- extra:
semverupdated to SemVer 2.0.0. - extra:
termhandles more terminals correctly. - extra:
dbgmodule removed. - extra:
parmodule removed. - extra:
futurewas cleaned up, with some method renames. - extra: Most free functions in
getoptswere converted to methods.
-
Other
- rustc's debug info generation (
-Z debug-info) is greatly improved. - rustc accepts
--target-cputo compile to a specific CPU architecture, similarly to gcc's--marchflag. - rustc's performance compiling small crates is much better.
- rustpkg has received many improvements.
- rustpkg supports git tags as package IDs.
- rustpkg builds into target-specific directories so it can be used for cross-compiling.
- The number of concurrent test tasks is controlled by the environment variable RUST_TEST_TASKS.
- The test harness can now report metrics for benchmarks.
- All tools have man pages.
- Programs compiled with
--testnow support the-hand--helpflags. - The runtime uses jemalloc for allocations.
- Segmented stacks are temporarily disabled as part of the transition to the new runtime. Stack overflows are possible!
- A new documentation backend, rustdoc_ng, is available for use. It is
still invoked through the normal
rustdoccommand.
- rustc's debug info generation (