diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-16 10:20:27 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-16 10:20:27 -0400 |
commit | 97cc61e9476d6553e65ade578cc57a029674ee5a (patch) | |
tree | da2564fc232e5f404f860811026208ff6ede5966 | |
parent | 8c1e2d7557ff05c27a6dd32eb0ee90caff69da59 (diff) | |
parent | 3dd94a7ea7e85307822885306cbd7096b56442df (diff) | |
download | tor-97cc61e9476d6553e65ade578cc57a029674ee5a.tar.gz tor-97cc61e9476d6553e65ade578cc57a029674ee5a.zip |
Merge branch 'maint-0.3.4'
-rw-r--r-- | changes/bug26245 | 3 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | src/rust/.cargo/config.in | 3 | ||||
-rw-r--r-- | src/rust/external/crypto_digest.rs | 10 |
4 files changed, 15 insertions, 7 deletions
diff --git a/changes/bug26245 b/changes/bug26245 new file mode 100644 index 0000000000..7a14cea0bc --- /dev/null +++ b/changes/bug26245 @@ -0,0 +1,3 @@ + o Minor features (compilation): + o The --enable-fatal-warnings flag now affects Rust code as well. + Closes ticket 26245. diff --git a/configure.ac b/configure.ac index 95df1692a4..48ca5bae14 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/rust/.cargo/config.in b/src/rust/.cargo/config.in index 301e7fdbe7..70481bbcbe 100644 --- a/src/rust/.cargo/config.in +++ b/src/rust/.cargo/config.in @@ -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 diff --git a/src/rust/external/crypto_digest.rs b/src/rust/external/crypto_digest.rs index bc49e6124c..4eae1550a2 100644 --- a/src/rust/external/crypto_digest.rs +++ b/src/rust/external/crypto_digest.rs @@ -66,13 +66,6 @@ const DIGEST_SHA512: digest_algorithm_t = 2; const DIGEST_SHA3_256: digest_algorithm_t = 3; const DIGEST_SHA3_512: digest_algorithm_t = 4; -/// The total number of digest algorithms we currently support. -/// -/// We can't access these from Rust, because their definitions in C require -/// introspecting the `digest_algorithm_t` typedef, which is an enum, so we have -/// to redefine them here. -const N_DIGEST_ALGORITHMS: usize = DIGEST_SHA3_512 as usize + 1; - /// The number of hash digests we produce for a `common_digests_t`. /// /// We can't access these from Rust, because their definitions in C require @@ -117,6 +110,9 @@ struct common_digests_t { /// A `smartlist_t` is just an alias for the `#[repr(C)]` type `Stringlist`, to /// make it more clear that we're working with a smartlist which is owned by C. #[allow(non_camel_case_types)] +// BINDGEN_GENERATED: This type isn't actually bindgen generated, but the code +// below it which uses it is. As such, this comes up as "dead code" as well. +#[allow(dead_code)] type smartlist_t = Stringlist; /// All of the external functions from `src/common/crypto_digest.h`. |