Skip to content

Commit c55ab5d

Browse files
committed
Fix some tests
1 parent 5a42140 commit c55ab5d

File tree

7 files changed

+4
-129
lines changed

7 files changed

+4
-129
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

trybuild_tests/tests/trybuild/fail/fieldtype_hybrid_tuple.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

trybuild_tests/tests/trybuild/fail/fieldtype_hybrid_tuple.stderr

Lines changed: 0 additions & 5 deletions
This file was deleted.

trybuild_tests/tests/trybuild/fail/filter_contains_wrong_args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ use butane::{filter, model};
44
struct Post {
55
id: i64,
66
title: String,
7-
tags: Vec<String>,
7+
tags: Vec<u8>,
88
}
99

1010
fn main() {
1111
// This should fail - contains expects exactly one argument
12-
let _f = filter!(Post, tags.contains("a", "b"));
12+
let _f = filter!(Post, tags.contains(1, 2));
1313
}
Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,5 @@
11
error: expected one argument to 'contains'
22
--> tests/trybuild/fail/filter_contains_wrong_args.rs:12:28
33
|
4-
12 | let _f = filter!(Post, tags.contains("a", "b"));
4+
12 | let _f = filter!(Post, tags.contains(1, 2));
55
| ^^^^
6-
7-
error[E0277]: the trait bound `Vec<String>: ToSql` is not satisfied
8-
--> tests/trybuild/fail/filter_contains_wrong_args.rs:3:1
9-
|
10-
3 | #[model]
11-
| ^^^^^^^^ the trait `ToSql` is not implemented for `Vec<String>`
12-
|
13-
= help: the trait `ToSql` is implemented for `Vec<u8>`
14-
= note: required for `SqlVal` to implement `From<Vec<String>>`
15-
= note: required for `Vec<String>` to implement `Into<SqlVal>`
16-
note: required by a bound in `FieldExpr`
17-
--> $WORKSPACE/butane_core/src/query/fieldexpr.rs
18-
|
19-
| pub struct FieldExpr<T>
20-
| --------- required by a bound in this struct
21-
| where
22-
| T: Into<SqlVal>,
23-
| ^^^^^^^^^^^^ required by this bound in `FieldExpr`
24-
= note: this error originates in the attribute macro `model` (in Nightly builds, run with -Z macro-backtrace for more info)
25-
26-
error[E0277]: the trait bound `Vec<String>: FieldType` is not satisfied
27-
--> tests/trybuild/fail/filter_contains_wrong_args.rs:7:11
28-
|
29-
7 | tags: Vec<String>,
30-
| ^^^^^^^^^^^ the trait `FieldType` is not implemented for `Vec<String>`
31-
|
32-
= help: the trait `FieldType` is implemented for `Vec<u8>`
33-
34-
error[E0277]: the trait bound `Vec<String>: FromSql` is not satisfied
35-
--> tests/trybuild/fail/filter_contains_wrong_args.rs:3:1
36-
|
37-
3 | #[model]
38-
| ^^^^^^^^ the trait `FromSql` is not implemented for `Vec<String>`
39-
|
40-
= help: the trait `FromSql` is implemented for `Vec<u8>`
41-
= note: this error originates in the attribute macro `model` (in Nightly builds, run with -Z macro-backtrace for more info)
42-
43-
error[E0277]: the trait bound `Vec<String>: ToSql` is not satisfied
44-
--> tests/trybuild/fail/filter_contains_wrong_args.rs:3:1
45-
|
46-
3 | #[model]
47-
| ^^^^^^^^ the trait `ToSql` is not implemented for `Vec<String>`
48-
|
49-
= help: the trait `ToSql` is implemented for `Vec<u8>`
50-
= note: this error originates in the attribute macro `model` (in Nightly builds, run with -Z macro-backtrace for more info)
51-
52-
error[E0599]: the function or associated item `new` exists for struct `FieldExpr<Vec<String>>`, but its trait bounds were not satisfied
53-
--> tests/trybuild/fail/filter_contains_wrong_args.rs:3:1
54-
|
55-
3 | #[model]
56-
| ^^^^^^^^ function or associated item cannot be called on `FieldExpr<Vec<String>>` due to unsatisfied trait bounds
57-
|
58-
= note: the following trait bounds were not satisfied:
59-
`Vec<String>: ToSql`
60-
which is required by `Vec<String>: Into<SqlVal>`
61-
= note: this error originates in the attribute macro `model` (in Nightly builds, run with -Z macro-backtrace for more info)

trybuild_tests/tests/trybuild/fail/model_vec_field.stderr

Lines changed: 0 additions & 55 deletions
This file was deleted.

trybuild_tests/tests/trybuild/fail/model_vec_field.rs renamed to trybuild_tests/tests/trybuild/pass/model_vec_field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use butane::model;
55
struct Post {
66
#[pk]
77
id: i64,
8-
tags: Vec<String>,
8+
tags: Vec<u8>,
99
}
1010

1111
fn main() {}

0 commit comments

Comments
 (0)