forked from sfackler/rust-postgres
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sfackler#25 from petrosagg/integrate-upstream
integrate upstream
- Loading branch information
Showing
67 changed files
with
3,161 additions
and
1,306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
postgres-derive-test/src/compile-fail/invalid-allow-mismatch.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use postgres_types::{FromSql, ToSql}; | ||
|
||
#[derive(ToSql, Debug)] | ||
#[postgres(allow_mismatch)] | ||
struct ToSqlAllowMismatchStruct { | ||
a: i32, | ||
} | ||
|
||
#[derive(FromSql, Debug)] | ||
#[postgres(allow_mismatch)] | ||
struct FromSqlAllowMismatchStruct { | ||
a: i32, | ||
} | ||
|
||
#[derive(ToSql, Debug)] | ||
#[postgres(allow_mismatch)] | ||
struct ToSqlAllowMismatchTupleStruct(i32, i32); | ||
|
||
#[derive(FromSql, Debug)] | ||
#[postgres(allow_mismatch)] | ||
struct FromSqlAllowMismatchTupleStruct(i32, i32); | ||
|
||
#[derive(FromSql, Debug)] | ||
#[postgres(transparent, allow_mismatch)] | ||
struct TransparentFromSqlAllowMismatchStruct(i32); | ||
|
||
#[derive(FromSql, Debug)] | ||
#[postgres(allow_mismatch, transparent)] | ||
struct AllowMismatchFromSqlTransparentStruct(i32); | ||
|
||
fn main() {} |
43 changes: 43 additions & 0 deletions
43
postgres-derive-test/src/compile-fail/invalid-allow-mismatch.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
error: #[postgres(allow_mismatch)] may only be applied to enums | ||
--> src/compile-fail/invalid-allow-mismatch.rs:4:1 | ||
| | ||
4 | / #[postgres(allow_mismatch)] | ||
5 | | struct ToSqlAllowMismatchStruct { | ||
6 | | a: i32, | ||
7 | | } | ||
| |_^ | ||
|
||
error: #[postgres(allow_mismatch)] may only be applied to enums | ||
--> src/compile-fail/invalid-allow-mismatch.rs:10:1 | ||
| | ||
10 | / #[postgres(allow_mismatch)] | ||
11 | | struct FromSqlAllowMismatchStruct { | ||
12 | | a: i32, | ||
13 | | } | ||
| |_^ | ||
|
||
error: #[postgres(allow_mismatch)] may only be applied to enums | ||
--> src/compile-fail/invalid-allow-mismatch.rs:16:1 | ||
| | ||
16 | / #[postgres(allow_mismatch)] | ||
17 | | struct ToSqlAllowMismatchTupleStruct(i32, i32); | ||
| |_______________________________________________^ | ||
|
||
error: #[postgres(allow_mismatch)] may only be applied to enums | ||
--> src/compile-fail/invalid-allow-mismatch.rs:20:1 | ||
| | ||
20 | / #[postgres(allow_mismatch)] | ||
21 | | struct FromSqlAllowMismatchTupleStruct(i32, i32); | ||
| |_________________________________________________^ | ||
|
||
error: #[postgres(transparent)] is not allowed with #[postgres(allow_mismatch)] | ||
--> src/compile-fail/invalid-allow-mismatch.rs:24:25 | ||
| | ||
24 | #[postgres(transparent, allow_mismatch)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: #[postgres(allow_mismatch)] is not allowed with #[postgres(transparent)] | ||
--> src/compile-fail/invalid-allow-mismatch.rs:28:28 | ||
| | ||
28 | #[postgres(allow_mismatch, transparent)] | ||
| ^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
[package] | ||
name = "postgres-derive" | ||
version = "0.4.4" | ||
version = "0.4.5" | ||
authors = ["Steven Fackler <[email protected]>"] | ||
license = "MIT/Apache-2.0" | ||
license = "MIT OR Apache-2.0" | ||
edition = "2018" | ||
description = "An internal crate used by postgres-types" | ||
repository = "https://github.com/sfackler/rust-postgres" | ||
|
@@ -15,3 +15,4 @@ test = false | |
syn = "2.0" | ||
proc-macro2 = "1.0" | ||
quote = "1.0" | ||
heck = "0.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.