aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChelsea Holland Komlo <me@chelseakomlo.com>2017-10-25 23:02:38 -0400
committerNick Mathewson <nickm@torproject.org>2017-10-27 10:02:08 -0400
commit90daad999e78c8ec8239e63ea03df6b3b2e364b6 (patch)
tree9148fefa19ff4ace5072f8a7c3aa47c1f79ad8c5 /src
parent7999d0bf6b362972f7e2edab9586435bd4daf563 (diff)
downloadtor-90daad999e78c8ec8239e63ea03df6b3b2e364b6.tar.gz
tor-90daad999e78c8ec8239e63ea03df6b3b2e364b6.zip
remove experimental rust features
allow unsafe on function that calls C
Diffstat (limited to 'src')
-rw-r--r--src/rust/protover/lib.rs2
-rw-r--r--src/rust/protover/protover.rs3
-rw-r--r--src/rust/tor_allocate/tor_allocate.rs4
3 files changed, 6 insertions, 3 deletions
diff --git a/src/rust/protover/lib.rs b/src/rust/protover/lib.rs
index 620191f88d..5a5dea4408 100644
--- a/src/rust/protover/lib.rs
+++ b/src/rust/protover/lib.rs
@@ -1,5 +1,3 @@
-#![feature(inclusive_range_syntax)]
-
//! Copyright (c) 2016-2017, The Tor Project, Inc. */
//! See LICENSE for licensing information */
diff --git a/src/rust/protover/protover.rs b/src/rust/protover/protover.rs
index 37589a83f9..8a546e09a3 100644
--- a/src/rust/protover/protover.rs
+++ b/src/rust/protover/protover.rs
@@ -362,7 +362,8 @@ fn expand_version_range(range: &str) -> Result<Vec<u32>, &'static str> {
"cannot parse protocol range upper bound",
))?;
- Ok((lower..=higher).collect())
+ // We can use inclusive range syntax when it becomes stable.
+ Ok((lower..higher+1).collect())
}
/// Checks to see if there is a continuous range of integers, starting at the
diff --git a/src/rust/tor_allocate/tor_allocate.rs b/src/rust/tor_allocate/tor_allocate.rs
index 7b348b6d02..03ed2499c7 100644
--- a/src/rust/tor_allocate/tor_allocate.rs
+++ b/src/rust/tor_allocate/tor_allocate.rs
@@ -25,6 +25,10 @@ extern "C" fn tor_malloc_ ( size: usize) -> *mut c_void {
///
/// A `*mut c_char` that should be freed by tor_free in C
///
+/// Allow unused unsafe as at compile-time, we get warnings that unsafe is not
+/// needed even though this calls tor_malloc in C.
+///
+#[allow(unused_unsafe)]
pub fn allocate_and_copy_string(src: &String) -> *mut c_char {
let bytes: &[u8] = src.as_bytes();