mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 09:48:05 +03:00
f7011a3993
Summary: This diff sets two Rust lints to warn in fbcode: ``` [rust] warn_lints = bare_trait_objects, ellipsis_inclusive_range_patterns ``` and fixes occurrences of those warnings within common/rust, hg, and mononoke. Both of these lints are set to warn by default starting with rustc 1.37. Enabling them early avoids writing even more new code that needs to be fixed when we pull in 1.37 in six weeks. Upstream tracking issue: https://github.com/rust-lang/rust/issues/54910 Reviewed By: Imxset21 Differential Revision: D16200291 fbshipit-source-id: aca11a7a944e9fa95f94e226b52f6f053b97ec74 |
||
---|---|---|
.. | ||
argparse | ||
asyncrevisionstore/src | ||
blackbox | ||
bookmarkstore | ||
cdatapack | ||
clib | ||
clidispatch | ||
cliparser | ||
commitcloudsubscriber | ||
configparser | ||
cpython-ext | ||
cpython-failure | ||
dag | ||
drawdag | ||
edenapi | ||
encoding | ||
hg_watchman_client | ||
hgpython | ||
indexedlog | ||
linelog | ||
lz4-pyframe | ||
manifest | ||
minibench | ||
mpatch | ||
mpatch-sys | ||
mutationstore | ||
nodemap | ||
pathmatcher | ||
radixbuf | ||
revisionstore | ||
third-party | ||
treestate | ||
types | ||
url-ext | ||
vlqencoding | ||
watchman_client | ||
zstdelta | ||
Cargo.toml | ||
README.md |
lib
Any native code (C/C++/Rust) that Mercurial (either core or extensions)
depends on should go here. Python code, or native code that depends on
Python code (e.g. #include <Python.h>
or use cpython
) is disallowed.
As we start to convert more of Mercurial into Rust, and write new paths entrirely in native code, we'll want to limit our dependency on Python, which is why this barrier exists.
See also hgext/extlib/README.md
, mercurial/cext/README.mb
.
How do I choose between lib
and extlib
(and cext
)?
If your code is native and doesn't depend on Python (awesome!), it goes here.
Otherwise, put it in hgext/extlib
(if it's only used by extensions) or
mercurial/cext
(if it's used by extensions or core).