Summary: Copy `rustfml.toml` to `oss` folders. Reviewed By: ndmitchell Differential Revision: D31384135 fbshipit-source-id: 5e70b5963a085dd3967bbb47e7a76abef5540033
group_imports = StdExternalCrate
Summary:
Default value is `group_imports = "Preserve"` which means imports do not get normalized:
```
use foo::Bar;
use foo::Baz;
```
is not converted to:
```
use foo::{Bar, Baz};
```
[Option documentation](https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#group_imports)
Reviewed By: ndmitchell
Differential Revision: D31384214
fbshipit-source-id: e28c94428936f40888dbf4ab7caedf461d68ee04Summary: Allows deleting the --dry-run more easily for copying and pasting commands. Reviewed By: stepancheg Differential Revision: D31532980 fbshipit-source-id: a40b1a4808702214986108072c1ef7d176da43a9
buck2: update Cargo builds to nightly 2021-10-22
Reviewed By: ndmitchell Differential Revision: D31860069 fbshipit-source-id: d700f615fb42c93c8160fac0906bf742d17f722c
buck2: bring back plugins in the Buck build
Summary: This actually got removed in 1.54, so it's not there in the fbcode build either. Reviewed By: ndmitchell Differential Revision: D31861469 fbshipit-source-id: b68a25fd4b93137ec8a7cd562c807b59f59b0a8e
Summary: Let's be consistent with what is used internally to avoid e.g. spurious warnings when we use `std::convert::TryInto`. Reviewed By: ndmitchell Differential Revision: D31959259 fbshipit-source-id: 32516b810ac227df2546f64efa083127bce83b95
Summary: Config changes + source fixes to upgrade Rust to 1.57.0 Reviewed By: dtolnay Differential Revision: D32852266 fbshipit-source-id: b7fc82e3cd82ec8611b68778d9c996e417a65725
Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov Differential Revision: D33331547 fbshipit-source-id: fddadfac2d2c3fbb8bd879d6030f726ed6b89ce8
Summary: Life is easier when the same version of the library is used everywhere. 1.0.40 is max version among used versions in all crates. Reviewed By: ndmitchell Differential Revision: D34111550 fbshipit-source-id: e75ae2844df24a0c375e2d0e043eac7da454c71b
Summary: [Explanation how it works](https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html). This might result in some overbuilding when using cargo (for example when dependencies and dev-dependencies specify dependencies with different "features"). But it is safer and more obvious. For example, superconsole crate specifies `edition = "2021"`, which implies `resolver = "2"`. So when superconsole is built as standalone project it uses v2 resolver, and when it builds as part of buck2, it uses v1 resolver. Practically it does not change much for us (although `cargo tree -e features` shows some changes). Reviewed By: ndmitchell Differential Revision: D34198127 fbshipit-source-id: e233aa4ff7281d70f97c3b66e713ed32f6ec0da2
Rename all lints to start with gazebo_lint
Summary: Clippy has a prefix, so I think gazebo_lint should do too. Given the name is gazebo_lint, the only real options are gazebo and gazebo_lint. It feels odd to have `gazebo_` hints for anyhow, but having gazebo_lint hints isn't too bad. As an added advantage, if anyone comes across a lint supression and wants to know why it is there, they can search for gazebo_lint and find the right thing, rather than the wrong thing. Overall, those extra 5 characters make things a fair bit clearer. Reviewed By: bobyangyf Differential Revision: D34524148 fbshipit-source-id: 72a918f63672c49e1b087c9ec228e279ea9e627f
Summary: We had one that was totally unnecessary, a bunch in the DICE tests which were redundant, and the remaining 3 instances are all somewhat suspect. Leave them with ignores for now, but none of them look 100% right. Reviewed By: krallin Differential Revision: D34378448 fbshipit-source-id: 66fd2c70a5545fcbc717cf5d12d589f6e9397570
Summary: Generated by `tools/arcanist/lint/codemods/rustfmt-fbsource` with the rustfmt executable added by D35234535. drop-conflicts Reviewed By: zertosh Differential Revision: D35234521 fbshipit-source-id: 1938c1bb5c8d967695a89ae27e1c4c2dff00d376
update rustfmt.toml and run rustfmt
Summary: With new `rustfmt`. Reviewed By: milend Differential Revision: D35240293 fbshipit-source-id: 7503cec6d54836aa051cb3a2632a5c21646c3cfe
Make Dupe suggestions machine-applicable
Summary: When you add `Dupe` to something that was previously `Clone`, you often get dozens of lint errors complaining that your calls to `.clone()` should instead by `.dupe()`. The linter should fix these errors for me. This diff replaces several lints with machine-applicable suggestions that replace `clone` with `dupe` and `cloned` with `duped`, if the underlying type is `Dupe`. Reviewed By: krallin Differential Revision: D35132390 fbshipit-source-id: d2f922d122d4869d5a6bf3a3f79ec0892b01201c
Handle new ExprKind::MethodCall
Summary: rust-lang/rust@b117335 MethodCall's span was removed, and uses replaced with the identifiers span Reviewed By: ndmitchell Differential Revision: D35597503 fbshipit-source-id: 8c0feac93e63229d9dd0d9a25f1d51e4ba35f1c2
Summary: Ty became an Intern of TyS use Ty type rust-lang/rust@e9a0c42 Reviewed By: ndmitchell Differential Revision: D35597415 fbshipit-source-id: eb1aa08e5efcc0336a9f8aac3fdd79502e833455
item_children to module_children
Summary: This was renamed in rust-lang/rust@3051f6e Reviewed By: ndmitchell Differential Revision: D35599245 fbshipit-source-id: c9014929d520a10c52f884a3fce4e5948eed3c7c
Update rust to nightly-2022-02-24
Reviewed By: stepancheg Differential Revision: D35600352 fbshipit-source-id: a3160243cacc34706ee39719c87ffc41a2b6dabc
Reviewed By: ndmitchell Differential Revision: D36930916 fbshipit-source-id: 01eee1a51cbefceb049dec602e4a60b6ef4f5d80
Back out rust 1.61.0 upgrade from fbcode and xplat
Summary:
This reverts the following stack of 4 diffs:
- {D36877131}
- {D36887647}
- {D36888466}
- {D36930916 (c4f0de9)}
until someone on the Rust team has a chance to investigate an extreme regression in compile time/memory, and we have either a workaround or a backported fix.
Reviewed By: zertosh, diliop
Differential Revision: D37023453
fbshipit-source-id: f7667041738fc3f0542e571fab578c422164de4cUpdate to 1.61.0 in fbcode and xplat (2nd attempt)
Summary: This diff consists of `hg backout D37023453 (https://github.com/facebookincubator/gazebo_lint/commit/63bb3ebe9b297130c8277dbd543989d2652cf51e)` ({D37023453 (63bb3eb)}) + `tp2_update_fbcode rust` to pick up {D37030185}. See summary of D37030185 for a description of the regression in the first 1.61.0 upgrade. In brief, rustc switching from `num_cpus` to `available_parallelism` resulted in misidentifying the number of available CPUs in some environments including Remote Execution, resulting in enormously increased memory usage and failing builds. I simply reverted that to go back to `num_cpus`, same as what was used in all prior Rust versions. Reviewed By: zertosh, diliop Differential Revision: D37036063 fbshipit-source-id: 9520b93b07620fbb35ab7902b8975be9ac329a11
Reviewed By: ndmitchell Differential Revision: D37285539 fbshipit-source-id: 2aaee71f9f3a3f7e26da858182369674463cca7f
Summary: We moved how we did formatting, so this fixes open source projects to match. Reviewed By: krallin Differential Revision: D37306151 fbshipit-source-id: 067e62f7c65c50197f38f71c25aa4627e22cf779
Summary:
Left after mass reformatting.
`foo::{self}` conversion to `foo` is not equivalent, that's why `rustfmt` doesn't do it.
Reviewed By: ndmitchell
Differential Revision: D37335581
fbshipit-source-id: df7de0dead5fa0ce735e963e1b977a8450cd7699remove deprecated rustfmt config: merge_imports
Summary: `merge_imports = true` is deprecated and has already been replaced by `imports_granularity = "Item"` This is just a clean up diff so that `cargo fmt` does not give warnings about deprecated field usage. Reviewed By: ndmitchell Differential Revision: D37326838 fbshipit-source-id: 2e8ace2f7d4040308e61b30bf2f8db57fd7a612b
Reformat more code to one import per line
Summary: `./test.py --rustfmt-only` does not reformat these (don't know why). This is preparation to reformat whole fbsource. ``` find fbcode/buck2 -name '*.rs' | xargs arc rustfmt --config group_imports=StdExternalCrate,imports_granularity=Item ``` Reviewed By: ndmitchell Differential Revision: D37524079 fbshipit-source-id: 1087335107e0f722d47abcced4056338d49b3d54
Fix up the gazebo links for open source
Summary: We need to use the released Gazebo. Differential Revision: D39097135 fbshipit-source-id: 5c69f42e9f44d5c4f8b322a6b541d160f8f3722c
Summary: It includes this fix which was backported to 1.62.1. rust-lang/rust#98950 `2022-08-06` is what will become 1.64.0. Changes are caused by: - Split TypeVisitable from TypeFoldable: rust-lang/rust#98206 - Remove `fn backtrace` and replace with usages of provider API: rust-lang/rust#99431 Reviewed By: stepancheg Differential Revision: D39277984 fbshipit-source-id: 5afc6c2b9e5ee3074ea0ede995868aef12cebf14
Summary: https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html Reviewed By: diliop, dtolnay Differential Revision: D39825734 fbshipit-source-id: 4a789f2c24707fbc6a14b506448d405d5a60a53d
Summary: Diffs D39856587 D39856917 D39856847 D39856746 change oss mapping of `rustfmt.toml` to take global `rustfmt.toml`. Mapping `rustfmt.toml` for dice seemed to work, now do the rest. Reviewed By: ndmitchell Differential Revision: D40020242 fbshipit-source-id: e9c32c55b06c10bed42e043f33b5e0deb37974ed
Re-sync with internal repository (#2)
Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
Summary: Required to get the Coerce for PhantomData. Already released to crates.io, so now updating the code too. Reviewed By: krallin Differential Revision: D40475858 fbshipit-source-id: ca486a80ebf8b210fc76694a70fb329710a0adf5
Summary: Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes: * Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573) * Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604) * Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015) * Account for [`Error` trait move into core](rust-lang/rust#99917) * Account for `#[warn(non_camel_case_types)]` * Various function signature, lifetime requirement changes and lint fixes Reviewed By: zertosh Differential Revision: D40923615 fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
Reviewed By: dtolnay Differential Revision: D43018241 fbshipit-source-id: 1aeb19c49b2fa5a8bec918d3d9d421545ceafbeb
Reviewed By: dtolnay Differential Revision: D43074470 fbshipit-source-id: 1d2654b1d82f6ddde7082ac23cc4090abcf6096f
Gazebo: Remove lint recommending box syntax
Summary: See next diff Reviewed By: bobyangyf Differential Revision: D43684866 fbshipit-source-id: 5d47f0fa906300498483ecfd0a895c3cb3a36d2c
gazebo_lint: Remove #![feature(box_syntax)]
Summary: See first diff in stack Reviewed By: bobyangyf Differential Revision: D43683115 fbshipit-source-id: 8ffd1732110816ce6664b01d30ff0cf4ea965d79
Add support for clippy.toml configuration file
Summary: I am interested in running clippy under buck2 in CI for https://github.com/dtolnay/cxx, but I need it to be configured with `msrv = "..."` the same as my Cargo builds. Reviewed By: diliop Differential Revision: D43991741 fbshipit-source-id: c9a6a923651cebf5f24a48c6cd5daac0631cb763
Summary: Release notes: https://blog.rust-lang.org/2023/04/20/Rust-1.69.0.html Reviewed By: zertosh Differential Revision: D45267362 fbshipit-source-id: 57439306c2b6efc584947f9931b32ca87493b80e
Summary: See toolchain upgrade in D46375839 for context Reviewed By: ndmitchell Differential Revision: D46418580 fbshipit-source-id: 40a7c4dc8d640c8e2cfb2240e5b349cb8c679b14
Migrate "buck2/gazebo_lint" from LLVM-12 to LLVM-15
Summary: fbcode is migrating to LLVM-15 for safer and more up-to-date code and new compiler features. All contbuilds in your directory have passed our build test with LLVM-15, and your directory does not host any packages. This diff will migrate it to LLVM-15. If you approve of this diff, please use the "Accept & Ship" button. If you have a reason for why it should not build with LLVM 15, please make a comment and send it back to author. Otherwise we will land this on Tuesday 06/13/2023. See the [FAQ post](https://fb.workplace.com/groups/llvm15platform010/posts/749154386769776/)! Please also direct any questions to [this group](https://fb.workplace.com/groups/llvm15platform010). - If you approve of this diff, please use the "Accept & Ship" button :-) Build directives: Reviewed By: krallin Differential Revision: D46617428 fbshipit-source-id: e4f3d018c37c922c8fe491f411f0603589f4ba5f
update platform010, platform010-arch64 & xplat to 1.71.0+beta.3
Summary: Updating from `1.70.0` to `1.71.0-beta.3` Reviewed By: shayne-fletcher Differential Revision: D47024080 fbshipit-source-id: aaa0d53b65d842e3ccc7faf0207df5b4ca8c8531
Eliminate dependency on unmaintained node12-based action
Reviewed By: diliop Differential Revision: D47220090 fbshipit-source-id: 0b69dcce8115db028d194746fb1fc4fa2d283ad4
Re-sync with internal repository (#3)
Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
Summary: See the next diff. Splitting this out so that I can mark it as a codemod Reviewed By: shonaganuma Differential Revision: D50440122 fbshipit-source-id: ca19eaac6af77f249ec1bb24d5f522b4a94509d9
Reviewed By: JakobDegen Differential Revision: D51176164 fbshipit-source-id: cb42c744bd68ca32905b72b28db8d415b9bbb554