Skip to content

Commit ee7bd12

Browse files
diliopfacebook-github-bot
authored andcommitted
update to Rust 1.65.0
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
1 parent 7b3841f commit ee7bd12

File tree

10 files changed

+9
-15
lines changed

10 files changed

+9
-15
lines changed

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ debug = true
226226
[profile.dev]
227227
incremental = true
228228
debug = true
229-
panic = "abort"
230-
split-debuginfo = "unpacked"
229+
gpanic = "abort"
231230
opt-level = 1
232231

233232
[profile.test]

app/buck2_core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// Because Buck build uses different version of Rust than Cargo build.
1111
#![allow(stable_features)]
1212
#![feature(absolute_path)]
13-
#![feature(backtrace)]
1413
#![feature(const_fn_fn_ptr_basics)]
1514
#![feature(const_fn_trait_bound)]
1615
#![feature(const_panic)]

buck2_build_api/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#![feature(type_name_of_val)]
1717
#![feature(never_type)]
1818
#![feature(is_sorted)]
19-
#![feature(generic_associated_types)]
2019
#![feature(trait_alias)]
2120
// Plugins
2221
#![cfg_attr(feature = "gazebo_lint", feature(plugin))]

buck2_common/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@
1313
#![cfg_attr(feature = "gazebo_lint", feature(plugin))]
1414
#![cfg_attr(feature = "gazebo_lint", allow(deprecated))] // :(
1515
#![cfg_attr(feature = "gazebo_lint", plugin(gazebo_lint))]
16-
#![feature(backtrace)]
1716
#![feature(box_syntax)]
1817
#![feature(fs_try_exists)]
1918
#![feature(io_error_more)]
2019
#![feature(is_sorted)]
2120
#![feature(never_type)]
2221
#![feature(pattern)]
23-
#![feature(result_into_ok_or_err)]
2422

2523
#[cfg(test)]
2624
#[macro_use]

buck2_common/src/package_listing/file_listing.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,24 @@ impl PackageFileListing {
4141
use std::cmp::Ordering;
4242
let files = &self.files;
4343
let len = files.len();
44-
let lower = binary_search_by(len, |idx: usize| -> Ordering {
44+
let (Ok(lower) | Err(lower)) = binary_search_by(len, |idx: usize| -> Ordering {
4545
let x = files.get_index(idx).unwrap().as_str();
4646
if x.starts_with(prefix) {
4747
Ordering::Greater
4848
} else {
4949
x.cmp(prefix)
5050
}
5151
});
52-
let upper = binary_search_by(len, |idx: usize| -> Ordering {
52+
let (Ok(upper) | Err(upper)) = binary_search_by(len, |idx: usize| -> Ordering {
5353
let x = files.get_index(idx).unwrap().as_str();
5454
if x.starts_with(prefix) {
5555
Ordering::Less
5656
} else {
5757
x.cmp(prefix)
5858
}
5959
});
60-
(lower.into_ok_or_err()..upper.into_ok_or_err())
61-
.map(|idx: usize| files.get_index(idx).unwrap().as_ref())
60+
61+
(lower..upper).map(|idx: usize| files.get_index(idx).unwrap().as_ref())
6262
}
6363

6464
pub fn contains_file(&self, mut file: &PackageRelativePath) -> bool {

buck2_interpreter/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![feature(pattern)]
1414
#![feature(try_blocks)]
1515
#![feature(never_type)]
16-
#![feature(result_into_ok_or_err)]
1716
// Plugins
1817
#![cfg_attr(feature = "gazebo_lint", feature(plugin))]
1918
#![cfg_attr(feature = "gazebo_lint", allow(deprecated))] // :(

buck2_node/src/attrs/coerced_attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub enum CoercedAttr {
6363

6464
// This is just to help understand any impact that changes have to the size of this.
6565
// We store a lot of these, so we try to keep it to a reasonable size.
66-
static_assertions::assert_eq_size!(CoercedAttr, [usize; 5]);
66+
static_assertions::assert_eq_size!(CoercedAttr, [usize; 4]);
6767

6868
/// Provides roughly the stringified version of the starlark code that would produce this attr. For example, a dictionary
6969
/// of string keys and values may result in `{"key1":"value1","key2":"value2"}` (note that strings will explicitly include

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2022-08-06"
2+
channel = "nightly-2022-09-27"
33
components = ["llvm-tools-preview","rustc-dev"]

starlark-rust/starlark/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@
351351
#![feature(const_mut_refs)]
352352
#![feature(const_type_id)]
353353
#![cfg_attr(rust_nightly, feature(core_intrinsics))]
354-
#![feature(generic_associated_types)]
355354
#![feature(maybe_uninit_write_slice)]
356355
#![feature(ptr_metadata)]
357356
// Plugins

test.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ def rustfmt(buck2_dir: Path, ci: bool) -> None:
133133
"clippy::needless-match",
134134
"clippy::only-used-in-recursion",
135135
# Other
136-
"clippy::blacklisted-name", # Not using foo, bar, baz in test data is silly
136+
"clippy::disallowed_names", # Not using foo, bar, baz in test data is silly
137+
"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
137138
"clippy::cognitive_complexity", # This is an arbitrary linter
138139
"clippy::comparison_chain", # Generates worse code and harder to read
139140
"clippy::comparison_to_empty", # x == "" is clearer than x.is_empty()

0 commit comments

Comments
 (0)