Skip to content

Commit 1a9ea59

Browse files
chore: Silence warnings in trybuilt macro tests
1 parent 153eaa2 commit 1a9ea59

File tree

4 files changed

+18
-38
lines changed

4 files changed

+18
-38
lines changed

runtime/pavex_macros/tests/config/fail/group_rexport.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(unused_imports)]
12
use pavex_macros::config;
23

34
#[config(key = "b")]
Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
error: Grouped re-exports can't be annotated with #[pavex::config].
22
Re-export your configuration types one by one, annotating each `use` with #[pavex::config].
3-
--> tests/config/fail/group_rexport.rs:4:1
3+
--> tests/config/fail/group_rexport.rs:5:1
44
|
5-
4 | pub use private::{A, B};
5+
5 | pub use private::{A, B};
66
| ^^^^^^^^^^^^^^^^^^^^^^^^
77

88
error: Star re-exports can't be annotated with #[pavex::config].
99
Re-export your configuration types one by one, annotating each `use` with #[pavex::config].
10-
--> tests/config/fail/group_rexport.rs:7:1
10+
--> tests/config/fail/group_rexport.rs:8:1
1111
|
12-
7 | pub use private::*;
12+
8 | pub use private::*;
1313
| ^^^^^^^^^^^^^^^^^^^
14-
15-
warning: unused import: `private::*`
16-
--> tests/config/fail/group_rexport.rs:7:9
17-
|
18-
7 | pub use private::*;
19-
| ^^^^^^^^^^
20-
|
21-
= note: `#[warn(unused_imports)]` on by default

runtime/pavex_macros/tests/config/fail/not_public.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(unused_imports)]
12
use pavex_macros::config;
23

34
#[config(key = "a", id = "A_")]
Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,41 @@
11
error: Configuration types must be public.
22
Mark `A` as `pub`, and make sure it can be imported from outside your crate.
3-
--> tests/config/fail/not_public.rs:4:1
3+
--> tests/config/fail/not_public.rs:5:1
44
|
5-
4 | struct A;
5+
5 | struct A;
66
| ^^^^^^^^
77

88
error: Configuration types must be public.
99
Mark `A1` as `pub`, and make sure it can be imported from outside your crate.
10-
--> tests/config/fail/not_public.rs:7:1
10+
--> tests/config/fail/not_public.rs:8:1
1111
|
12-
7 | enum A1 {}
12+
8 | enum A1 {}
1313
| ^^^^^^^
1414

1515
error: Configuration types must be public.
1616
Mark `B` as `pub`, instead of `pub(crate)`, and make sure it can be imported from outside your crate.
17-
--> tests/config/fail/not_public.rs:10:1
17+
--> tests/config/fail/not_public.rs:11:1
1818
|
19-
10 | pub(crate) struct B;
19+
11 | pub(crate) struct B;
2020
| ^^^^^^^^^^
2121

2222
error: Configuration types must be public.
2323
Mark `B1` as `pub`, and make sure it can be imported from outside your crate.
24-
--> tests/config/fail/not_public.rs:13:1
24+
--> tests/config/fail/not_public.rs:14:1
2525
|
26-
13 | enum B1 {}
26+
14 | enum B1 {}
2727
| ^^^^^^^
2828

2929
error: Configuration types must be public.
3030
Mark `use` as `pub`, and make sure it can be imported from outside your crate.
31-
--> tests/config/fail/not_public.rs:16:1
31+
--> tests/config/fail/not_public.rs:17:1
3232
|
33-
16 | use sub::A as A2;
33+
17 | use sub::A as A2;
3434
| ^^^^^^^^^^^^^^^^
3535

3636
error: Configuration types must be public.
3737
Mark `use` as `pub`, instead of `pub(crate)`, and make sure it can be imported from outside your crate.
38-
--> tests/config/fail/not_public.rs:19:1
38+
--> tests/config/fail/not_public.rs:20:1
3939
|
40-
19 | pub(crate) use sub::A as A3;
40+
20 | pub(crate) use sub::A as A3;
4141
| ^^^^^^^^^^
42-
43-
warning: unused import: `sub::A as A2`
44-
--> tests/config/fail/not_public.rs:16:5
45-
|
46-
16 | use sub::A as A2;
47-
| ^^^^^^^^^^^^
48-
|
49-
= note: `#[warn(unused_imports)]` on by default
50-
51-
warning: unused import: `sub::A as A3`
52-
--> tests/config/fail/not_public.rs:19:16
53-
|
54-
19 | pub(crate) use sub::A as A3;
55-
| ^^^^^^^^^^^^

0 commit comments

Comments
 (0)