From a903e1a77013fbb346bf7fd83ad1144a72a38be8 Mon Sep 17 00:00:00 2001 From: bluss Date: Wed, 17 Jan 2018 20:21:41 +0100 Subject: [PATCH] FIX: Fix future compat warning with pointer casts ``` warning: the type of this value must be known in this context --> src/lib.rs:312:32 | 312 | ptr::copy(p, p.offset(1), len - index); | ^^^^^^ | = note: #[warn(tyvar_behind_raw_pointer)] on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #46906 ``` --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index d7158f2..5960f58 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -306,7 +306,7 @@ impl ArrayVec { unsafe { // infallible // The spot to put the new value { - let p = self.get_unchecked_mut(index) as *mut _; + let p: *mut _ = self.get_unchecked_mut(index); // Shift everything over to make space. (Duplicating the // `index`th element into two consecutive places.) ptr::copy(p, p.offset(1), len - index);