Ferrocene 26.11.0¶
New features¶
Ferrocene is now certified for railway usage, under the EN 50716 standard
The certified library subset has been expanded to include a subset of
alloc, allowing the use of dynamic memory allocation in certified applications. Users must bring their own certified allocator, and only the basicalloc,reallocanddeallocfunctions are supported in this release.The
[ferrocene::prevalidated]attribute can now be applied to modules, traits, andimplblocks. This marks all contained functions as validated, avoiding the need to annotate each function individually.Added a new
[ferrocene::requires_validation]attribute, which can be applied to trait methods to require all implementations to be validated.Added 2 functions to the certified subset:
slice::as_chunks_mutslice::as_chunks_unchecked_mut
Two new targets are now supported and qualified for safety critical use:
Armv8-M Mainline bare-metal (soft-float) (
thumbv8m.main-none-eabi)Armv8-M Mainline bare-metal (hard-float) (
thumbv8m.main-none-eabihf)
Changes¶
Documentation now includes docs for the crates which make up
rustcitself, including documentation on theferrocene::prevalidatedlint (asrustc_lint::ferrocene).Documentation for the certified subset of
corehas been folded into the standard library documentation. Now Ferrocene provides a single, complete copy of the Rust standard library documentation, with certified functions labelled inline.Atomic::<T>::fetch_updatehas been renamed toAtomic::<T>::try_updateby upstream Rust, with the old name being deprecated as of Rust 1.99.0. Accordingly,fetch_updatehas been removed from the certified subset. There is no semantic change, so users can simply replace any calls tofetch_updatewithtry_update.
Bug fixes¶
Fixed a diagnostics issue where calls to private, non-generic functions within libraries were not checked by the early (pre-monomorphization) pass of the
[ferrocene::unvalidated]lint while compiling the library itself.This was not a safety issue; any diagnostics were simply delayed until compiling an application which (transitively) depends on the library in question, at which point the calls would be checked by the late (post-monomorphization) lint pass.
Raise errors in two situations which could potentially lead to a non-qualified compiler configuration:
Attempting to use any code generation backend other than LLVM; only the LLVM backend is qualified for use with Ferrocene
Using an external linker which does not support the
-fuse-ld=...flag; previously this flag was silently dropped if the linker did not support it.
Fixed known problems¶
A list of fixed known problems in this release can be found on the Ferrocene 26.11 Known Problems page.
Rust changes¶
This release includes the following changes introduced by the upstream Rust project. Note that this changelog is maintained by upstream. The target support changes described here describe Rust’s support levels, and have no correlation to the targets and platforms supported by Ferrocene.
Rust 1.98.0¶
Language¶
Allow shortening lifetime of
&mutwhen unsize-coercing, even in an invariant position. For example, you can now coerce aCell<&'long mut i32>to aCell<&'short mut dyn Send>. Such shortenings were already previously allowed when coercing a&mutto a&, or coercing a&to a&.-
The lints currently specifically targets
coreruntime symbols likememcmp,memset,strlen, … and is planned to be expanded in the next few releases.
Add warn-by-default
c_void_returnslint to checkcore::ffi::c_voidas a return type
Platform Support¶
Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
Libraries¶
Document panic in
RangeInclusive::from(legacy::RangeInclusive)The
derivemacro is available at{core,std}::derive. This was previously unintentionally stabilized in 1.96, but is now explicitly accepted as a stabilized API.Please note that the MSRV for
{core,std}::derivewill be 1.96, and not 1.98.
Stabilized APIs¶
Compatibility Notes¶
Switch the destructors implementation for thread locals on Windows to use Fiber Local Storage (FLS)
Convert some cases of the
ambiguous_glob_importslint into a hard errorWhere-bounds of the form
Type = TypeandType == Typeare no longer syntactically allowedFix that in some attributes, arguments were not properly rejected
Correctly check whether types have equal size in
transmute()when somereprattributes are involved.Implement fast path for
derive(PartialOrd)when derivingOrdThis can break crates in practice where a type’s PartialOrd and Ord impls were inconsistent with each other.Closed a hole in the pattern matching structural equality check, preventing cases where a match of a constant would be allowed, despite disagreeing with a manually written
PartialEqimplementation, when aderive(PartialEq)implementation for that type also exists.On Emscripten the WASM exception handling ABI is now unconditionally used The
-Zemscripten-wasm-eh=falseflag to switch back to JS exceptions has been removed.The UNSAFE_CODE lint is now consistently emitted for all unsafe attributes
Solaris: remove
File::lockimplementation, it has the wrong semantics (return “unsupported” instead)rustfmt now discovers module files that are defined in
cfg_select!This may cause more code to be formatted which was previously ignored.
Rust 1.98.1¶
Rust 1.99.0¶
Language¶
Extend
unconditional_paniclint to function calls that panic when the chunks/windows size is zeroTrait methods are now resolved on an adjusted never type (producing a FCW)
Stabilize
#[my_macro] mod foo;. This allows outlined modules (mod foo;) anywhere in the body of a custom attribute or derive macro.Fix the
overflowing_literalslint with repeated negation. For instance, it will now no longer lint on--128_i8, which is already detected by thearithmetic_overflowlint.Enable
unreachable_cfg_select_predicateslint as part ofunusedlint groupStabilize passing 128-bit integers via vector registers with
asm!on x86We now guarantee that the contents of an
UnsafeCellcan be accessed without going throughgetWarn if an invalid
docattribute is used on a macro invocation
Compiler¶
Convert
-Ctarget-cpuinto a target-modifier for AVR, AMDGCN and NVPTXEnable
static_position_independent_executableson all gnu targetsWhen providing a suggestion about a missing method, rustc now prefers an exactly matching name from a doc alias attribute over a similarity search from other method names. If your new users sometimes expect a method under a different name, adding a doc alias will now help them find it via rustc suggestions, in addition to helping them find it via rustdoc search: When suggesting method names, prefer exact doc aliases over similar names
Platform Support¶
Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
Libraries¶
Iteration on
RangeInclusive(a..=branges) is now optimized better in some circumstances. As a side effect of this, the behavior ofRangeInclusivevalues that has already been exhausted (as an iterator) has changed. For example, the return values ofstart()andend()on such ranges may return different values, and using such ranges as slice indexes may have different behavior. These behaviors were not guaranteed to be stable, so these changes are considered to not be breaking changes.
Stabilized APIs¶
Cargo¶
Add a new built-in profile
debug. This is a preparation for transitioning thedevprofile away from debugging to give a saner default for faster development iterations. Currently there is no difference betweendevanddebugprofiles. docs #17214Workspace members on edition 2024 or later can now override an inherited workspace dependency’s
default-featuresfield. For example,serde = { workspace = true, default-features = false }now turns off default features even when the workspace definition enables them. On earlier editions,default-features = falseis ignored with a warning. (RFC 3945) #17126
See also the full Cargo changelog
Rustdoc¶
Compatibility Notes¶
Fully deprecate the legacy integral modules. For example,
std::i32::MAXshould be accessed viai32::MAXinstead.The
Pin::new_uncheckedhas had its safety invariants changed slightlyhermit/fs: Return
unsupported()instead offrom_raw_os_error(22)Fixed a bug where
#[repr(simd)]was accidentally allowed on macro invocations on stable RustAbort const-eval when there are generics in the type of the value being produced
Attributes not applying to anything are now an error in code blocks in doc comments
PowerPC inline ASM: Fix scalar floats being in the wrong vector lane on little endian
Infer anonymous lifetimes in the types of associated consts as
'staticMacros that expand to a semicolon now produce a warning lint (
semicolon_in_expressions_from_non_local_macros) even when the macro comes from another crate. Previously, such warnings only appeared for macros from the same crate, to avoid showing warnings that can’t be fixed locally; however, this masked problems, as integration tests from the crate providing the macro get compiled as a separate crate, so tests often wouldn’t reveal this issue. If you encounter a lint like this, please make sure to report it to the crate providing the macro so they can fix it; don’t just silence it in your own crate.In Cargo, incremental compilation is now disabled by default when running in CI. CI is detected via the
CIenvironment variable. #17220The Rust Reference no longer recommends using a single pattern to match a union alongside another value, such as in a manually-written tagged union. This was because it was found that such code would, in some circumstances, result in the compiler reading the contents of the union before checking if the rest of the scrutinee matches the rest of the pattern. This can cause undefined behavior in code similar to what the reference previously recommended.
Internal Changes¶
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.