Rust Adds Source-based Code Coverage
Written by Kay Ewbank   
Tuesday, 21 June 2022

Rust 1.61 has been released with improvements including custom exit codes from main, along with source-based code coverage. Rust is now safeguarded by the Rust Foundation, a cross-industry body aimed at supporting the language and its developers.

Rust is popular for situations including being embedded in other languages, writing programs with specific space and time requirements, and writing low-level code.

.

rust

Support for LLVM-based coverage instrumentation has been stabilized in rustc. This means that the Rust compiler now includes two code coverage implementations - a GCC-compatible, gcov-based coverage implementation, enabled with -Z profile, which derives coverage data based on DebugInfo; and the new source-based code coverage implementation, enabled with -C instrument-coverage, which uses LLVM's native, efficient coverage instrumentation to generate very precise coverage data.

Rust now has better support for Cargo features and how they interact with optional dependencies with the addition of namespaced dependencies and weak dependency features. Namespaced features can be used to explicitly refer to an optional dependency without implicitly exposing it as a feature, while weak dependency features means developers can enable a feature on an optional dependency only if some other feature has enabled the optional dependency.

Release 1.61 also adds the ability to have custom exit codes from main. This improves the ability added in Rust 1.26 to return a success or failure result from Main. These alternate return types have until now been unified by an unstable Termination trait. In this release, the Termination trait is stable, along with a more general ExitCode type that wraps platform-specific return types.

Several incremental features have been stabilized in this release to enable more functionality in const functions, including basic handling of fn pointers and the ability to write trait bounds on generic parameters to const fn.

Rust 1.61 is available now..

rust

 

More Information

Rust Website

Related Articles

Rust Lang Releases 2024 Roadmap

Rust 1.50 Improves Array Indexing

Rust Team Announces Rust Foundation

Rust Survey 2020

Rust Fast And Safe

 

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, Facebook or Linkedin.

Banner


100 Episodes of 5mins of Postgres
08/03/2024

The popular PostgreSQL explainer series is celebrating its 100th release and beyond. Let's take a look at what it makes it so special.



GR00T Could Be The Robot You Have Always Wanted
27/03/2024

We may not have flying cars, but we could well soon have robots that match up to predictions for the 21st century. Nvidia has announced GR00T, a cleverly named project to build robots using foundation [ ... ]


More News

raspberry pi books

 

Comments




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

Last Updated ( Tuesday, 21 June 2022 )