This update for rust, rust-cbindgen fixes the following issues:
rust was updated for use by Firefox 76ESR.
Update to version 1.43.1
cargo package --list not working with unpublished dependencies.Update to version 1.43.0
Language:
Fixed using binary operations with &{number} (e.g. &1.0)
not having the type inferred correctly.
#[cfg()] can now be used on if
expressions.Syntax only changes:
type Foo: Ord syntactically.self in all fn contexts.fn syntax + cleanup item parsing.item macro fragments can be interpolated into traits,
impls, and extern blocks.
For example, you may now write:
macro_rules! mac_trait {
($i:item) => {
trait T { $i }
}
}
mac_trait! {
fn foo() {}
}
Compiler
You can now pass multiple lint flags to rustc to override the previous flags.
For example; rustc -D unused -A unused-variables denies
everything in the unused lint group except unused-variables
which is explicitly allowed. However, passing
rustc -A unused-variables -D unused denies everything in
the unused lint group including unused-variables since
the allow flag is specified before the deny flag (and therefore
overridden).
windows-gnu.Libraries:
Arc<[T; N]>, Box<[T; N]>, and Rc<[T; N]>, now implement
TryFrom<Arc<[T]>>,TryFrom<Box<[T]>>, and TryFrom<Rc<[T]>>
respectively.
Note These conversions are only available when N is
0..=32.u32::MAX or f32::NAN with no imports.u8::is_ascii is now const.String now implements AsMut<str>.primitive module to std and core.
This module reexports Rust's primitive types. This is mainly
useful in macros where you want avoid these types being shadowed.HashMap and HashSet.string::FromUtf8Error now implements Clone + Eq.
Stabilized APIs
Once::is_completed
f32::LOG10_2f32::LOG2_10f64::LOG10_2f64::LOG2_10iter::once_with
Cargo
[profile]s in your .cargo/config,
or through your environment.CARGO_BIN_EXE_<name> pointing to a
binary's executable path when running integration tests or
benchmarks.
<name> is the name of your binary as-is e.g. If you wanted
the executable path for a binary named my-programyou would
use env!('CARGO_BIN_EXE_my-program').Misc
const_err lint were deemed unrelated
to const evaluation, and have been moved to the
unconditional_panic and arithmetic_overflow lints.Compatibility Notes
assert! macro is now a hard
error. This has been a warning since 1.36.0.Self not having the correctly inferred type. This
incorrectly led to some instances being accepted, and now
correctly emits a hard error.Update to version 1.42.0:
Language
Compiler
Libraries
Stabilized APIs
Cargo
Compatibility Notes
Update to version 1.41.1:
Copy implsLayout::repeatUpdate to version 1.41.0:
Language
impl<T> From<Foo> for Vec<T> {}.self position. E.g. you can
now write fn foo(self: Box<Box<Self>>) {}. Previously only Self, &Self,
&mut Self, Arc<Self>, Rc<Self>, and Box<Self> were allowed.format_args macro.
Previously identifiers starting with an underscore were not allowed.pub) are now syntactically allowed on trait items and
enum variants. These are still rejected semantically, but
can be seen and parsed by procedural macros and conditional compilation.Compiler
'labels.i686-unknown-dragonfly target.riscv64gc-unknown-linux-gnu target.@path syntax
to rustc. Note that the format differs somewhat from what is
found in other tooling; please see the documentation for
more information.--extern flag without a path, indicating that it is
available from the search path or specified with an -L flag.Refer to Rust's [platform support page][forge-platform-support] for more information on Rust's tiered platform support.
Libraries
core::panic module is now stable. It was already stable
through std.NonZero* numerics now implement From<NonZero*> if it's a smaller integer
width. E.g. NonZeroU16 now implements From<NonZeroU8>.MaybeUninit<T> now implements fmt::Debug.Stabilized APIs
Result::map_orResult::map_or_elsestd::rc::Weak::weak_countstd::rc::Weak::strong_countstd::sync::Weak::weak_countstd::sync::Weak::strong_countCargo
cargo-install will now reinstall the package if it detects that it is out
of date.[profile.dev.package.image] opt-level = 2 sets the image crate's
optimisation level to 2 for debug builds. You can also use
[profile.<profile>.build-override] to override build scripts and
their dependencies.Misc
edition in documentation code blocks to compile the block
for that edition. E.g. edition2018 tells rustdoc that the code sample
should be compiled the 2018 edition of Rust.--theme, and check the
current theme with --check-theme.#[cfg(doc)] to compile an item when building documentation.Compatibility Notes
Bump version of libssh2 for SLE15; we now need a version with libssh2userauthpublickey_frommemory(), which appeared in libssh2 1.6.0.
Update to version 1.40.0
Language
structs and tuple enum variant's constructors in
const contexts. e.g.
pub struct Point(i32, i32);
const ORIGIN: Point = {
let constructor = Point;
constructor(0, 0)
};structs, enums, and enum variants with the #[non_exhaustive] attribute to
indicate that there may be variants or fields added in the future.
For example this requires adding a wild-card branch (_ => {}) to any match
statements on a non-exhaustive enum.extern blocks and in
type positions. e.g. type Generated = macro!();macro_rules! items, so you can now have your macros generate macros.meta pattern matcher in macro_rules! now correctly matches the modern
attribute syntax. For example (#[$m:meta]) now matches #[attr],
#[attr{tokens}], #[attr[tokens]], and #[attr(tokens)].Compiler
thumbv7neon-unknown-linux-musleabihf target.aarch64-unknown-none-softfloat target.mips64-unknown-linux-muslabi64, and
mips64el-unknown-linux-muslabi64 targets.Libraries
is_power_of_two method on unsigned numeric types is now a const function.Stabilized APIs
Cargo
--all-features) passed to a virtual workspace will
now produce an error. Previously these flags were ignored.dev-dependencies without including
a version.Misc
#[cfg(doctest)] attribute to include an item only
when running documentation tests with rustdoc.Compatibility Notes
include! macro will now warn if it failed to include the
entire file. The include! macro unintentionally only includes the
first expression in a file, and this can be unintuitive. This will become
either a hard error in a future release, or the behavior may be fixed to include all expressions as expected.#[inline] on function prototypes and consts now emits a warning under
unused_attribute lint. Using #[inline] anywhere else inside traits
or extern blocks now correctly emits a hard error.Update to version 1.39.0
Language
Compiler
For more details: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1390-2019-11-07
Switch to bundled version of libgit2 for now. libgit2-sys seems to expect using the bundled variant, which just seems to point to a snapshot of the master branch and doesn't match any released libgit2 (bsc#1154817). See: https://github.com/rust-lang/rust/issues/63476 and https://github.com/rust-lang/git2-rs/issues/458 for details.
Update to version 1.38.0
Language
#[global_allocator] attribute can now be used in submodules.#[deprecated] attribute can now be used on macros.Compiler
rustc. This will
improve compilation times in some cases.Libraries
ascii::EscapeDefault now implements Clone and Display.Clone, Debug, Hash) are now
available at the same path as the trait. (e.g. The Clone derive macro
is available at std::clone::Clone). This also makes all built-in macros
available in std/core root. e.g. std::include_bytes!.str::Chars now implements Debug.slice::{concat, connect, join} now accepts &[T] in addition to &T.*const T and *mut T now implement marker::Unpin.Arc<[T]> and Rc<[T]> now implement FromIterator<T>.div_euclid,
rem_euclid) to all numeric primitives. Additionally checked,
overflowing, and wrapping versions are available for all
integer primitives.thread::AccessError now implements Clone, Copy, Eq, Error, and
PartialEq.iter::{StepBy, Peekable, Take} now implement DoubleEndedIterator.Stabilized APIs
<*const T>::cast<*mut T>::castDuration::as_secs_f32Duration::as_secs_f64Duration::div_f32Duration::div_f64Duration::from_secs_f32Duration::from_secs_f64Duration::mul_f32Duration::mul_f64any::type_nameCargo
cargo.--features option multiple times to enable
multiple features.Misc
rustc will now warn about some incorrect uses of
mem::{uninitialized, zeroed} that are known to cause undefined behaviour.Update to version 1.37.0
Language
cfg and cfg_attr attributes on
generic parameters.type MyOption = Option<u8>;
fn increment_or_zero(x: MyOption) -> u8 {
match x {
MyOption::Some(y) => y + 1,
MyOption::None => 0,
}
}
_ as an identifier for consts. e.g. You can write
const _: u32 = 5;.#[repr(align(X)] on enums.? Kleene macro operator is now available in the
2015 edition.Compiler
-C profile-generate
and -C profile-use flags. For more information on how to use profile
guided optimization, please refer to the rustc book.rust-lldb wrapper script should now work again.Libraries
mem::MaybeUninit<T> is now ABI-compatible with T.Stabilized APIs
Cargo
default-run='foo' in [package] to specify the
default executable to use for cargo run.Compatibility Notes
... for inclusive range patterns will now warn by default.
Please transition your code to using the ..= syntax for inclusive
ranges instead.Using a trait object without the dyn will now warn by default.
Please transition your code to use dyn Trait for trait objects instead.
Crab(String),
Lobster(String),
Person(String),
let state = Creature::Crab('Ferris');
if let Creature::Crab(name) | Creature::Person(name) = state {
println!('This creature's name is: {}', name);
}
unsafe { foo() }
pub fn new(x: i32, y: i32) -> Self {
Self(x, y)
}
pub fn is_origin(&self) -> bool {
match self {
Self(0, 0) => true,
_ => false,
}
}
Self: PartialOrd<Self> // can write Self instead of List<T>
Nil,
Cons(T, Box<Self>) // likewise here
fn test(&self) { println!('one'); } //~ ERROR duplicate definitions with name test
fn test(&self) { println!('two'); }
#[derive], aka 'macros 1.1', are
stable. This allows popular code-generating crates like Serde and Diesel to
work ergonomically. [RFC 1681].legacy_imports] lint since 1.14, with no known regressions.macro_rules, path fragments can now be parsed as type parameter
bounds][38279]?Sized can be used in where clauses][37791]#![type_size_limit] crate attribute, similarly to
the #![recursion_limit] attribute][37789]--test flag works with procedural macro crates][38107]extern 'aapcs' fn ABI][37814]-C no-stack-check flag is deprecated][37636]. It does nothing.format! expander recognizes incorrect printf and shell-style
formatting directives and suggests the correct format][37613].mk_ty calls in Ty::super_fold_with][37705]mk_ty calls in Ty::super_fold_with][37979]UnificationTable::probe][37848]scope_auxiliary to cut RSS by 10%][37764]HirVec<P<T>> to HirVec<T> in hir::Expr][37642]rust-cbindgen is shipped in version 0.14.1.
{
"binaries": [
{
"rust-doc": "1.43.1-lp152.3.5.1",
"rls": "1.43.1-lp152.3.5.1",
"rust-std-static": "1.43.1-lp152.3.5.1",
"rust": "1.43.1-lp152.3.5.1",
"rustfmt": "1.43.1-lp152.3.5.1",
"clippy": "1.43.1-lp152.3.5.1",
"cargo": "1.43.1-lp152.3.5.1",
"rust-src": "1.43.1-lp152.3.5.1",
"rust-analysis": "1.43.1-lp152.3.5.1",
"cargo-doc": "1.43.1-lp152.3.5.1",
"rust-cbindgen": "0.14.1-lp152.2.4.1",
"rust-gdb": "1.43.1-lp152.3.5.1"
}
]
}
{
"binaries": [
{
"rust-doc": "1.43.1-lp152.3.5.1",
"rls": "1.43.1-lp152.3.5.1",
"rust-std-static": "1.43.1-lp152.3.5.1",
"rust": "1.43.1-lp152.3.5.1",
"rustfmt": "1.43.1-lp152.3.5.1",
"clippy": "1.43.1-lp152.3.5.1",
"cargo": "1.43.1-lp152.3.5.1",
"rust-src": "1.43.1-lp152.3.5.1",
"rust-analysis": "1.43.1-lp152.3.5.1",
"cargo-doc": "1.43.1-lp152.3.5.1",
"rust-cbindgen": "0.14.1-lp152.2.4.1",
"rust-gdb": "1.43.1-lp152.3.5.1"
}
]
}