Skip to content

Commit 8d617be

Browse files
committed
Updated for latest Rust nightly.
Deref is no longer in the prelude, so it had to be specified using its full path (thanks to @pczarn for the syntax). Deref's type paramter was replaced with an associated type, Target. Replaced [Box<uint>, ..3] with [Box<uint>; 3] because the former syntax is gone.
1 parent 10499f4 commit 8d617be

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/lazy_static.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ macro_rules! lazy_static {
8484
};
8585
($VIS:ident static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
8686
lazy_static!(MAKE TY $VIS $N);
87-
impl Deref<$T> for $N {
87+
impl ::std::ops::Deref for $N {
88+
type Target = $T;
8889
fn deref<'a>(&'a self) -> &'a $T {
8990
use std::sync::{Once, ONCE_INIT};
9091
use std::mem::transmute;

tests/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::collections::HashMap;
66

77
lazy_static! {
88
static ref NUMBER: uint = times_two(3);
9-
static ref ARRAY_BOXES: [Box<uint>, ..3] = [box 1, box 2, box 3];
9+
static ref ARRAY_BOXES: [Box<uint>; 3] = [box 1, box 2, box 3];
1010
static ref STRING: String = "hello".to_string();
1111
static ref HASHMAP: HashMap<uint, &'static str> = {
1212
let mut m = HashMap::new();

0 commit comments

Comments
 (0)