Skip to content

Commit 171d50a

Browse files
Update no_atomic.rs and fix CI failures (#129)
1 parent c8668b0 commit 171d50a

File tree

4 files changed

+43
-38
lines changed

4 files changed

+43
-38
lines changed

tests/tests/derive.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![cfg(feature = "derive")]
2+
#![allow(dead_code)]
23

34
use valuable::Valuable;
45

tests/tests/ui/not_valuable.stderr

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ error[E0277]: the trait bound `S: Valuable` is not satisfied
55
| -------- required by a bound introduced by this call
66
6 | struct Struct {
77
7 | f: Option<S>,
8-
| ^^^^^^^^^ the trait `Valuable` is not implemented for `S`
8+
| ^^^^^^^^^ the trait `Valuable` is not implemented for `S`, which is required by `Option<S>: Valuable`
99
|
1010
= help: the following other types implement trait `Valuable`:
11-
bool
12-
char
13-
isize
14-
i8
15-
i16
16-
i32
17-
i64
18-
i128
11+
&T
12+
&[T]
13+
&mut T
14+
&std::path::Path
15+
&str
16+
()
17+
(T0, T1)
18+
(T0, T1, T2)
1919
and $N others
2020
= note: required for `Option<S>` to implement `Valuable`
2121

@@ -25,17 +25,17 @@ error[E0277]: the trait bound `S: Valuable` is not satisfied
2525
10 | #[derive(Valuable)]
2626
| -------- required by a bound introduced by this call
2727
11 | struct Tuple(Option<S>);
28-
| ^^^^^^^^^ the trait `Valuable` is not implemented for `S`
28+
| ^^^^^^^^^ the trait `Valuable` is not implemented for `S`, which is required by `Option<S>: Valuable`
2929
|
3030
= help: the following other types implement trait `Valuable`:
31-
bool
32-
char
33-
isize
34-
i8
35-
i16
36-
i32
37-
i64
38-
i128
31+
&T
32+
&[T]
33+
&mut T
34+
&std::path::Path
35+
&str
36+
()
37+
(T0, T1)
38+
(T0, T1, T2)
3939
and $N others
4040
= note: required for `Option<S>` to implement `Valuable`
4141

@@ -46,17 +46,17 @@ error[E0277]: the trait bound `S: Valuable` is not satisfied
4646
| -------- required by a bound introduced by this call
4747
14 | enum Enum {
4848
15 | Struct { f: Option<S> },
49-
| ^^^^^^^^^ the trait `Valuable` is not implemented for `S`
49+
| ^^^^^^^^^ the trait `Valuable` is not implemented for `S`, which is required by `&Option<S>: Valuable`
5050
|
5151
= help: the following other types implement trait `Valuable`:
52-
bool
53-
char
54-
isize
55-
i8
56-
i16
57-
i32
58-
i64
59-
i128
52+
&T
53+
&[T]
54+
&mut T
55+
&std::path::Path
56+
&str
57+
()
58+
(T0, T1)
59+
(T0, T1, T2)
6060
and $N others
6161
= note: required for `Option<S>` to implement `Valuable`
6262
= note: 1 redundant requirement hidden
@@ -69,17 +69,17 @@ error[E0277]: the trait bound `S: Valuable` is not satisfied
6969
| -------- required by a bound introduced by this call
7070
...
7171
16 | Tuple(Option<S>),
72-
| ^^^^^^^^^ the trait `Valuable` is not implemented for `S`
72+
| ^^^^^^^^^ the trait `Valuable` is not implemented for `S`, which is required by `&Option<S>: Valuable`
7373
|
7474
= help: the following other types implement trait `Valuable`:
75-
bool
76-
char
77-
isize
78-
i8
79-
i16
80-
i32
81-
i64
82-
i128
75+
&T
76+
&[T]
77+
&mut T
78+
&std::path::Path
79+
&str
80+
()
81+
(T0, T1)
82+
(T0, T1, T2)
8383
and $N others
8484
= note: required for `Option<S>` to implement `Valuable`
8585
= note: 1 redundant requirement hidden

valuable/build.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ include!("no_atomic.rs");
88
// opening a GitHub issue if your build environment requires some way to enable
99
// these cfgs other than by executing our build script.
1010
fn main() {
11+
println!("cargo:rerun-if-changed=no_atomic.rs");
12+
println!("cargo:rustc-check-cfg=cfg(valuable_no_atomic_cas,valuable_no_atomic,valuable_no_atomic_64)");
13+
1114
let target = match env::var("TARGET") {
1215
Ok(target) => target,
1316
Err(e) => {
@@ -34,6 +37,4 @@ fn main() {
3437
} else {
3538
// Otherwise, assuming `"max-atomic-width" == 64`.
3639
}
37-
38-
println!("cargo:rerun-if-changed=no_atomic.rs");
3940
}

valuable/no_atomic.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const NO_ATOMIC_64: &[&str] = &[
2828
"csky-unknown-linux-gnuabiv2",
2929
"csky-unknown-linux-gnuabiv2hf",
3030
"hexagon-unknown-linux-musl",
31+
"hexagon-unknown-none-elf",
3132
"m68k-unknown-linux-gnu",
3233
"mips-unknown-linux-gnu",
3334
"mips-unknown-linux-musl",
@@ -52,9 +53,11 @@ const NO_ATOMIC_64: &[&str] = &[
5253
"riscv32gc-unknown-linux-musl",
5354
"riscv32i-unknown-none-elf",
5455
"riscv32im-unknown-none-elf",
56+
"riscv32ima-unknown-none-elf",
5557
"riscv32imac-esp-espidf",
5658
"riscv32imac-unknown-none-elf",
5759
"riscv32imac-unknown-xous-elf",
60+
"riscv32imafc-esp-espidf",
5861
"riscv32imafc-unknown-none-elf",
5962
"riscv32imc-esp-espidf",
6063
"riscv32imc-unknown-none-elf",

0 commit comments

Comments
 (0)