From 0c299bc368e4704ef92ef6a6d6e6f48ac1d8c499 Mon Sep 17 00:00:00 2001 From: Augie Fackler Date: Fri, 3 Apr 2026 07:26:48 -0700 Subject: [PATCH] crubit: bump Rust edition to 2024 for generated Rust sources This was set to 2018 in 2021 without much comment presumably as a way to hedge against edition changes breaking things. I'm not sure if we should hard-code it here, or just let it "float" to the global default edition, so for now I'm just bumping it to 2024 and kicking the can at least a year down the road. PiperOrigin-RevId: 894062743 --- rs_bindings_from_cc/bazel_support/compile_rust.bzl | 2 +- rs_bindings_from_cc/generate_bindings/generate_function.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rs_bindings_from_cc/bazel_support/compile_rust.bzl b/rs_bindings_from_cc/bazel_support/compile_rust.bzl index 47b0ad539..9c4bb300f 100644 --- a/rs_bindings_from_cc/bazel_support/compile_rust.bzl +++ b/rs_bindings_from_cc/bazel_support/compile_rust.bzl @@ -113,7 +113,7 @@ def compile_rust(ctx, attr, src, extra_srcs, deps, crate_name, include_coverage, aliases = aliases, output = lib, metadata = rmeta, - edition = "2018", + edition = "2024", is_test = False, rustc_env = {}, compile_data = depset([]), diff --git a/rs_bindings_from_cc/generate_bindings/generate_function.rs b/rs_bindings_from_cc/generate_bindings/generate_function.rs index 5047379c0..37c6beeb2 100644 --- a/rs_bindings_from_cc/generate_bindings/generate_function.rs +++ b/rs_bindings_from_cc/generate_bindings/generate_function.rs @@ -2265,7 +2265,7 @@ pub fn generate_function( #[inline (always)] unsafe fn ctor_new(args: (#single_param_,)) -> Self::CtorType { let (arg,) = args; - >::ctor_new(arg) + unsafe { >::ctor_new(arg) } } } } @@ -2301,7 +2301,7 @@ pub fn generate_function( #[inline (always)] unsafe fn ctor_new(args: #single_param_) -> Self::CtorType { - >::unsafe_from(args) + unsafe { >::unsafe_from(args) } } } }