diff --git a/Cargo.toml b/Cargo.toml index 050057b2cdb1..eeb9d738dd19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -226,8 +226,7 @@ debug = true [profile.dev] incremental = true debug = true -panic = "abort" -split-debuginfo = "unpacked" +gpanic = "abort" opt-level = 1 [profile.test] diff --git a/app/buck2_core/src/lib.rs b/app/buck2_core/src/lib.rs index 2ceb8788b85b..69e786a0d5b8 100644 --- a/app/buck2_core/src/lib.rs +++ b/app/buck2_core/src/lib.rs @@ -10,7 +10,6 @@ // Because Buck build uses different version of Rust than Cargo build. #![allow(stable_features)] #![feature(absolute_path)] -#![feature(backtrace)] #![feature(const_fn_fn_ptr_basics)] #![feature(const_fn_trait_bound)] #![feature(const_panic)] diff --git a/buck2_build_api/src/lib.rs b/buck2_build_api/src/lib.rs index f2952a91cc89..eb2b06f66409 100644 --- a/buck2_build_api/src/lib.rs +++ b/buck2_build_api/src/lib.rs @@ -16,7 +16,6 @@ #![feature(type_name_of_val)] #![feature(never_type)] #![feature(is_sorted)] -#![feature(generic_associated_types)] #![feature(trait_alias)] // Plugins #![cfg_attr(feature = "gazebo_lint", feature(plugin))] diff --git a/buck2_common/src/lib.rs b/buck2_common/src/lib.rs index e55a4b2ceee1..a19a3e270153 100644 --- a/buck2_common/src/lib.rs +++ b/buck2_common/src/lib.rs @@ -13,14 +13,12 @@ #![cfg_attr(feature = "gazebo_lint", feature(plugin))] #![cfg_attr(feature = "gazebo_lint", allow(deprecated))] // :( #![cfg_attr(feature = "gazebo_lint", plugin(gazebo_lint))] -#![feature(backtrace)] #![feature(box_syntax)] #![feature(fs_try_exists)] #![feature(io_error_more)] #![feature(is_sorted)] #![feature(never_type)] #![feature(pattern)] -#![feature(result_into_ok_or_err)] #[cfg(test)] #[macro_use] diff --git a/buck2_common/src/package_listing/file_listing.rs b/buck2_common/src/package_listing/file_listing.rs index cf6d97116732..7c5c27bb2fbd 100644 --- a/buck2_common/src/package_listing/file_listing.rs +++ b/buck2_common/src/package_listing/file_listing.rs @@ -41,7 +41,7 @@ impl PackageFileListing { use std::cmp::Ordering; let files = &self.files; let len = files.len(); - let lower = binary_search_by(len, |idx: usize| -> Ordering { + let (Ok(lower) | Err(lower)) = binary_search_by(len, |idx: usize| -> Ordering { let x = files.get_index(idx).unwrap().as_str(); if x.starts_with(prefix) { Ordering::Greater @@ -49,7 +49,7 @@ impl PackageFileListing { x.cmp(prefix) } }); - let upper = binary_search_by(len, |idx: usize| -> Ordering { + let (Ok(upper) | Err(upper)) = binary_search_by(len, |idx: usize| -> Ordering { let x = files.get_index(idx).unwrap().as_str(); if x.starts_with(prefix) { Ordering::Less @@ -57,8 +57,8 @@ impl PackageFileListing { x.cmp(prefix) } }); - (lower.into_ok_or_err()..upper.into_ok_or_err()) - .map(|idx: usize| files.get_index(idx).unwrap().as_ref()) + + (lower..upper).map(|idx: usize| files.get_index(idx).unwrap().as_ref()) } pub fn contains_file(&self, mut file: &PackageRelativePath) -> bool { diff --git a/buck2_interpreter/src/lib.rs b/buck2_interpreter/src/lib.rs index e5698915042e..d5ffadffecc7 100644 --- a/buck2_interpreter/src/lib.rs +++ b/buck2_interpreter/src/lib.rs @@ -13,7 +13,6 @@ #![feature(pattern)] #![feature(try_blocks)] #![feature(never_type)] -#![feature(result_into_ok_or_err)] // Plugins #![cfg_attr(feature = "gazebo_lint", feature(plugin))] #![cfg_attr(feature = "gazebo_lint", allow(deprecated))] // :( diff --git a/buck2_node/src/attrs/coerced_attr.rs b/buck2_node/src/attrs/coerced_attr.rs index bbf1b275b7d1..dcf262e6b009 100644 --- a/buck2_node/src/attrs/coerced_attr.rs +++ b/buck2_node/src/attrs/coerced_attr.rs @@ -63,7 +63,7 @@ pub enum CoercedAttr { // This is just to help understand any impact that changes have to the size of this. // We store a lot of these, so we try to keep it to a reasonable size. -static_assertions::assert_eq_size!(CoercedAttr, [usize; 5]); +static_assertions::assert_eq_size!(CoercedAttr, [usize; 4]); /// Provides roughly the stringified version of the starlark code that would produce this attr. For example, a dictionary /// of string keys and values may result in `{"key1":"value1","key2":"value2"}` (note that strings will explicitly include diff --git a/rust-toolchain b/rust-toolchain index 8863be80c196..d2b0399ee557 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2022-08-06" +channel = "nightly-2022-09-27" components = ["llvm-tools-preview","rustc-dev"] diff --git a/starlark-rust/starlark/src/lib.rs b/starlark-rust/starlark/src/lib.rs index 3407ccd5d43f..c616d30e8e08 100644 --- a/starlark-rust/starlark/src/lib.rs +++ b/starlark-rust/starlark/src/lib.rs @@ -351,7 +351,6 @@ #![feature(const_mut_refs)] #![feature(const_type_id)] #![cfg_attr(rust_nightly, feature(core_intrinsics))] -#![feature(generic_associated_types)] #![feature(maybe_uninit_write_slice)] #![feature(ptr_metadata)] // Plugins diff --git a/test.py b/test.py index e02721188a44..f33fd8c82380 100755 --- a/test.py +++ b/test.py @@ -133,7 +133,8 @@ def rustfmt(buck2_dir: Path, ci: bool) -> None: "clippy::needless-match", "clippy::only-used-in-recursion", # Other - "clippy::blacklisted-name", # Not using foo, bar, baz in test data is silly + "clippy::disallowed_names", # Not using foo, bar, baz in test data is silly + "clippy::bool-to-int-with-if", # Using if branches to return 1 or 0 is valid, but this complains that we should use `int::from`, which is arguably less clear "clippy::cognitive_complexity", # This is an arbitrary linter "clippy::comparison_chain", # Generates worse code and harder to read "clippy::comparison_to_empty", # x == "" is clearer than x.is_empty()