Rust 1.42.0 Released

The latest version of Rust, 1.42.0, features more useful panic messages when unwrapping, subslice patterns and the deprecation of Error::description.

The Rust team has rolled out a new version of Rust, 1.42.0, featuring more useful panic messages when unwrapping, subslice patterns, the deprecation of Error::description, and more.
Those who have a previous version of Rust installed via rustup, can get Rust 1.42.0 by using the command: $ rustup update stable
Well, in earlier versions of Rust 1.41.1, calling unwrap() on an Option::None value would produce an error message as below:
  1. thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /.../src/libcore/macros/  
And same way, the line numbers in the panic messages generated by unwrap_err, expect, and expect_err, and the corresponding methods on the Result type, would also refer to core internals.
Starting with Rust 1.42.0, all eight of these functions render panic messages that give the line number where they were invoked. The new error messages look as below:
  1. thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/  
Meaning that the invalid call to unwrap was on line 2 of src/ This behavior is made possible by an annotation, #[track_caller].
Another highlight of the new release is that you can now use the slice pattern syntax with subslices. For example:
  1. fn foo(words: &[&str]) {  
  2. match words {  
  3. ["Hello""World""!", ..] => println!("Hello World!"),  
  4. ["Foo""Bar", ..] => println!("Baz"),  
  5. rest => println!("{:?}", rest),  
  6. }  
  7. }  
With the release of 1.42.0, Error::description has been deprecated, and its use will now produce a warning. The team recommended making use of Display/to_string instead.