Skip to content

Commit

Permalink
rust: disable overflow-checks by default
Browse files Browse the repository at this point in the history
These result in very large binaries when linked, and are not generally
useful. A user can turn them back on by passing `-C overflow-checks=yes`
manually via `-Drust_args` or the `RUSTFLAGS` environment variable

fixes: mesonbuild#11785
  • Loading branch information
dcbaker committed Jul 13, 2023
1 parent 61984bc commit 4f50fee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/compilers/rust.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def get_pie_args(self) -> T.List[str]:

def get_assert_args(self, disable: bool) -> T.List[str]:
action = "no" if disable else "yes"
return ['-C', f'debug-assertions={action}']
return ['-C', f'debug-assertions={action}', '-C', 'overflow-checks=no']


class ClippyRustCompiler(RustCompiler):
Expand Down

0 comments on commit 4f50fee

Please sign in to comment.