From 9792179648abb7bf38a9e54191cfe5a25436b8fb Mon Sep 17 00:00:00 2001 From: Tomasz Miąsko Date: Sat, 19 Jun 2021 00:00:00 +0000 Subject: Add flag to configure `large_assignments` lint The `large_assignments` lints detects moves over specified limit. The limit is configured through `move_size_limit = "N"` attribute placed at the root of a crate. When attribute is absent, the lint is disabled. Make it possible to enable the lint without making any changes to the source code, through a new flag `-Zmove-size-limit=N`. For example, to detect moves exceeding 1023 bytes in a cargo crate, including all dependencies one could use: ``` $ env RUSTFLAGS=-Zmove-size-limit=1024 cargo build -vv ``` --- compiler/rustc_interface/src/tests.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler/rustc_interface/src') diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index b252409a92a..76dc31d1876 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -720,6 +720,7 @@ fn test_debugging_options_tracking_hash() { tracked!(merge_functions, Some(MergeFunctions::Disabled)); tracked!(mir_emit_retag, true); tracked!(mir_opt_level, Some(4)); + tracked!(move_size_limit, Some(4096)); tracked!(mutable_noalias, Some(true)); tracked!(new_llvm_pass_manager, Some(true)); tracked!(no_generate_arange_section, true); -- cgit 1.4.1-3-g733a5