[an error occurred while processing the directive]
RSS
Логотип
Баннер в шапке 1
Баннер в шапке 2

Rust (programming language)

Product
Developers: Rust Foundation
Last Release Date: 2023/08/24
Branches: Information Technology
Technology: Application Development Tools

Content

The main articles are:

2023

Rust is the most popular programming language among hackers

The multi-paradigm compiled general-purpose programming language Rust, which hackers most often write in, is gaining popularity. This is stated in the study, the results of which were released in early August 2023 by the Rust Survey Working Group and the independent non-profit organization Rust Foundation.

The survey was conducted in December 2022 among users around the world, including Russia. More than 9,400 respondents took part in the study, and 82% of participants (76% a year earlier) were able to answer all the questions. A significant increase in the number of people who viewed the survey but did not participate in it was recorded: from 16,457 in 2021 to 25,581 in 2022, that is, by more than 55%.

Use of Rust in operation

It is said that over 90% of respondents identified themselves as Rust users. Of these, 47% use this programming language daily, which is 4% more than in 2021. About a third of respondents (30%) can write simple programs in Rust, 27% can create ready-to-use code. Approximately 42% of respondents talk about their high level of ownership of Rust. Among those who abandoned Rust, 30% cited the complexity of the language as the main reason. The same circumstance was indicated by 26% of those who do not use Rust in their work.

The report notes that there are several factors contributing to the growing popularity of Rust in the professional environment. This is the ability to create software without errors (86%), high language efficiency (84%) and security (69%). Of those respondents who use Rust in their work, 72% reported that the language helped their teams achieve their goals (4% more than in 2021). About 75% of survey participants said they plan to continue using Rust in their future projects.[1]

Rust 1.72

On August 24, 2023, it became known that the release of the general-purpose programming language Rust 1.72, founded by the Mozilla project, but now developed under the auspices of the independent non-profit organization Rust Foundation, was published. The language is focused on working securely with memory and provides the means to achieve optimal parallelism in job execution, while avoiding the use of garbage collector and runtime (runtime reduces to basic initialization and maintenance of the standard library).

source = Youtube channel chris biscardi
Rust 1.72

As reported, the methods of working with memory in Rust save the developer from errors when manipulating pointers and protect against problems arising from low-level work with memory, such as accessing the memory area after it is freed, exchanging zero pointers, going beyond the buffer boundaries, etc. To distribute libraries, ensure assembly and manage project dependencies, the Cargo package manager is developing. A repository is supported to host libraries crates.io.

Secure memory operation is provided in Rust during compilation through link checking, object ownership tracking, accounting for the lifetime of objects (scope) and assessing the correctness of memory access during code execution. Rust also provides tools for protecting against integer overflows, requires mandatory initialization of variable values ​ ​ before use, better handles errors in the standard library, applies the concept of immutable references and default variables, and offers strong static typing to minimize logical errors.

Major changes:

  • Error messages provide the display of information about elements disabled through the cfg conditional compilation attributes, which allow you to activate the execution of Rust code depending on the presence of support for certain crate capabilities or launch on individual platforms. Previously, elements disabled through cfg were not visible to the compiler, but now the compiler remembers their names and hide conditions, and displays this information in error messages, which, for example, allows you to understand that some function is unavailable due to the disabling of certain feature-properties in crate.
  • Removed constraints on the computation time of const expressions. Previously, to prevent looping during compilation, Rust limited the maximum number of expressions executed during constant computation. This feature led to the conclusion of errors when compiling code that does not fit into the restrictions, so in this release it was decided to replace the strict restrictions with the output of a warning informing about the constant calculations that were performed for a long time. Also, by default, lint const_eval_long_running checking is used, which detects looping.
  • A series of lint checks from Clippy: undropped_manually_drops, invalid_utf8_in_unchecked, invalid_nan_comparisons and invalid_reference_casting were transferred to the rustc compiler.
  • A portion of APIs has been transferred to the stable category, including stabilized methods and implementations of types:


impl<T: Send> Sync for mpsc::Sender<T>
impl TryFrom<&OsStr> for &str
String::leak

  • The sign "const," which determines the possibility of using in any context instead of constants, is used in functions:


CStr::from_bytes_with_nul
CStr::to_bytes
CStr::to_bytes_with_nul
CStr::to_str

  • The third level of support for loongarch64-unknown-none platforms has been implemented. The third level implies basic support, but without automated testing, publishing official assemblies and checking the possibility of building code.
  • In the future release of Rust 1.76, it is planned to end support for Windows 7, 8 and 8.1 platforms, and make Windows 10 the minimum version for both the compiler itself and for compilation purposes.

Additionally, we can mention the disagreements in the community that arose due to the transition of the Serde framework developers to the supply of a crate package serde_derive with the derive macro only in an already compiled binary form. The serde_derive package is used to serialize and deserialize data and is used as a dependency in 5495 other packages, among which 10 have more than 50 million downloads. The total number of serde_derive downloads is estimated at 172 million (up to 400 thousand downloads per day).

The fear is that the binary delivery will make it difficult to audit the integrity of the package and increase the risk of compromising dependent projects in the event of a successful attack on the Serde framework developers. According to the users participating in the discussion, increasing the speed of assembly due to delivery in a pre-compiled form does not justify the emerging security risks. The binary delivery will also make it difficult to maintain Rust packages in projects and distributions, such as Fedora Linux, prohibiting the supply of third-party binary components.

As one of the solutions, representatives of the community proposed to continue the supply of serde_derive as before in the source texts, and for a binary assembly to create a separate package that can be used as desired, without imposing on existing users. The maintainer of the Serde project refused to compromise and said that a pre-compiled implementation of the macro would be the only option for delivering the serde_derive package.

Serde code continues to be open source and distributed under MIT and Apache 2.0 licenses, and developers who disagree with the policy are asked to create and maintain their own fork of the package. In response to criticism of the loss of the ability to analyze the package code before use, the Serde maintainer pointed out that even the striking translation of the serde_derive into binary form was noticed only after 4 weeks and 12 releases. With this attitude, a professionally obfuscated malicious insert in the source texts can probably go unnoticed for years.

To confirm the correctness of assemblies and identify a possible substitution of content after a successful attack, the possibility of using verification based on repeated assemblies is considered, which allows you to make sure that the binary file is collected from the source code placed in the repository without making changes.

In release 1.0.184, the developers returned to the delivery of the serde_derive package in the source texts, deciding to postpone the transition to the supply in binary form until the crate package manager accepts changes to fully support verification of pre-compiled macros. Serde developers have prepared an RFC with a proposal to implement in Crate verification of pre-compiled packages, carried out on the repository server crates.io through the reconciliation of a binary file with a repeatable assembly from source code[2].

Rust 1.71

On July 14, 2023, it became known that the release of the general-purpose programming language Rust 1.71, founded by the Mozilla project, but now developed under the auspices of the independent non-profit organization Rust Foundation, was published. The language is focused on working securely with memory and provides tools to achieve parallelism in job execution, while avoiding the use of garbage collector and runtime (runtime reduces to basic initialization and maintenance of the standard library).

Rust 1.71

As reported, the methods of working with memory in Rust save the developer from errors when manipulating pointers and protect against problems arising from low-level work with memory, such as accessing the memory area after it is freed, exchanging zero pointers, going beyond the buffer boundaries, etc. To distribute libraries, ensure assembly and manage project dependencies, the Cargo package manager is developing. A repository is supported to host libraries crates.io.

Secure memory operation is provided in Rust during compilation through link checking, object ownership tracking, accounting for the lifetime of objects (scope) and assessing the correctness of memory access during code execution. Rust also provides tools for protecting against integer overflows, requires mandatory initialization of variable values ​ ​ before use, better handles errors in the standard library, applies the concept of immutable references and default variables, and offers strong static typing to minimize logical errors.

Major changes:

  • Stabilized by ABI C-unwind ('extern "C-unwind"'), which differs from ABI without the suffix "-unwind" ('extern "C"') by preserving safe behavior (safe) if an "unwinding" process, initiated when a program terminates abnormally or generates a C++ -style exception, crosses the ABI boundary (for example, when an exception that occurs in code in one programming language, when the code is unwinded, affects a stack in another programming language).
  • Stabilized support for attributes'# [debug_visualizer (natvis_file = ""...)] 'and'# [debug_visualizer (gdb_script_file = ""...)] ', which allow you to embed Microsoft Natviz metadata and GDB scripts in Rust libraries to optimize debug output when inspecting data structures created by libraries. Similar scripts are already enabled for the standard library, and now it is possible to enable them for third-party libraries.
  • On the Windows platform, it is possible to use functions from dynamic libraries that are not available during assembly (for example, so as not to install unnecessary libraries in the assembly environment and simplify cross-compilation). The option'kind = "raw-dylib" 'is proposed to link to missing libraries in the "# [link]" attribute.
  • Target platforms using the Musl C-library ("* -linux-musl") have been converted to the Musl 1.2.3 release (previously used version 1.1.24), which allows the time64 type to be used on 32-bit systems.
  • The standard library offers a variant of the thread_local macro, initialized with the "const" feature, which allows use in the context instead of constants, which allows you to generate more optimal code.

use std::cell::Cell;

thread_local! { pub static FOO: Cell = const { Cell::new(1) }; }

  • A portion of APIs has been transferred to the stable category, including stabilized methods and implementations of types:

CStr::is_empty
BuildHasher::hash_one
NonZeroI*::is_positive
NonZeroI*::is_negative
NonZeroI*::checked_neg
NonZeroI*::overflowing_neg
NonZeroI*::saturating_neg
NonZeroI*::wrapping_neg
Neg for NonZeroI*
Neg for &NonZeroI*
<[T; N]>From for (T...)
<(T...)>From for [T; N]
windows::io::AsHandle for Box<T>
windows::io::AsHandle for Rc<T>
windows::io::AsHandle for Arc<T>
windows::io::AsSocket for Box<T>
windows::io::AsSocket for Rc<T>
windows::io::AsSocket for Arc<T>
The sign "const," which determines the possibility of using in any context instead of constants, is used in functions:
<*const T>::read
<*const T>::read_unaligned
<*mut T>::read
<*mut T>::read_unaligned
ptr::read
ptr::read_unaligned
<[T]>::split_at

  • In the Cargo package manager, it is allowed to specify named debuginfo options in the Cargo.toml file. The workspace_default_members option has been added to the metadata. When executing the "cargo new" and "cargo init" commands, automatic inheritance of workspace fields is provided.
  • The second level of support for the target loongarch64-unknown-linux-gnu platform has been implemented. The second level of support implies an assembly guarantee.
  • The third level of support for the x86_64h-apple-darwin platform has been implemented. The third level implies basic support, but without automated testing, publication of official assemblies and verification of the possibility of building code[3].

Rust 1.68

On March 10, 2023, it became known that the release of the general-purpose programming language Rust 1.68, founded by the Mozilla project, but now developed under the auspices of the independent non-profit organization Rust Foundation, was published. The language is focused on working securely with memory and provides tools to achieve parallelism in job execution, while avoiding the use of garbage collector and runtime (runtime reduces to basic initialization and maintenance of the standard library).

Rust 1.68

As reported, the methods of working with memory in Rust save the developer from errors when manipulating pointers and protect against problems arising from low-level work with memory, such as accessing the memory area after it is freed, exchanging zero pointers, going beyond the buffer boundaries, etc. To distribute libraries, ensure assembly and manage project dependencies, the Cargo package manager is developing. A repository is supported to host libraries crates.io.

Secure memory operation is provided in Rust during compilation through link checking, object ownership tracking, accounting for the lifetime of objects (scope) and assessing the correctness of memory access during code execution. Rust also provides tools for protecting against integer overflows, requires mandatory initialization of variable values ​ ​ before use, better handles errors in the standard library, applies the concept of immutable references and default variables, and offers strong static typing to minimize logical errors.

Major changes:

  • The Cargo package manager and repository crates.io stabilized support for the Sparse protocol, which determines how to work with the index, which reflects the available versions of all packages existing in the repository. The updated protocol allows you to optimize the speed of work with crates.io and solve problems with scaling with a further increase in the number of packages in the repository.
  • To reduce delays arising from loading the full index, Sparse, instead of accessing the index using Git, uses direct loading for HTTPS only the necessary index, covering data the dependencies of a particular project. A service is used to return index data index.crates.io. By default, they plan to use the protocol in the Rust 1.70 branch, and before that, to enable it, you can set the environment variable "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" or add the parameter 'protocol = "sparse" to the "registries.crates-io" section of the.cargo/config.toml file.
  • Added a macro "pin!," Which allows you to create a Pin structure<&mut T> from the expression "T" with local fixing of its state (unlike Box:: pin does not allocate memory in the heap, but binds at the stack level).
  • The default memory allocation error handler is proposed, which is used when using the standard alloc packet. Applications in which only alloc is enabled (without std) in case of memory allocation failures will now call the "panic!" HandLer, which, if desired, can be intercepted using "#. panic_handler" Programs using the std library, as before, will display error information in stderr and crash.
  • The following portion of APIs has been transferred to the stable category, including stabilized methods and implementations of types:
    • {core,std}::pin::pin!

  • <bool>* impl From for {f32,f64}

    • std::path::MAIN_SEPARATOR_STR
    • impl DerefMut for PathBuf

  • The characteristic "const," which determines the possibility of using in any context instead of constants, is applied in the VecDeque:: new function.
  • The platform Android now requires at least NDK r25 (API 19), i.e. the minimum supported version of Android has been upgraded to 4.4 (KitKat).
  • The third level of support for the Sony PlayStation Vita platform (armv7-sony-vita-newlibeabihf) has been implemented. The third level implies basic support, but without automated testing, publication of official assemblies and verification of the possibility of building code[4].

Rust 1.67

On January 26, 2023, it became known that the release of the general-purpose programming language Rust 1.67, founded by the Mozilla project, but now developed under the auspices of the independent non-profit organization Rust Foundation, was published. The language is focused on working securely with memory and provides tools to achieve parallelism in job execution, while avoiding the use of garbage collector and runtime (runtime reduces to basic initialization and maintenance of the standard library).

Rust 1.67. Illustration: i.ytimg.com.

As reported, the methods of working with memory in Rust save the developer from errors when manipulating pointers and protect against problems arising from low-level work with memory, such as accessing the memory area after it is freed, exchanging zero pointers, going beyond the buffer boundaries, etc. To distribute libraries, ensure assembly and manage project dependencies, the Cargo package manager is developing. A repository is supported to host libraries crates.io.

Secure memory operation is provided in Rust during compilation through link checking, object ownership tracking, accounting for the lifetime of objects (scope) and assessing the correctness of memory access during code execution. Rust also provides tools for protecting against integer overflows, requires mandatory initialization of variable values ​ ​ before use, better handles errors in the standard library, applies the concept of immutable references and default variables, and offers static typing to minimize logical errors.

Major changes:

  • For async functions with Future:: Output, the ability to specify annotations "# [must_use]" is implemented, including the output of a warning if the return value is ignored, which helps to identify errors caused by the assumption that the function will change values ​ ​ rather than return a new value.
  • The implementation of std:: sync:: mpsc (multi-producer single-consumer) FIFO queues has been updated, which has been transferred to use the crossbeam-channel module while maintaining the previous API. This implementation is distinguished by solving a number of problems, more optimal performance and optimization of code maintenance.
  • A portion of APIs has been transferred to the category of stable ones, including stabilized methods and implementations of types.
  • The sign "const," which determines the possibility of using in any context instead of constants, is used in functions:
    • char::from_u32
    • char::from_digit
    • char::to_digit
    • core::char::from_u32
    • core::char::from_digit

  • The third level of support has been implemented for using Rust in the Linux kernel (linuxkernel), as well as for Sony PlayStation 1 (mipsel-sony-psx), PowerPC with AIX (powerpc64-ibm-aix), QNX Neutrino RTOS (aarch64-unknown-nto-qnx710, x86_64-pc-nto-qnx710). The third level implies basic support, but without automated testing, publishing official assemblies and checking the possibility of building code.

Additionally, ARM can note the publication of patches that allow Rust to be used to develop Linux kernel drivers and modules for architecture-based systems AArch64[5].

2022

Rust 1.63

On August 11, 2022, it became known that the release of the general-purpose programming language Rust 1.63, founded by the Mozilla project, but now developed under the auspices of the independent non-profit organization Rust Foundation, was published. The language focuses on working securely with memory and provides the means to achieve proper parallelism of job execution, while avoiding the use of garbage collector and runtime (runtime reduces to basic initialization and maintenance of the standard library).

Rust 1.63. Photo: wallup.net.

As reported, the methods of working with memory in Rust save the developer from errors when manipulating pointers and protect against problems arising from low-level work with memory, such as accessing the memory area after it is freed, exchanging zero pointers, going beyond the buffer boundaries, etc. To distribute libraries, ensure assembly and manage project dependencies, the Cargo package manager is developing. A repository is supported to host libraries crates.io.

Secure memory operation is provided in Rust during compilation through link checking, object ownership tracking, accounting for the lifetime of objects (scope) and assessing the correctness of memory access during code execution. Rust also provides tools for protecting against integer overflows, requires mandatory initialization of variable values ​ ​ before use, better handles errors in the standard library, applies the concept of immutable references and default variables, and offers strong static typing to minimize logical errors.

Major changes:

  • Added std:: thread:: scope API to create threads in Scoped threads. Unlike previously available threads, this API std:: thread:: scope allows the transfer of borrowed (boring) non-static data, while threads created using the classic API std:: thread:: spawn should have owned all passed arguments and could not receive borrowed variables. API std:: thread:: scope ensures that any generated threads are completed before the data is returned, providing the proper level of security for the borrowing mechanism.
  • Additional binding types for file descriptors are proposed - BorrowedFd and OwnedFd, which provide borrowing and ownership. Types are marked with "# [repr (transparent)]," which allows them to be directly used in external C-bindings, taking into account ownership.
  • It is possible to call Condvar:: new, Mutex:: new and RwLock:: new in the context of constants to create global static values ​ ​ Mutex, RwLock and Condvar without applying packages of type lazy_static.
  • For functions of type fn foo <T>(value: T, f: impl Copy), the syntax of the form "foo:<u32>: (3, 3)" is allowed, <u32>explicitly specifying the type of generic.
  • The transition to using the NLL (Non-Lexical Lifetimes) technique to identify problems with borrowing variables has been completed. NLL carries out accounting at the level of a set of pointers in the thread graph, which allows you to optimize the quality of the borrow checker and allow some types of correct code to be executed, the use of which previously led to an error. Support for the old mechanism that used lexical-level time-of-life binding is now completely removed from rustc, and the use of another NLL is ubiquitous.
  • The next portion of the API has been transferred to the stable category, including stabilized methods and implementations of types:
    • array::from_fn
    • Box::into_pin
    • BinaryHeap::try_reserve
    • BinaryHeap::try_reserve_exact
    • OsString::try_reserve
    • OsString::try_reserve_exact
    • PathBuf::try_reserve
    • PathBuf::try_reserve_exact
    • Path::try_exists
    • Ref::filter_map
    • RefMut::filter_map

  • <[T]>* NonNull::::len

    • ToOwned::clone_into
    • Ipv6Addr::to_ipv4_mapped
    • unix::io::AsFd
    • unix::io::BorrowedFd<'fd>
    • unix::io::OwnedFd
    • windows::io::AsHandle
    • windows::io::BorrowedHandle<'handle>
    • windows::io::OwnedHandle
    • windows::io::HandleOrInvalid
    • windows::io::HandleOrNull
    • windows::io::InvalidHandleError
    • windows::io::NullHandleError
    • windows::io::AsSocket
    • windows::io::BorrowedSocket<'handle>
    • windows::io::OwnedSocket
    • thread::scope
    • thread::Scope
    • thread::ScopedJoinHandle

  • The sign "const," which determines the possibility of using in any context instead of constants, is used in functions:

    • array::from_ref
    • slice::from_ref
    • intrinsics::copy
    • intrinsics::copy_nonoverlapping

  • <*const T>* ::copy_to
  • <*const T>* ::copy_to_nonoverlapping
  • <*mut T>* ::copy_to
  • <*mut T>* ::copy_to_nonoverlapping
  • <*mut T>* ::copy_from
  • <*mut T>* ::copy_from_nonoverlapping

    • str::from_utf8
    • Utf8Error::error_len
    • Utf8Error::valid_up_to
    • Condvar::new
    • Mutex::new
    • RwLock::new

  • Additionally, we can note the initiative to use the Rust language to write a kernel-level Linux driver for the Apple AGX GPU used in Apple M1 and M2 chips. It is noted that the Apple AGX GPU performs firmware and uses fairly complex shared data structures. The implementation of firmware and structure management at Rust would optimize development and achieve higher security. Two development options are considered: writing the C part as the basis, but using components on Rust to interact with firmware and manage data structures in shared memory, or writing the entire driver on Rust and creating Rust binding for the DRM subsystem.

Rust 1.62

On June 30, 2022, it became known that the release programming of the general purpose language Rust 1.62, based project Mozilla on July 2022, was published under the auspices of the independent non-profit organization Rust Foundation. The language is focused on working securely with memory and provides tools for achieving high parallelism in job execution, while avoiding the use of garbage collector and runtime (runtime reduces to basic initialization and maintenance of the standard library).

The methods of working with memory in Rust save the developer from errors when manipulating pointers and protect against problems arising from low-level work with memory, such as accessing the memory area after it is freed, exchanging zero pointers, going beyond the buffer boundaries, etc. To distribute libraries, ensure assembly and project dependency management, the Cargo batch manager is developing. A repository is supported to host libraries crates.io.

Secure memory operation is provided in Rust during compilation through link checking, object ownership tracking, accounting for the lifetime of objects (scope) and assessing the correctness of memory access during code execution. Rust also provides tools for protecting against integer overflows, requires mandatory initialization of variable values ​ ​ before use, better handles errors in the standard library, applies the concept of immutable references and default variables, and offers strong static typing to minimize logical errors.

Major changes:

  • The "cargo" batch manager offers the "add" command, which allows you to add new dependencies to the Cargo.toml manifest or change existing dependencies from the command line. The command also allows you to specify individual properties (feature) and versions, for example:
    cargo add serde --features derive
    cargo add nom @ 5
  • Added the ability to use "# [derive (Default)]" with enum, in which the default option is defined using the "# [default]" attribute.

    <T>



    #[derive(Default)] enum Maybe { #[default] Nothing, Something(T), }
  • The Linux platform uses a more compact and faster implementation of the Mutex synchronization mechanism, based on the use of fiutexes provided by the Linux kernel. Unlike the previously used implementation based on the pthreads library, the Mutex state in the new version consumes only 5 bytes instead of 40. Similarly, the Condvar and RwLock blocking mechanisms have been transferred to futex.
  • The second level of support for the target x86_64-unknown-none platform is implemented, designed to form executable files that can work without an operating system. For example, the specified target platform can be used when writing kernel components. The second level of support implies an assembly guarantee.

The third level of support has been implemented for the aarch64-pc-windows-gnullvm and x86_64-pc-windows-gnullvm platforms. The third level implies basic support, but without automated testing, publishing official assemblies and checking the possibility of building code.

  • The added API portion has been converted to stable, including stabilized methods and implementations of types:
    bool::then_some
    f32::total_cmp
    f64::total_cmp
    Stdin:: lines
    windows::CommandExt::raw_arg impl
    <T: Default> default value for AssertUnwindSafe From<T>
    > <Rc<str>for Rc<[u8]>
    From > <Arc<str>for Arc<[u8]>
    FusedIterator for EncodeWide Release[6]

Rust 1.60

On April 7, 2022, it became known that the release of the general-purpose programming language Rust 1.60, founded by the Mozilla project, but now developed under the auspices of the independent non-profit organization Rust Foundation, was published. The language is focused on working securely with memory and provides tools to achieve parallelism in job execution, while avoiding the use of garbage collector and runtime (runtime reduces to basic initialization and maintenance of the standard library).

Rust 1.60

As reported, the methods of working with memory in Rust save the developer from errors when manipulating pointers and protect against problems arising from low-level work with memory, such as accessing the memory area after it is freed, exchanging zero pointers, going beyond the buffer boundaries, etc. To distribute libraries, ensure assembly and manage project dependencies, the Cargo package manager is developing. A repository is supported to host libraries crates.io.

Secure memory operation is provided in Rust during compilation through link checking, object ownership tracking, accounting for the lifetime of objects (scope) and assessing the correctness of memory access during code execution. Rust also provides tools for protecting against integer overflows, requires mandatory initialization of variable values ​ ​ before use, better handles errors in the standard library, applies the concept of immutable references and default variables, and offers strong static typing to minimize logical errors.

Key features:

  • The rustc compiler stabilizes the LLVM-based system for generating coverage data used to assess code coverage during testing. To enable coverage data during assembly, you must use the "-Cinstrument-coverage" flag, for example, by starting the assembly with the command "RUSTFLAGS =" -C instrument-coverage "cargo build." After running the executable file assembled in this way, the default.profraw file will be saved in the current directory, for processing which you can use the llvm-profdata utility from the llvm-tools-preview component. The output processed by the llvm-profdata utility can then be passed to the llvm-cov program to generate an annotated code coverage report. Information on binding to source texts is taken from the executable file under investigation, which includes the necessary data on the association of coverage counters with the code.
  • The cargo package manager stabilizes support for the "--timings" flag, which includes the formation of a detailed report on the progress of the assembly and the time of each step. The report may be useful for optimizing the performance of the assembly process.
  • In the cargo package manager, an additional syntax is proposed for the conditional compilation mechanism and the selection of optional dependencies, which is configured in the Cargo.toml file through the listing of named properties in the features section and activated through the inclusion of properties during package assembly using the --features flag. This version adds support for dependencies in individual namespaces and weak dependencies.
  • In the first case, it is possible to use elements with the prefix "dep:" inside the "features" section for explicit binding to an optional dependency without implicitly representing this dependency as a feature. In the second case, support for marking with the "?" ("package-name ?/feature-name") optional dependencies that should only be enabled if some other property includes this optional dependency.
  • Support for incremental compilation, disabled in the previous release, was returned. An error in the compiler that caused the feature to be disabled has been resolved.
  • Some problems have been solved with the provision of a monotonous time calculation guarantee for Instant timers, which takes into account the time spent by the system in sleep mode. Previously, the OS API was used to operate the timer if possible, which did not take into account problem situations that violate the monotony of time, such as hardware problems, virtualization or errors in the operating system.
  • A portion of APIs has been transferred to the category of stable ones, including stabilized methods and implementations of types.
  • The third level of support has been implemented for the mips64-openwrt-linux-musl and armv7-unknown-linux-uclibceabi (softfloat) platforms. The third level implies basic support, but without automated testing, publishing official assemblies and checking the possibility of building code.
  • The compiler is translated into LLVM 14.

Additionally, it can be noted:

  • Added support for bootstrapping the rustc compiler using the rustc_codegen_gcc backend, which allows you to use the libgccjit library from the GCC project as a code generator in rustc, which allows you to provide support for architectures and optimizations available in GCC in rustc. Compiler promotion refers to the possibility of using a GCC-based code generator in rustc to build the rustc compiler itself. On the practical side, this feature allows you to collect rust programs for architectures that are not previously supported in rustc.
  • The uutils coreutils 0.0.13 toolkit is available, which is developing an analogue of the GNU Coreutils package, rewritten in Rust. Coreutils includes more than a hundred utilities, including sort, cat, chmod, chown, chroot, cp, date, dd, echo, hostname, id, ln and ls. The goal of the project is to create a cross-platform alternative implementation of Coreutils, capable of working, among other things, on Windows, Redox and Fuchsia platforms, as well as distribution under the permissive MIT license, instead of the GPL copyleft license.

This version optimizes the implementation of many utilities, including the compatibility of the cp, dd, df, split and tr utilities with analogues from the GNU project. Online documentation provided. To parse the command line arguments, the clap parser was used, which made it possible to optimize the output for the "--help" flag and add support for abbreviations of long commands (for example, you can specify "ls --col" instead of "ls --color")[7].

2021: Google lists Rust among major Android development languages

In early April 2021, Google announced the inclusion of the Rust programming language among the languages ​ ​ that are allowed for Android development. Rust support is implemented as part of a project to strengthen security, promote secure programming methods and improve the efficiency of detecting memory problems in Android.

According to Google, despite the fact that the development team invests a lot of efforts and resources in detecting, fixing and mitigating the consequences of this class of bugs, still about 70% of all dangerous vulnerabilities identified in Android are still caused by errors when working with the operating system. Using the Rust language, which is focused on secure work with memory and provides automatic memory management, will reduce the risk of vulnerabilities caused by errors in interaction with memory.

Google has included Rust in the list of languages ​ ​ for Android development

Secure interaction with memory is provided in Rust by compiling through link checking, tracking object ownership and recording the lifetime of objects, through assessing the correctness of memory access during code execution. This programming language also provides functionality to protect against integer overflows, Rust requires mandatory initialization of variable values ​ ​ before application, and also provides better capabilities for managing errors in the standard library. Rust uses the concept of invariability of links and default variables, and also supports effective static typing to minimize logical errors.

Google noted that there will be no overwriting of existing C/C + + code on Rust, the language will be used to write new code. This is due to the fact that most errors are found in new or recently modified code - about 50% of detected memory errors in Android are determined in code written less than a year[8]

Programming languages

Notes