From 5db8727ed11baf584f17bfb1048900e37ee2925b Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 19 Aug 2025 09:55:42 -0400 Subject: [PATCH] meson: Add a rust_2024_lint_args helper Copied from rusticl. This makes it easier for other Rust components to ask for all the 2024 warnings. Reviewed-by: Karol Herbst Part-of: --- meson.build | 18 ++++++++++++++++++ src/gallium/frontends/rusticl/meson.build | 17 +---------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 474f409ffc2..a3d3667aed1 100644 --- a/meson.build +++ b/meson.build @@ -802,6 +802,24 @@ if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv') or if rustc.version().version_compare('>= 1.88') bindgen_output_args += ['--raw-line', '#![allow(unnecessary_transmutes)]'] endif + + rust_2024_lint_args = [ + '-Dboxed_slice_into_iter', + '-Ddeprecated_safe_2024', + '-Dimpl_trait_overcaptures', + '-Dkeyword_idents_2024', + '-Dmissing_unsafe_on_extern', + '-Dnever_type_fallback_flowing_into_unsafe', + '-Drust_2024_prelude_collisions', + '-Dstatic_mut_refs', + '-Dunsafe_attr_outside_unsafe', + '-Dunsafe_op_in_unsafe_fn', + + # 1.83+ + # '-Dif_let_rescope', + # '-Drust_2024_guarded_string_incompatible_syntax', + # '-Drust_2024_incompatible_pat', + ] endif if get_option('precomp-compiler') != 'system' diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build index 5edcd7d7c4f..8750abf1071 100644 --- a/src/gallium/frontends/rusticl/meson.build +++ b/src/gallium/frontends/rusticl/meson.build @@ -62,22 +62,7 @@ rusticl_files = files( ) rusticl_args = [ - # rust 2024 edition lints - '-Dboxed_slice_into_iter', - '-Ddeprecated_safe_2024', - '-Dimpl_trait_overcaptures', - '-Dkeyword_idents_2024', - '-Dmissing_unsafe_on_extern', - '-Dnever_type_fallback_flowing_into_unsafe', - '-Drust_2024_prelude_collisions', - '-Dstatic_mut_refs', - '-Dunsafe_attr_outside_unsafe', - '-Dunsafe_op_in_unsafe_fn', - - # 1.83+: - # '-Dif_let_rescope', - # '-Drust_2024_guarded_string_incompatible_syntax', - # '-Drust_2024_incompatible_pat', + rust_2024_lint_args, # Should be ran manually before moving to the 2024 edition # '-Dtail_expr_drop_order',