Mercurial > hg-stable
comparison rust/Cargo.lock @ 47982:4afd6cc447b9
rust: Make OwningDirstateMap generic and move it into hg-core
This will enable using it in rhg too.
The `OwningDirstateMap::new_empty` constructor is generic and accepts a value
of any type that gives acces to a bytes buffer. That buffer must stay valid
as long as the value hasn’t been dropped, and must keep its memory address
even if the value is moved. The `StableDeref` marker trait encodes those
constraints. Previously no trait was needed because the value was always
of type `PyBytes` which we know satisfies those constraints.
The buffer type is ereased in the struct itself through boxing and
dynamic dispatch, in order to simplify other signatures that mention
`OwningDirstateMap`.
Differential Revision: https://phab.mercurial-scm.org/D11396
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Thu, 09 Sep 2021 18:07:40 +0200 |
parents | 5decb7a49bb6 |
children | e834b79def74 |
comparison
equal
deleted
inserted
replaced
47981:8f031a274cd6 | 47982:4afd6cc447b9 |
---|---|
1 # This file is automatically @generated by Cargo. | 1 # This file is automatically @generated by Cargo. |
2 # It is not intended for manual editing. | 2 # It is not intended for manual editing. |
3 version = 3 | |
4 | |
3 [[package]] | 5 [[package]] |
4 name = "adler" | 6 name = "adler" |
5 version = "0.2.3" | 7 version = "0.2.3" |
6 source = "registry+https://github.com/rust-lang/crates.io-index" | 8 source = "registry+https://github.com/rust-lang/crates.io-index" |
7 checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" | 9 checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" |
394 "rand_pcg", | 396 "rand_pcg", |
395 "rayon", | 397 "rayon", |
396 "regex", | 398 "regex", |
397 "same-file", | 399 "same-file", |
398 "sha-1", | 400 "sha-1", |
401 "stable_deref_trait", | |
399 "tempfile", | 402 "tempfile", |
400 "twox-hash", | 403 "twox-hash", |
401 "zstd", | 404 "zstd", |
402 ] | 405 ] |
403 | 406 |
409 "crossbeam-channel 0.4.4", | 412 "crossbeam-channel 0.4.4", |
410 "env_logger", | 413 "env_logger", |
411 "hg-core", | 414 "hg-core", |
412 "libc", | 415 "libc", |
413 "log", | 416 "log", |
417 "stable_deref_trait", | |
414 ] | 418 ] |
415 | 419 |
416 [[package]] | 420 [[package]] |
417 name = "home" | 421 name = "home" |
418 version = "0.5.3" | 422 version = "0.5.3" |
863 "bitmaps", | 867 "bitmaps", |
864 "typenum", | 868 "typenum", |
865 ] | 869 ] |
866 | 870 |
867 [[package]] | 871 [[package]] |
872 name = "stable_deref_trait" | |
873 version = "1.2.0" | |
874 source = "registry+https://github.com/rust-lang/crates.io-index" | |
875 checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" | |
876 | |
877 [[package]] | |
868 name = "static_assertions" | 878 name = "static_assertions" |
869 version = "1.1.0" | 879 version = "1.1.0" |
870 source = "registry+https://github.com/rust-lang/crates.io-index" | 880 source = "registry+https://github.com/rust-lang/crates.io-index" |
871 checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" | 881 checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" |
872 | 882 |