sapling/lib
David Tolnay 75ad2b3949 rust: Fix all fbcode warnings
Summary:
With this change, all Rust code in fbcode compiles with rustc 1.39 without warnings.

- Change UB uses of std::mem::uninitialized to MaybeUninit
- Remove unused `mut`
- Remove stray semicolons
- Remove unused imports
- Handle or explicitly ignore ignored errors
- Ignore dead code warnings in half-written projects
- Suppress warnings in bindgen-generated code

Reviewed By: andrewjcg

Differential Revision: D18363394

fbshipit-source-id: 2f9d587887aa0f8039c63202533bffba9006374f
2019-11-07 09:30:43 -08:00
..
asyncrevisionstore/src rust: Fix all fbcode warnings 2019-11-07 09:30:43 -08:00
auth update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
backingstore edenapi: log Mononoke Session IDs to blackbox 2019-11-04 05:53:15 -08:00
blackbox rust: Fix all fbcode warnings 2019-11-07 09:30:43 -08:00
bookmarkstore update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
cdatapack fix a warning about an ignored const keyword 2019-08-05 12:10:41 -07:00
clib types: rename Node to HgId 2019-10-18 18:13:31 -07:00
clidispatch clidispatch: support command name aliases 2019-11-05 21:35:42 -08:00
cliparser update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
commitcloudsubscriber rust: Fix all fbcode warnings 2019-11-07 09:30:43 -08:00
commitstore/bench-serialize update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
configparser update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
cpython-ext cpython-ext: add a serde serializer that outputs Python objects 2019-11-04 16:17:22 -08:00
cpython-failure lib: merge cpython-failure into cpython-ext 2019-11-04 16:17:22 -08:00
dag update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
drawdag update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
edenapi edenapi: log Mononoke Session IDs to blackbox 2019-11-04 05:53:15 -08:00
encoding update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
hg_watchman_client update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
hgcommands rust: Fix all fbcode warnings 2019-11-07 09:30:43 -08:00
hgtime update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
indexedlog rust: Fix all fbcode warnings 2019-11-07 09:30:43 -08:00
linelog linelog: update README 2018-11-08 12:34:36 -08:00
lz4-pyframe update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
manifest rust: Fix all fbcode warnings 2019-11-07 09:30:43 -08:00
mincode update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
minibench update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
mpatch update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
mpatch-sys update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
mutationstore update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
nodemap update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
pathmatcher update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
procinfo update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
radixbuf rust: Fix all fbcode warnings 2019-11-07 09:30:43 -08:00
revisionstore revisionstore: respect indexedlog config option 2019-11-07 08:53:40 -08:00
stackdesc update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
third-party mincode: initial boilerplate 2019-09-06 13:13:47 -07:00
tracing-collector hgcommands: setup tracing environment 2019-11-04 16:17:25 -08:00
treestate update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
types update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
util update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
vlqencoding update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
watchman_client update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
workingcopy update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
xdiff set XDF_INDENT_HEURISTIC for cleaner diffs 2019-11-05 07:05:12 -08:00
xdiff-sys import full-blown bindgen for xdiff 2019-11-05 07:05:11 -08:00
zstdelta update copyright notices in Rust files 2019-11-01 17:39:42 -07:00
CMakeLists.txt backingstore: make backingstore buildable with CMake 2019-10-19 18:48:44 -07:00
README.md READMEs: tweaks based on feedback 2018-01-12 12:35:52 -08:00

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).