]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make Rust warnings conditionally fatal
authorTaylor Yu <catalyst@torproject.org>
Fri, 15 Jun 2018 22:27:19 +0000 (17:27 -0500)
committerTaylor Yu <catalyst@torproject.org>
Fri, 15 Jun 2018 22:27:19 +0000 (17:27 -0500)
Set rustc flags to treat warnings as fatal if configured with
--enable-warnings.

configure.ac
src/rust/.cargo/config.in

index d554ba8e556d0745bb4ea8c0e348e9e43c9caba6..5269d9c42e5ba2e5ea5d23fb3377301b81166777 100644 (file)
@@ -462,6 +462,11 @@ if test "x$enable_rust" = "xyes"; then
   fi
 
   AC_DEFINE([HAVE_RUST], 1, [have Rust])
+  if test "x$enable_fatal_warnings" = "xyes"; then
+    RUST_WARN=
+  else
+    RUST_WARN=#
+  fi
   if test "x$enable_cargo_online_mode" = "xyes"; then
     CARGO_ONLINE=
     RUST_DL=#
@@ -515,6 +520,7 @@ if test "x$enable_rust" = "xyes"; then
 
   AC_SUBST(TOR_RUST_STATIC_NAME)
   AC_SUBST(CARGO_ONLINE)
+  AC_SUBST(RUST_WARN)
   AC_SUBST(RUST_DL)
 
   dnl Let's check the rustc version, too
index 301e7fdbe74c3ebda9c9aac6cb106cc3f4dc50bf..70481bbcbe9780d77fb8e10804b322fd64bf9c42 100644 (file)
@@ -6,3 +6,6 @@
 
 @RUST_DL@ [source.vendored-sources]
 @RUST_DL@ directory = '@TOR_RUST_DEPENDENCIES@'
+
+@RUST_WARN@ [build]
+@RUST_WARN@ rustflags = [ "-D", "warnings" ]
\ No newline at end of file