File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 36
36
run : |
37
37
cargo build --no-default-features
38
38
cargo build
39
+ cargo build --features malloc_size_of
39
40
- uses : actions-rs/cargo@v1
40
41
with :
41
42
command : test
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " string_cache"
3
- version = " 0.8.8 " # Also update README.md when making a semver-breaking change
3
+ version = " 0.8.9 " # Also update README.md when making a semver-breaking change
4
4
authors = [" The Servo Project Developers" ]
5
5
description = " A string interning library for Rust, developed as part of the Servo project."
6
6
license = " MIT OR Apache-2.0"
@@ -25,6 +25,7 @@ default = ["serde_support"]
25
25
[dependencies ]
26
26
precomputed-hash = " 0.1"
27
27
serde = { version = " 1" , optional = true }
28
+ malloc_size_of = { version = " 0.1" , default-features = false , optional = true }
28
29
phf_shared = " 0.11"
29
30
new_debug_unreachable = " 1.0.2"
30
31
parking_lot = " 0.12"
Original file line number Diff line number Diff line change @@ -82,6 +82,15 @@ pub struct Atom<Static> {
82
82
phantom : PhantomData < Static > ,
83
83
}
84
84
85
+ // This isn't really correct as the Atoms can technically take up space. But I guess it's ok
86
+ // as it is possible to measure the size of the atom set separately/
87
+ #[ cfg( feature = "malloc_size_of" ) ]
88
+ impl < Static : StaticAtomSet > malloc_size_of:: MallocSizeOf for Atom < Static > {
89
+ fn size_of ( & self , _ops : & mut malloc_size_of:: MallocSizeOfOps ) -> usize {
90
+ 0
91
+ }
92
+ }
93
+
85
94
// FIXME: bound removed from the struct definition before of this error for pack_static:
86
95
// "error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable"
87
96
// https://github.com/rust-lang/rust/issues/57563
You can’t perform that action at this time.
0 commit comments