Don't apply semicolon in expressions from macros yet

std_detect is still using this and as it's in a submodule updating it will be a
pain. We can catch this either after a stdarch submodule bump or just on the
next cycle.
This commit is contained in:
Mark Rousskov 2021-02-14 08:56:35 -05:00
parent 3733275854
commit 7179be8789
2 changed files with 8 additions and 2 deletions

View File

@ -877,7 +877,8 @@ class RustBuild(object):
target_linker = self.get_toml("linker", build_section)
if target_linker is not None:
env["RUSTFLAGS"] += " -C linker=" + target_linker
env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes -Wsemicolon_in_expressions_from_macros"
# cfg(bootstrap): Add `-Wsemicolon_in_expressions_from_macros` after the next beta bump
env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes"
if self.get_toml("deny-warnings", "rust") != "false":
env["RUSTFLAGS"] += " -Dwarnings"

View File

@ -1279,7 +1279,12 @@ impl<'a> Builder<'a> {
// some code doesn't go through this `rustc` wrapper.
lint_flags.push("-Wrust_2018_idioms");
lint_flags.push("-Wunused_lifetimes");
lint_flags.push("-Wsemicolon_in_expressions_from_macros");
// cfg(bootstrap): unconditionally enable this warning after the next beta bump
// This is currently disabled for the stage1 libstd, since build scripts
// will end up using the bootstrap compiler (which doesn't yet support this lint)
if compiler.stage != 0 && mode != Mode::Std {
lint_flags.push("-Wsemicolon_in_expressions_from_macros");
}
if self.config.deny_warnings {
lint_flags.push("-Dwarnings");