Skip to content

Commit 0d7baab

Browse files
authored
Merge pull request #48 from aldanor/feature/1.36
Update to Rust 1.36; fix syn/quote issue with tuple structs
2 parents b8addfa + b573c78 commit 0d7baab

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,18 @@ before_install:
7676
brew update >/dev/null;
7777
brew tap homebrew/science;
7878
brew install hdf5@${H5_BREW};
79+
# https://github.com/laumann/compiletest-rs/issues/179
80+
export DYLD_LIBRARY_PATH="/usr/lib:/usr/local/lib";
81+
brew unlink jpeg giflib libpng libtiff
7982
fi
8083
- |
8184
if [ ! -z "$H5_CONDA" ]; then
8285
if [ `uname` = "Darwin" ]; then
8386
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
8487
# note: this is only required for older HDF5 installations on OS X
8588
export DYLD_FALLBACK_LIBRARY_PATH="$HOME/miniconda/envs/testenv/lib";
89+
# https://github.com/laumann/compiletest-rs/issues/179
90+
export DYLD_LIBRARY_PATH="$HOME/miniconda/envs/testenv/lib";
8691
else
8792
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
8893
fi

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ members = ["hdf5-types", "hdf5-derive", "hdf5-sys"]
2020
exclude = ["*.yml", "ci/*"]
2121

2222
[dependencies]
23-
bitflags = "1.0"
23+
bitflags = "1.1"
2424
lazy_static = "1.3"
2525
libc = "0.2"
26-
parking_lot = "0.7"
26+
parking_lot = "0.8"
2727
ndarray = "0.12"
2828
num-integer = "0.1"
2929
num-traits = "0.2"
@@ -34,7 +34,7 @@ hdf5-derive = { path = "hdf5-derive", version = "0.5.1" }
3434

3535
[dev-dependencies]
3636
mashup = "0.1"
37-
rand = "0.6"
37+
rand = { version = "0.7", features = ["small_rng"] }
3838
regex = "1.1"
3939
scopeguard = "1.0"
4040
tempdir = "0.3"

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ init:
1212

1313
environment:
1414
matrix:
15-
- CHANNEL: 1.32.0
15+
- CHANNEL: 1.36.0
1616
H5_VERSION: 1.8.21
1717
H5_SOURCE: msi
1818
- CHANNEL: beta

hdf5-derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ quote = "0.6"
1818
syn = { version = "0.15", features = ["derive", "extra-traits"]}
1919

2020
[dev-dependencies]
21-
compiletest_rs = { version = "0.3.18", features = ["stable"] }
21+
compiletest_rs = { version = "0.3.22", features = ["stable"] }
2222
hdf5 = { version = ">=0.5", path = ".." }

hdf5-derive/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use std::str::FromStr;
99
use proc_macro2::{Ident, Span, TokenStream};
1010
use quote::{quote, ToTokens};
1111
use syn::{
12-
parse_macro_input, AttrStyle, Attribute, Data, DeriveInput, Expr, Fields, Meta, NestedMeta,
13-
Type, TypeGenerics, TypePath,
12+
parse_macro_input, AttrStyle, Attribute, Data, DeriveInput, Expr, Fields, Index,
13+
Meta, NestedMeta, Type, TypeGenerics, TypePath,
1414
};
1515

1616
#[proc_macro_derive(H5Type)]
@@ -146,11 +146,12 @@ fn impl_trait(
146146
impl_compound(ty, ty_generics, &fields, &names, &types)
147147
}
148148
Fields::Unnamed(ref fields) => {
149-
let (index, fields): (Vec<usize>, Vec<_>) = fields
149+
let (index, fields): (Vec<Index>, Vec<_>) = fields
150150
.unnamed
151151
.iter()
152152
.enumerate()
153153
.filter(|&(_, f)| !is_phantom_data(&f.ty))
154+
.map(|(i, f)| (Index::from(i), f))
154155
.unzip();
155156
if fields.is_empty() {
156157
panic!("Cannot derive H5Type for empty tuple structs");

0 commit comments

Comments
 (0)