Email me

Rust versions / 1.43

Rust release · Apr 23, 2020

Rust 1.43: what's new, what was stabilized

Short answerRust 1.43 was released on Apr 23, 2020: 6 newly stable APIs (Once::is_completed, f32::LOG10_2, f32::LOG2_10, f64::LOG10_2, ...); 2 compatibility notes that can affect existing code. Point release: 1.43.1 (May 7, 2020).

Apr 23, 2020release date
0language stabilizations
6APIs stabilized
-new edition

← Rust 1.42All versionsRust 1.44 →

6 APIs stabilized

Once::is_completed, f32::LOG10_2, f32::LOG2_10, f64::LOG10_2, f64::LOG2_10, iter::once_with

Can it break my build?

The release lists these compatibility notes. Most only affect rare code, but read them before you raise your toolchain in CI:

  • [Having trailing syntax in the assert! macro is now a hard error.][69548] This
  • [Fixed Self not having the correctly inferred type.][69340] This incorrectly

Use it

rustup update stable        # get the newest release
rustup install 1.43          # or exactly this one
rustup override set 1.43     # pin a project to it

To require at least this version from users of your crate, set rust-version = "1.43" under [package] in Cargo.toml. Cargo then refuses to build it on older compilers with a clear message, and with resolver 3 (the default on the 2024 edition, Rust 1.85+) it also prefers dependency versions that support it.

Full release notes

Language

  • [Fixed using binary operations with &{number} (e.g. &1.0) not having the type inferred correctly.][68129]
  • [Attributes such as #[cfg()] can now be used on if expressions.][69201]

**Syntax only changes**

  • [Allow type Foo: Ord syntactically.][69361]
  • [Fuse associated and extern items up to defaultness.][69194]
  • [Syntactically allow self in all fn contexts.][68764]
  • [Merge fn syntax + cleanup item parsing.][68728]
  • [item macro fragments can be interpolated into traits, impls, and extern blocks.][69366] For example, you may now write: ``rust macro_rules! mac_trait { ($i:item) => { trait T { $i } } } mac_trait! { fn foo() {} } ``

These are still rejected *semantically*, so you will likely receive an error but these changes can be seen and parsed by macros and conditional compilation.

Compiler

  • [You can now pass multiple lint flags to rustc to override the previous flags.][67885] 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).
  • [rustc will now prefer your system MinGW libraries over its bundled libraries if they are available on windows-gnu.][67429]
  • [rustc now buffers errors/warnings printed in JSON.][69227]

Libraries

  • [Arc<[T; N]>, Box<[T; N]>, and Rc<[T; N]>, now implement TryFrom<Arc<[T]>>,TryFrom<Box<[T]>>, and TryFrom<Rc<[T]>> respectively.][69538] **Note** These conversions are only available when N is 0..=32.
  • [You can now use associated constants on floats and integers directly, rather than having to import the module.][68952] e.g. You can now write u32::MAX or f32::NAN with no imports.
  • [u8::is_ascii is now const.][68984]
  • [String now implements AsMut<str>.][68742]
  • [Added the primitive module to std and core.][67637] This module reexports Rust's primitive types. This is mainly useful in macros where you want avoid these types being shadowed.
  • [Relaxed some of the trait bounds on HashMap and HashSet.][67642]
  • [string::FromUtf8Error now implements Clone + Eq.][68738]

Stabilized APIs

  • [Once::is_completed]
  • [f32::LOG10_2]
  • [f32::LOG2_10]
  • [f64::LOG10_2]
  • [f64::LOG2_10]
  • [iter::once_with]

Cargo

  • [You can now set config [profile]s in your .cargo/config, or through your environment.][cargo/7823]
  • [Cargo will now set CARGO_BIN_EXE_<name> pointing to a binary's executable path when running integration tests or benchmarks.][cargo/7697] <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

  • [Certain checks in the const_err lint were deemed unrelated to const evaluation][69185], and have been moved to the unconditional_panic and arithmetic_overflow lints.

Compatibility Notes

  • [Having trailing syntax in the assert! macro is now a hard error.][69548] This has been a warning since 1.36.0.
  • Fixed Self not having the correctly inferred type. This incorrectly led to some instances being accepted, and now correctly emits a hard error.

Internal Only

These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.

1.43.1 (May 7, 2020)

Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.

← Rust 1.42All versionsRust 1.44 →

Up next

Next releaseRust 1.44Released Jun 4, 2020.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ