Skip to content
This repository was archived by the owner on Oct 10, 2019. It is now read-only.

Commit b13bbad

Browse files
committed
Merge branch 'release-v0.1.4' into release
2 parents 3246b42 + d4e93f2 commit b13bbad

File tree

8 files changed

+24
-17
lines changed

8 files changed

+24
-17
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
target/
22
Cargo.lock
33
.cargo/
4+
.idea/
5+
*.iml

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ language: rust
22
sudo: false
33
rust:
44
- nightly
5-
- beta
6-
- 1.8.0
5+
- 1.11.0
76
script:
87
- (test $TRAVIS_RUST_VERSION != "nightly" || env RUST_BACKTRACE=1 cargo test --manifest-path=postgres-derive-macros/Cargo.toml)
98
- cargo test --manifest-path=postgres-derive-codegen/test/Cargo.toml

postgres-derive-codegen/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "postgres-derive-codegen"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
authors = ["Steven Fackler <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "Deriving codegen support for Postgres enum, domain, and composite types"
@@ -16,8 +16,8 @@ nightly = []
1616
with-syntex = ["syntex", "syntex_syntax"]
1717

1818
[build-dependencies]
19-
syntex = { version = "0.36", optional = true }
19+
syntex = { version = "0.44", optional = true }
2020

2121
[dependencies]
22-
syntex = { version = "0.36", optional = true }
23-
syntex_syntax = { version = "0.36", optional = true }
22+
syntex = { version = "0.44", optional = true }
23+
syntex_syntax = { version = "0.44", optional = true }

postgres-derive-codegen/src/overrides.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use syntax::ast::{Attribute, LitKind, MetaItemKind};
2-
use syntax::attr::AttrMetaMethods;
1+
use syntax::ast::{Attribute, LitKind, MetaItemKind, NestedMetaItemKind};
32
use syntax::ext::base::ExtCtxt;
43
use syntax::parse::token::InternedString;
54

@@ -21,6 +20,13 @@ pub fn get_overrides(ctx: &mut ExtCtxt, attrs: &[Attribute]) -> Overrides {
2120
};
2221

2322
for item in list {
23+
let item = match item.node {
24+
NestedMetaItemKind::MetaItem(ref item) => item,
25+
_ => {
26+
ctx.span_err(item.span, "expected a meta item");
27+
continue;
28+
}
29+
};
2430
match item.node {
2531
MetaItemKind::NameValue(ref key, ref value) => {
2632
if *key != "name" {

postgres-derive-macros/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "postgres-derive-macros"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
authors = ["Steven Fackler <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "Deriving macro support for Postgres enum, domain, and composite types"
@@ -13,8 +13,8 @@ plugin = true
1313
test = false
1414

1515
[dependencies]
16-
postgres-derive-codegen = { version = "0.1.3", path = "../postgres-derive-codegen", default-features = false, features = ["nightly"] }
16+
postgres-derive-codegen = { version = "0.1.4", path = "../postgres-derive-codegen", default-features = false, features = ["nightly"] }
1717

1818
[dev-dependencies]
1919
postgres = "0.11.3"
20-
compiletest_rs = "0.1"
20+
compiletest_rs = "0.2"

postgres-derive-macros/tests/compile-fail/bad-override.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ macro_rules! to_sql_checked {
55
() => ()
66
}
77

8-
#[derive(ToSql)]
8+
#[derive(Clone, ToSql)]
99
#[postgres(
1010
foo = "bar" //~ ERROR unknown attribute key `foo`
1111
)]

postgres-derive-macros/tests/compile-fail/big-tuple-struct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ macro_rules! to_sql_checked {
55
() => ()
66
}
77

8-
#[derive(ToSql)] //~ ERROR #[derive(ToSql)] can only be applied to structs, single field tuple structs, and enums
8+
#[derive(Clone, ToSql)] //~ ERROR #[derive(ToSql)] can only be applied to structs, single field tuple structs, and enums
99
struct Foo(i32, i32);
1010

11-
#[derive(FromSql)] //~ ERROR #[derive(FromSql)] can only be applied to structs, single field tuple structs, and enums
11+
#[derive(Clone, FromSql)] //~ ERROR #[derive(FromSql)] can only be applied to structs, single field tuple structs, and enums
1212
struct Bar(i32, i32);
1313

1414
fn main() {}

postgres-derive-macros/tests/compile-fail/complex-enum.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ macro_rules! to_sql_checked {
55
() => ()
66
}
77

8-
#[derive(ToSql)]
8+
#[derive(Clone, ToSql)]
99
enum Foo {
1010
Bar(i32), //~ ERROR #[derive(ToSql)] does not support non-C-like enums
1111
Baz { b: i32 }, //~ ERROR #[derive(ToSql)] does not support non-C-like enums
1212
}
1313

14-
#[derive(FromSql)]
15-
enum Foo {
14+
#[derive(Clone, FromSql)]
15+
enum Bar {
1616
Bar(i32), //~ ERROR #[derive(FromSql)] does not support non-C-like enums
1717
Baz { b: i32 }, //~ ERROR #[derive(FromSql)] does not support non-C-like enums
1818
}

0 commit comments

Comments
 (0)