aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rust/.cargo/config.in3
-rw-r--r--src/rust/crypto/Cargo.toml3
-rw-r--r--src/rust/external/crypto_digest.rs10
3 files changed, 8 insertions, 8 deletions
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/crypto/Cargo.toml b/src/rust/crypto/Cargo.toml
index 3d343344ae..c0c5e7bf93 100644
--- a/src/rust/crypto/Cargo.toml
+++ b/src/rust/crypto/Cargo.toml
@@ -13,7 +13,7 @@ crate_type = ["rlib", "staticlib"]
[dependencies]
libc = "=0.2.39"
digest = "=0.7.2"
-rand_core = "=0.2.0-pre.0"
+rand_core = { version = "=0.2.0-pre.0", default-features = false }
external = { path = "../external" }
smartlist = { path = "../smartlist" }
@@ -22,6 +22,7 @@ tor_log = { path = "../tor_log" }
[dev-dependencies]
rand = { version = "=0.5.0-pre.2", default-features = false }
+rand_core = { version = "=0.2.0-pre.0", default-features = false }
[features]
testing = ["tor_log/testing"]
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`.