sapling/lib
David Tolnay f7011a3993 rust: Head start on some upcoming warnings
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
2019-07-12 00:55:53 -07:00
..
argparse Apply rustfmt to all rust files 2019-07-10 20:18:48 -07:00
asyncrevisionstore/src revisionstore: remove MutableHistoryStore::close 2019-05-21 15:25:28 -07:00
blackbox hg/blackbox: Fix unused return value warning 2019-07-11 14:46:20 -07:00
bookmarkstore rust: update to 2018 edition 2019-06-03 07:22:36 -07:00
cdatapack fix double free in cdatapack 2019-04-03 21:13:13 -07:00
clib Started Eden for Windows and integrated hg store with it. 2018-08-21 17:51:26 -07:00
clidispatch clidispatch: expose way to find a repo's root dir from current dir 2019-06-10 10:19:53 -07:00
cliparser rust: Head start on some upcoming warnings 2019-07-12 00:55:53 -07:00
commitcloudsubscriber Apply rustfmt to all rust files 2019-07-10 20:18:48 -07:00
configparser rust: Head start on some upcoming warnings 2019-07-12 00:55:53 -07:00
cpython-ext rust: update to 2018 edition 2019-06-03 07:22:36 -07:00
cpython-failure rust: update to 2018 edition 2019-06-03 07:22:36 -07:00
dag dag: update segment::Dag::max_level correctly 2019-05-13 18:51:45 -07:00
drawdag drawdag: implement a Rust drawdag library 2019-05-03 13:35:40 -07:00
edenapi rust: Head start on some upcoming warnings 2019-07-12 00:55:53 -07:00
encoding rust: update to 2018 edition 2019-06-03 07:22:36 -07:00
hg_watchman_client Apply rustfmt to all rust files 2019-07-10 20:18:48 -07:00
hgpython hgpython: use absolute path for Python argv[0] 2019-06-25 11:44:20 -07:00
indexedlog rust: Head start on some upcoming warnings 2019-07-12 00:55:53 -07:00
linelog linelog: update README 2018-11-08 12:34:36 -08:00
lz4-pyframe revisionstore: use Bytes instead of Box<[u8]> in Delta and DataEntry 2019-01-22 14:03:17 -08:00
manifest rust: Head start on some upcoming warnings 2019-07-12 00:55:53 -07:00
minibench minibench: fix IO measurement when running multiple times 2019-06-26 11:03:26 -07:00
mpatch rust: update to 2018 edition 2019-06-03 07:22:36 -07:00
mpatch-sys rust: update to 2018 edition 2019-06-03 07:22:36 -07:00
mutationstore rust: update to 2018 edition 2019-06-03 07:22:36 -07:00
nodemap Apply rustfmt to all rust files 2019-07-10 20:18:48 -07:00
pathmatcher pathmatcher: make gitignore "explain" low cost and more verbose 2019-05-17 14:25:26 -07:00
radixbuf rust: update to 2018 edition 2019-06-03 07:22:36 -07:00
revisionstore rust: Head start on some upcoming warnings 2019-07-12 00:55:53 -07:00
third-party xdiff: backport upstream changes 2018-04-13 21:51:48 -07:00
treestate rust: Head start on some upcoming warnings 2019-07-12 00:55:53 -07:00
types rust: Head start on some upcoming warnings 2019-07-12 00:55:53 -07:00
url-ext url-ext: add url-ext crate 2019-01-30 18:30:49 -08:00
vlqencoding Apply rustfmt to all rust files 2019-07-10 20:18:48 -07:00
watchman_client Apply rustfmt to all rust files 2019-07-10 20:18:48 -07:00
zstdelta Apply rustfmt to all rust files 2019-07-10 20:18:48 -07:00
Cargo.toml windows: switch to the new Python runtime 2019-06-24 08:34:23 -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).