Skip to content

Commit

Permalink
Don't apply semicolon in expressions from macros yet
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Mark-Simulacrum committed Feb 20, 2021
1 parent 3733275 commit 7179be8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/bootstrap/bootstrap.py
Expand Up @@ -877,7 +877,8 @@ def build_bootstrap(self):
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"

Expand Down
7 changes: 6 additions & 1 deletion src/bootstrap/builder.rs
Expand Up @@ -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");
Expand Down

0 comments on commit 7179be8

Please sign in to comment.