Rust 1.24 Adds Reformatter
Rust 1.24 Adds Reformatter
Written by Kay Ewbank   
Friday, 23 February 2018

The latest version of Rust has added a tool to format its code in a standard style . The systems programming language also has incremental compilation enabled by default.

Rust was originally sponsored by Mozilla, and is designed to be safe, fast and concurrent without having a garbage collector. It uses innovative means to make system programming safe by the language being constructed in such a way that problems can be detected at compile time. Intended uses include embedding in other languages, writing programs with specific space and time requirements, and writing low-level code, like device drivers and operating systems.

The new formatting utlitiy is a preview release of rustfmt. This by default applies a style that conforms to the Rust style guide that has been formalized through the style RFC process. The style is similar to that used by other LLVM-based code formatters.

The other main improvement is that incremental compilation is now enabled by default. Incremental compilation overcomes the problem of having to compile the whole project having made only a small change. Incremental compilation only compiles the code you’ve actually changed, which means that that second build is faster, and this feature is now turned on by default.

The final noteworthy change to the new release is better handling of undefined behavior. The developers say:

"Rust generally strives to minimize undefined behavior, having none of it in safe code, and as little as possible in unsafe code. One area where you could invoke UB is when a panic! goes across an FFI boundary."

In other words, this:

extern "C" fn panic_in_ffi() {
    panic!("Test");
}

Which cannot work, as the exact mechanism of how panics work would have to be reconciled with how the "C" ABI works, in this example, or any other ABI in other examples. In Rust 1.24, this code will now abort instead of producing undefined behavior.

The new release is available on GitHub.

rust

More Information

Rust Website 

 

Related Articles

Rust 1.23 Uses Less Memory

Rust 1.20 Adds Associated Contents

Rust 1.16

Updated Rust Improves Documentation

Rust 1.6 Released

Rust 1.3 Released

Rust Releases New Versions

Rust Hits Stable 1.0 - So What?

Rust 1.0 Alpha Released       

Rust Reaches 0.9

Rust 0.7 Released

Rust 0.4 Full Integration of Borrowed Pointers

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin.

 

Banner


Intel Open Sources NLP Architect
28/05/2018

Intel AL Lab has open-sourced a library of natural language processing tool, which will be a help to developers creating chatbots and building skills for virtual assistants. It is one of several AI re [ ... ]



Atom v Visual Studio Code - The Unexpected Consequence Of Consolidation
14/06/2018

OK, so you got upset about Microsoft taking over GitHub, but after a lot of reassurance you can see that commercial interests mean that Microsoft isn't going to trash GitHub - well not at first. But w [ ... ]


More News

 

justjsquare

 



 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Friday, 23 February 2018 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2018 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.