Skip to content

Commit f0a47e3

Browse files
diliopfacebook-github-bot
authored andcommitted
Update platform010 & platform010-aarch64 symlinks
Summary: Upgrading Rust from `1.80.1` to `1.81.0` ([release notes](https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html)) with the following changes affecting `fbsource`: * Feature stabilizations: * `io_slice_advance` ([#62726](rust-lang/rust#62726)) * `panic_info_message` ([#66745](rust-lang/rust#66745)) * `fs_try_exists` ([#83186](rust-lang/rust#83186)) * `lint_reasons` ([#120924](rust-lang/rust#120924)) * `duration_abs_diff` ([#117618](rust-lang/rust#117618)) * `effects` ([#102090](rust-lang/rust#102090)) * New `clippy` lints: * `manual_inspect` ([#12287](rust-lang/rust-clippy#12287)) * `manual_pattern_char_comparison` ([#12849](rust-lang/rust-clippy#12849)) * Other: * `NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE` became a deny-by-default lint ([#126881](rust-lang/rust#126881) & [#123748](rust-lang/rust#123748)) * Changes to `stringify!` introducing whitespaces between some tokens ([#125174](rust-lang/rust#125174)) * `format!` is now marked with a `must_use` hint ([#127355](rust-lang/rust#127355)) ignore-conflict-markers Reviewed By: zertosh, dtolnay Differential Revision: D63864870 fbshipit-source-id: c8d61f3e9483ec709c8116514cfb030c883ec262
1 parent f459c08 commit f0a47e3

File tree

21 files changed

+35
-42
lines changed

21 files changed

+35
-42
lines changed

HACKING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ cargo install --path=app/buck2
2222
Or, alternatively, install it directly from GitHub:
2323

2424
```sh
25-
rustup install nightly-2024-06-08
26-
cargo +nightly-2024-06-08 install --git https://github.com/facebook/buck2.git buck2
25+
rustup install nightly-2024-07-21
26+
cargo +nightly-2024-07-21 install --git https://github.com/facebook/buck2.git buck2
2727
```
2828

2929
### Side note: using [Nix] to compile the source

allocative/allocative/src/rc_str.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use std::ops::Deref;
1414
use std::rc::Rc;
1515

1616
#[derive(Clone, Debug, PartialEq, Eq, Ord, PartialOrd)]
17+
#[allow(dead_code)]
1718
pub(crate) struct RcStr(Rc<str>);
1819

1920
impl<'a> From<&'a str> for RcStr {

app/buck2_build_api/src/actions/query.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,12 @@ pub fn iter_action_inputs<'a>(
417417
type Item = &'a SetProjectionInputs;
418418

419419
fn next(&mut self) -> Option<Self::Item> {
420-
self.queue.pop_front().map(|node| {
420+
self.queue.pop_front().inspect(|node| {
421421
for child in &*node.node.children {
422422
if self.visited.insert(child) {
423423
self.queue.push_back(child);
424424
}
425425
}
426-
427-
node
428426
})
429427
}
430428
}

app/buck2_common/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
//! Common core components of buck2
1313
14-
#![feature(fs_try_exists)]
1514
#![feature(io_error_more)]
1615
#![feature(is_sorted)]
1716
#![feature(map_try_insert)]

app/buck2_common/src/temp_path.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ mod tests {
7575
let temp_path = TempPath::new().unwrap();
7676
let path = temp_path.path().to_path_buf();
7777

78-
assert!(!fs::try_exists(&path).unwrap());
78+
assert!(!path.try_exists().unwrap());
7979

8080
fs::write(&path, "hello").unwrap();
8181

82-
assert!(fs::try_exists(&path).unwrap(), "Sanity check");
82+
assert!(path.try_exists().unwrap(), "Sanity check");
8383

8484
temp_path.close().unwrap();
8585

86-
assert!(!fs::try_exists(&path).unwrap());
86+
assert!(!path.try_exists().unwrap());
8787
}
8888
}

app/buck2_core/src/env/registry.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub struct EnvInfoEntry {
3030

3131
impl EnvInfoEntry {
3232
pub fn ty_short(&self) -> &'static str {
33-
self.ty.rfind(':').map_or(self.ty, |i| &self.ty[i + 1..])
33+
self.ty.rfind(':').map_or(self.ty, |i| &self.ty[i + 2..])
3434
}
3535
}
3636

@@ -53,7 +53,7 @@ mod tests {
5353
assert_eq!(
5454
&EnvInfoEntry {
5555
name: "TEST_VAR_1",
56-
ty: "std::string::String",
56+
ty: "std :: string :: String",
5757
default: None,
5858
applicability: Applicability::Internal,
5959
},

app/buck2_core/src/fs/fs_util.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ pub fn read_dir_if_exists<P: AsRef<AbsNormPath>>(path: P) -> Result<Option<ReadD
318318
pub fn try_exists<P: AsRef<AbsPath>>(path: P) -> Result<bool, IoError> {
319319
let _guard = IoCounterKey::Stat.guard();
320320
make_error!(
321-
fs::try_exists(path.as_ref().as_maybe_relativized()),
321+
path.as_ref().as_maybe_relativized().try_exists(),
322322
format!("try_exists({})", P::as_ref(&path).display())
323323
)
324324
}
@@ -1060,7 +1060,7 @@ mod tests {
10601060
let dir_path = root.join("dir");
10611061
create_dir_all(AbsPath::new(&dir_path)?)?;
10621062
assert_matches!(remove_file(&dir_path), Err(..));
1063-
assert!(fs::try_exists(&dir_path)?);
1063+
assert!(dir_path.try_exists()?);
10641064
Ok(())
10651065
}
10661066

@@ -1102,7 +1102,7 @@ mod tests {
11021102
let path = root.join("file");
11031103
fs::write(&path, b"regular")?;
11041104
remove_all(&path)?;
1105-
assert!(!fs::try_exists(&path)?);
1105+
assert!(!path.try_exists()?);
11061106
Ok(())
11071107
}
11081108

@@ -1114,7 +1114,7 @@ mod tests {
11141114
fs::create_dir(&path)?;
11151115
fs::write(path.join("file"), b"regular file in a dir")?;
11161116
remove_all(&path)?;
1117-
assert!(!fs::try_exists(&path)?);
1117+
assert!(!path.try_exists()?);
11181118
Ok(())
11191119
}
11201120

@@ -1163,7 +1163,7 @@ mod tests {
11631163
let file_path = root.join("file");
11641164
fs::write(&file_path, b"File content")?;
11651165
assert!(remove_dir_all(&file_path).is_err());
1166-
assert!(fs::try_exists(&file_path)?);
1166+
assert!(file_path.try_exists()?);
11671167
Ok(())
11681168
}
11691169

app/buck2_core/src/fs/paths/abs_norm_path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ fn verify_abs_path_windows_part(path: &str) -> bool {
853853
// TODO(nga): behavior of UNC paths is under-specified in `AbsPath`.
854854
let path = path.strip_prefix("\\\\.\\").unwrap_or(path);
855855

856-
for component in path.split(|c| c == '/' || c == '\\') {
856+
for component in path.split(['/', '\\']) {
857857
if component == "." || component == ".." {
858858
return false;
859859
}

app/buck2_core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#![feature(error_generic_member_access)]
1111
#![feature(decl_macro)]
12-
#![feature(fs_try_exists)]
1312
#![feature(never_type)]
1413
#![feature(pattern)]
1514
#![feature(box_patterns)]

app/buck2_daemon/src/daemonize.rs

+1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ type Errno = libc::c_int;
200200

201201
/// This error type for `Daemonize` `start` method.
202202
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Dupe)]
203+
#[allow(dead_code)]
203204
struct Error {
204205
kind: ErrorKind,
205206
}

app/buck2_test/src/local_resource_registry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl<'a> LocalResourceRegistry<'a> {
6565
futures::future::join_all(futs)
6666
.await
6767
.into_iter()
68-
.collect::<Result<_, _>>()?;
68+
.collect::<Result<(), _>>()?;
6969

7070
Ok::<(), anyhow::Error>(())
7171
};

docs/about/getting_started.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ To get started, first install [rustup](https://rustup.rs/), then compile the
1818
`buck2` executable:
1919

2020
```bash
21-
rustup install nightly-2024-06-08
22-
cargo +nightly-2024-06-08 install --git https://github.com/facebook/buck2.git buck2
21+
rustup install nightly-2024-07-21
22+
cargo +nightly-2024-07-21 install --git https://github.com/facebook/buck2.git buck2
2323
```
2424

2525
The above commands install `buck2` into a suitable directory, such as

gazebo/dupe/src/__macro_refs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
use crate::Dupe;
1313

1414
#[inline]
15-
pub const fn assert_dupe<T: Dupe + ?Sized>() {}
15+
pub const fn assert_dupe<T: Dupe>() {}

rust-toolchain

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
# * NOTE: You may have to change this file in a follow up commit as ocamlrep
1010
# has a dependency on buck2 git trunk.
1111

12-
# @rustc_version: rustc 1.80.0-nightly (804421dff 2024-06-07)
13-
channel = "nightly-2024-06-08"
12+
# @rustc_version: rustc 1.81.0-nightly (506985649 2024-07-20)
13+
channel = "nightly-2024-07-21"
1414
components = ["llvm-tools-preview","rustc-dev","rust-src"]

starlark-rust/starlark/src/tests/derive/freeze/basic.rs

+1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ use crate as starlark;
1919
use crate::values::Freeze;
2020

2121
#[derive(Freeze)]
22+
#[allow(dead_code)]
2223
struct TestUnitStruct;

starlark-rust/starlark/src/tests/uncategorized.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ fn test_fuzzer_59102() {
956956
let res: Result<AstModule, crate::Error> =
957957
AstModule::parse("hello_world.star", src.to_owned(), &Dialect::Standard);
958958
// The panic actually only happens when we format the result
959-
format!("{:?}", res);
959+
let _unused = format!("{:?}", res);
960960
}
961961

962962
#[test]
@@ -966,7 +966,7 @@ fn test_fuzzer_59371() {
966966
let res: Result<AstModule, crate::Error> =
967967
AstModule::parse("hello_world.star", src.to_owned(), &Dialect::Standard);
968968
// The panic actually only happens when we format the result
969-
format!("{:?}", res);
969+
let _unused = format!("{:?}", res);
970970
}
971971

972972
#[test]

starlark-rust/starlark/src/values/error.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,7 @@ impl ValueError {
100100

101101
/// Helper to create an [`OperationNotSupported`](ValueError::OperationNotSupported) error.
102102
#[cold]
103-
pub fn unsupported<'v, T, V: StarlarkValue<'v> + ?Sized>(
104-
_left: &V,
105-
op: &str,
106-
) -> crate::Result<T> {
103+
pub fn unsupported<'v, T, V: StarlarkValue<'v>>(_left: &V, op: &str) -> crate::Result<T> {
107104
Self::unsupported_owned(V::TYPE, op, None)
108105
}
109106

@@ -114,7 +111,7 @@ impl ValueError {
114111

115112
/// Helper to create an [`OperationNotSupported`](ValueError::OperationNotSupportedBinary) error.
116113
#[cold]
117-
pub fn unsupported_with<'v, T, V: StarlarkValue<'v> + ?Sized>(
114+
pub fn unsupported_with<'v, T, V: StarlarkValue<'v>>(
118115
_left: &V,
119116
op: &str,
120117
right: Value,

starlark-rust/starlark/src/values/layout/vtable.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ pub(crate) struct AValueVTable {
134134
allocative: unsafe fn(StarlarkValueRawPtr) -> *const dyn Allocative,
135135
}
136136

137-
struct GetTypeId<'v, T: StarlarkValue<'v> + ?Sized>(PhantomData<&'v T>);
137+
struct GetTypeId<'v, T: StarlarkValue<'v>>(PhantomData<&'v T>);
138138

139-
impl<'v, T: StarlarkValue<'v> + ?Sized> GetTypeId<'v, T> {
139+
impl<'v, T: StarlarkValue<'v>> GetTypeId<'v, T> {
140140
const TYPE_ID: ConstTypeId = ConstTypeId::of::<<T as ProvidesStaticType>::StaticType>();
141141
const STARLARK_TYPE_ID: StarlarkTypeId = StarlarkTypeId::of::<T>();
142142
}

starlark-rust/starlark/src/values/type_repr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl<T: StarlarkTypeRepr> StarlarkTypeRepr for SetType<T> {
8282
}
8383
}
8484

85-
impl<'v, T: StarlarkValue<'v> + ?Sized> StarlarkTypeRepr for T {
85+
impl<'v, T: StarlarkValue<'v>> StarlarkTypeRepr for T {
8686
type Canonical = Self;
8787

8888
fn starlark_type_repr() -> Ty {

starlark-rust/starlark/src/values/types/string/methods.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ pub(crate) fn string_methods(builder: &mut MethodsBuilder) {
10931093
let mut s = this;
10941094
let mut lines: Vec<StringValue> = Vec::new();
10951095
loop {
1096-
if let Some(x) = s.find(|x| x == '\n' || x == '\r') {
1096+
if let Some(x) = s.find(['\n', '\r']) {
10971097
let y = x;
10981098
let x = match s.get(y..y + 2) {
10991099
Some("\r\n") => y + 2,

starlark-rust/starlark/src/values/typing/type_compiled/compiled.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,10 @@ impl<'v, V: ValueLike<'v>> Hash for TypeCompiled<V> {
350350
impl<'v, V: ValueLike<'v>> PartialEq for TypeCompiled<V> {
351351
#[allow(clippy::manual_unwrap_or)]
352352
fn eq(&self, other: &Self) -> bool {
353-
match self.0.to_value().equals(other.0.to_value()) {
354-
Ok(b) => b,
355-
Err(_) => {
356-
// Unreachable, but we should not panic in `PartialEq`.
357-
false
358-
}
359-
}
353+
self.0
354+
.to_value()
355+
.equals(other.0.to_value())
356+
.unwrap_or_default()
360357
}
361358
}
362359

0 commit comments

Comments
 (0)