Skip to content

Commit 6c7d8d9

Browse files
diliopfacebook-github-bot
authored andcommitted
Update platform010 & platform010-aarch64 symlinks
Summary: Release notes: https://blog.rust-lang.org/2025/05/15/Rust-1.87.0/ Relevant changes: * `feature(extract_if)` stabilized * `feature(ptr_sub_ptr)` stabilized * `feature(os_str_display)` stabilized * `feature(slice_take)` stabilized * `feature(hash_raw_entry)` removed * `sub_ptr` renamed to `offset_from_unsigned` ([#137483](rust-lang/rust#137483)) * `MaybeUninit::uninit_array()` uses replaced with inline const blocks ([#125082](rust-lang/rust#125082)) * Lint `#[must_use`] attributes applied to methods in trait impls ([#136923](rust-lang/rust#136923)) * `clippy` lints: `io_other_error`, `elidable_lifetime_names`, `mem_replace_option_with_some`, `manual_contains`, `owned_cow` Reviewed By: dtolnay Differential Revision: D75010345 fbshipit-source-id: ab6ee65fe82eb7fe90b5aa9bbeeedefed2befad1
1 parent 90f3440 commit 6c7d8d9

File tree

37 files changed

+58
-59
lines changed

37 files changed

+58
-59
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ rand_distr = "0.4"
252252
ref-cast = "1.0.0"
253253
regex = "1.5.4"
254254
relative-path = { version = "1.7.0", features = ["serde"] }
255-
rusqlite = { version = "0.32.1", features = ["bundled"] }
255+
rusqlite = { version = "0.33.0", features = ["bundled"] }
256256
rustc-hash = { version = "2.1" }
257257
rustls = "0.21.5"
258258
rustls-native-certs = { package = "rustls-native-certs", version = "0.6.2" }

HACKING.md

Lines changed: 2 additions & 2 deletions
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-2025-02-16
26-
cargo +nightly-2025-02-16 install --git https://github.com/facebook/buck2.git buck2
25+
rustup install nightly-2025-03-29
26+
cargo +nightly-2025-03-29 install --git https://github.com/facebook/buck2.git buck2
2727
```
2828

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

allocative/allocative/src/flamegraph.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ impl VisitorImpl for FlameGraphBuilder {
451451
self.current().current_data().unique = true;
452452
}
453453

454-
#[must_use]
455454
fn enter_shared_impl(
456455
&mut self,
457456
name: Key,

app/buck2_action_impl/src/actions/impls/run.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ pub(crate) struct RunAction {
305305
input_files_bytes: u64,
306306
}
307307

308+
#[allow(clippy::large_enum_variant)]
308309
enum ExecuteResult {
309310
LocalDepFileHit(ActionOutputs, ActionExecutionMetadata),
310311
ExecutedOrReHit {

app/buck2_build_api/src/build/build_report.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ impl<'a> BuildReportCollector<'a> {
645645
self.strings
646646
.get(&out.last().unwrap().message_content)
647647
.unwrap()
648-
.to_string(),
648+
.to_owned(),
649649
);
650650
}
651651

app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_definition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl<V: ValueLifetimeless> TransitiveSetOperationsGen<V> {
146146
.iter()
147147
.filter_map(|(k, spec)| {
148148
if kind == spec.kind {
149-
Some(k.to_string())
149+
Some(k.to_owned())
150150
} else {
151151
None
152152
}

app/buck2_client_ctx/src/daemon/client/connect.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ async fn start_new_buckd_and_connect(
869869
Ok(client)
870870
}
871871

872+
#[allow(clippy::large_enum_variant)]
872873
enum ConnectBeforeRestart {
873874
Accepted(BootstrapBuckdClient),
874875
Rejected,

app/buck2_client_ctx/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#![feature(try_trait_v2)]
1616
#![feature(used_with_arg)]
1717
#![feature(round_char_boundary)]
18-
#![feature(extract_if)]
1918

2019
pub mod argfiles;
2120
pub mod client_cpu_tracker;

app/buck2_client_ctx/src/subscribers/superconsole.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ pub const CUTOFFS: Cutoffs = Cutoffs {
8989
_notable: Duration::from_millis(200),
9090
};
9191

92+
#[allow(clippy::large_enum_variant)]
9293
pub enum StatefulSuperConsole {
9394
Running(StatefulSuperConsoleImpl),
9495
/// After receiving the command output, any stdout, or an event stream error, the superconsole

app/buck2_cmd_completion_client/src/complete.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl CompleteCommand {
108108
matches: BuckArgMatches<'_>,
109109
ctx: ClientCommandContext<'_>,
110110
) -> ExitResult {
111-
let exit_result = match self.partial_target.split(':').collect::<Vec<_>>()[..] {
111+
match self.partial_target.split(':').collect::<Vec<_>>()[..] {
112112
// Package completion is performed locally and called here directly
113113
[given_partial_package] => {
114114
let roots = &ctx.paths()?.roots;
@@ -130,8 +130,7 @@ impl CompleteCommand {
130130
"Malformed target string (expected [[cell]//][path/to/package][:target_name])",
131131
)
132132
.into(),
133-
};
134-
exit_result
133+
}
135134
}
136135
}
137136

app/buck2_cmd_completion_client/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* of this source tree.
88
*/
99

10+
#![allow(clippy::result_large_err)]
1011
#![feature(used_with_arg)]
1112

1213
pub mod complete;

app/buck2_common/src/legacy_configs/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ impl LegacyConfigParser {
203203
.iter()
204204
.map(|(k, v)| {
205205
v.values.iter().map(|(key, value)| buck2_data::ConfigValue {
206-
section: k.to_string(),
207-
key: key.to_string(),
206+
section: k.to_owned(),
207+
key: key.to_owned(),
208208
value: value.raw_value().to_owned(),
209209
cell: None,
210210
is_cli,

app/buck2_error_derive/src/attr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ use syn::spanned::Spanned;
3838
use syn::token;
3939

4040
/// Did the user provide an explicit value for the option, or a function from which to compute it
41+
#[allow(clippy::large_enum_variant)]
4142
#[derive(Clone)]
4243
pub enum OptionStyle {
4344
Explicit(syn::Ident),

app/buck2_event_observer/src/two_snapshots.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* of this source tree.
88
*/
99

10-
use std::mem;
1110
use std::time::Duration;
1211
use std::time::SystemTime;
1312

@@ -19,7 +18,7 @@ pub struct TwoSnapshots {
1918

2019
impl TwoSnapshots {
2120
pub fn update(&mut self, timestamp: SystemTime, snapshot: &buck2_data::Snapshot) {
22-
self.penultimate = mem::replace(&mut self.last, Some((timestamp, snapshot.clone())));
21+
self.penultimate = self.last.replace((timestamp, snapshot.clone()));
2322
}
2423

2524
fn non_zero_duration(&self) -> Option<Duration> {

app/buck2_forkserver/src/win/child_process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl Future for ChildProcess {
5656
if let Some(ref mut w) = inner.waiting {
5757
match Pin::new(&mut w.rx).poll(cx) {
5858
Poll::Ready(Ok(())) => {}
59-
Poll::Ready(Err(e)) => Err(io::Error::new(io::ErrorKind::Other, e))?,
59+
Poll::Ready(Err(e)) => Err(io::Error::other(e))?,
6060
Poll::Pending => return Poll::Pending,
6161
}
6262
let status = inner.inner.try_wait()?.ok_or(io::Error::new(

app/buck2_http/src/client.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,7 @@ where
219219
async fn read_truncated_error_response(
220220
mut resp: Response<BoxStream<'_, hyper::Result<Bytes>>>,
221221
) -> String {
222-
let read = StreamReader::new(
223-
resp.body_mut()
224-
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e)),
225-
);
222+
let read = StreamReader::new(resp.body_mut().map_err(std::io::Error::other));
226223
let mut buf = Vec::with_capacity(1024);
227224
read.take(1024).read_to_end(&mut buf).await.map_or_else(
228225
|e| format!("Error decoding response: {:?}", e),
@@ -234,8 +231,7 @@ async fn read_truncated_error_response(
234231
/// Warning: This does no length checking (like hyper::body::to_bytes). Should
235232
/// only be used for trusted endpoints.
236233
pub async fn to_bytes(body: BoxStream<'_, hyper::Result<Bytes>>) -> anyhow::Result<Bytes> {
237-
let mut reader =
238-
StreamReader::new(body.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e)));
234+
let mut reader = StreamReader::new(body.map_err(std::io::Error::other));
239235
let mut buf = Vec::new();
240236
reader
241237
.read_to_end(&mut buf)

app/buck2_http/src/proxy.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ impl NoProxy {
178178
fn should_bypass_proxy_for_host<S: AsRef<str>>(&self, host: S) -> bool {
179179
let host = host.as_ref();
180180
if let Ok(host_address) = host.parse::<IpAddr>() {
181-
self.addresses
182-
.iter()
183-
.any(|address| host_address == *address)
181+
self.addresses.contains(&host_address)
184182
|| self
185183
.networks
186184
.iter()

app/buck2_interpreter_for_build/src/interpreter/build_context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ enum BuildContextError {
5555
BasePathOnlyDefinedForPackageOrBuildFile(StarlarkFileType),
5656
}
5757

58+
#[allow(clippy::large_enum_variant)]
5859
#[derive(Debug)]
5960
pub enum PerFileTypeContext {
6061
/// Context for evaluating `BUCK` files.

app/buck2_query/src/query/graph/async_bfs.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99

1010
use std::future;
11-
use std::mem;
1211

1312
use buck2_error::BuckErrorContext;
1413
use buck2_error::internal_error;
@@ -142,14 +141,12 @@ pub(crate) async fn async_bfs_find_path<'a, N: LabeledNode + 'static>(
142141
path.reverse();
143142
return Ok(Some(path));
144143
}
145-
let prev = mem::replace(
146-
&mut visited
147-
.visited
148-
.get_mut(&key)
149-
.with_internal_error(|| format!("missing node {}", key))?
150-
.node,
151-
Some(node),
152-
);
144+
let prev = visited
145+
.visited
146+
.get_mut(&key)
147+
.with_internal_error(|| format!("missing node {}", key))?
148+
.node
149+
.replace(node);
153150
if prev.is_some() {
154151
return Err(internal_error!("duplicate node {}", key));
155152
}

app/buck2_query/src/query/graph/vec_as_map.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use std::fmt;
1313
use std::fmt::Debug;
14-
use std::mem;
1514

1615
/// Map `u32` to `T`.
1716
pub(crate) struct VecAsMap<T> {
@@ -58,6 +57,6 @@ impl<T> VecAsMap<T> {
5857
if self.vec.len() <= index as usize {
5958
self.vec.resize_with(index as usize + 1, || None);
6059
}
61-
mem::replace(&mut self.vec[index as usize], Some(value))
60+
self.vec[index as usize].replace(value)
6261
}
6362
}

app/buck2_server/src/daemon/server.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ impl BuckdServer {
560560
}
561561

562562
/// Checks if the server is accepting requests.
563+
#[allow(clippy::result_large_err)]
563564
fn check_if_accepting_requests(&self) -> Result<(), Status> {
564565
if self.0.stop_accepting_requests.load(Ordering::Relaxed) {
565566
Err(Status::failed_precondition(
@@ -571,6 +572,7 @@ impl BuckdServer {
571572
}
572573
}
573574

575+
#[allow(clippy::result_large_err)]
574576
fn convert_positive_duration(proto_duration: &prost_types::Duration) -> Result<Duration, Status> {
575577
if proto_duration.seconds < 0 || proto_duration.nanos < 0 {
576578
return Err(Status::new(
@@ -1494,6 +1496,7 @@ impl DaemonApi for BuckdServer {
14941496

14951497
/// Options to configure the execution of a oneshot command (i.e. what happens in `oneshot()`).
14961498
trait OneshotCommandOptions: Send + Sync + 'static {
1499+
#[allow(clippy::result_large_err)]
14971500
fn pre_run(&self, server: &BuckdServer) -> Result<(), Status> {
14981501
server.check_if_accepting_requests()
14991502
}

app/buck2_server_ctx/src/stderr_output_guard.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ impl Write for StderrOutputWriter {
110110
if len > 0 {
111111
let s = StderrOutputWriter::truncate_str(buf, len)?;
112112
if s.is_empty() {
113-
return Err(io::Error::new(
114-
io::ErrorKind::Other,
113+
return Err(io::Error::other(
115114
"Configured chunk size is not enough to hold a single utf-8 character",
116115
));
117116
}

app/buck2_test/src/orchestrator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,9 +1342,9 @@ impl BuckTestOrchestrator<'_> {
13421342
dice: &mut DiceComputations<'_>,
13431343
test_target: &ConfiguredProvidersLabel,
13441344
test_info: &FrozenExternalRunnerTestInfo,
1345-
cmd: Cow<'a, Vec<ArgValue>>,
1345+
cmd: Cow<'a, [ArgValue]>,
13461346
env: Cow<'a, SortedVectorMap<String, ArgValue>>,
1347-
pre_create_dirs: Cow<'a, Vec<DeclaredOutput>>,
1347+
pre_create_dirs: Cow<'a, [DeclaredOutput]>,
13481348
executor_fs: &ExecutorFs<'_>,
13491349
prefix: TestExecutionPrefix,
13501350
opts: TestSessionOptions,
@@ -1714,7 +1714,7 @@ struct Execute2RequestExpander<'a> {
17141714
output_root: &'a ForwardRelativePath,
17151715
declared_outputs: &'a mut IndexMap<BuckOutTestPath, OutputCreationBehavior>,
17161716
fs: &'a ExecutorFs<'a>,
1717-
cmd: Cow<'a, Vec<ArgValue>>,
1717+
cmd: Cow<'a, [ArgValue]>,
17181718
env: Cow<'a, SortedVectorMap<String, ArgValue>>,
17191719
}
17201720

app/buck2_util/src/future.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
use std::future::Future;
1111
use std::iter;
12-
use std::mem;
1312

1413
use futures::FutureExt;
1514
use futures::StreamExt;
@@ -64,7 +63,7 @@ where
6463
while let Some((i, res)) = futs.next().await {
6564
match res {
6665
Ok(v) => {
67-
let prev = mem::replace(&mut outputs[i], Some(v));
66+
let prev = outputs[i].replace(v);
6867
assert!(prev.is_none());
6968
}
7069
Err(e) => return Err(e),

app/buck2_util/src/network_speed_average.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* of this source tree.
88
*/
99

10-
use std::mem;
1110
use std::time::Duration;
1211
use std::time::SystemTime;
1312

@@ -34,7 +33,7 @@ impl NetworkSpeedAverage {
3433
/// Each update value must be greater than or equal to the previous one.
3534
/// Equal values are ignored during average calculation.
3635
pub fn update(&mut self, timestamp: SystemTime, value: u64) {
37-
let last = mem::replace(&mut self.last_snapshot, Some(Snapshot { timestamp, value }));
36+
let last = self.last_snapshot.replace(Snapshot { timestamp, value });
3837
if let Some((duration, value)) =
3938
NetworkSpeedAverage::elapsed_if_value_changed(&last, &Snapshot { timestamp, value })
4039
{

dice/dice/src/future.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use std::future::Future;
1313
use std::iter;
14-
use std::mem;
1514

1615
use futures::FutureExt;
1716
use futures::StreamExt;
@@ -66,7 +65,7 @@ where
6665
while let Some((i, res)) = futs.next().await {
6766
match res {
6867
Ok(v) => {
69-
let prev = mem::replace(&mut outputs[i], Some(v));
68+
let prev = outputs[i].replace(v);
7069
assert!(prev.is_none());
7170
}
7271
Err(e) => return Err(e),

docs/about/getting_started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ To get started, first install [rustup](https://rustup.rs/), then compile the
2020
`buck2` executable:
2121

2222
```bash
23-
rustup install nightly-2025-02-16
24-
cargo +nightly-2025-02-16 install --git https://github.com/facebook/buck2.git buck2
23+
rustup install nightly-2025-03-29
24+
cargo +nightly-2025-03-29 install --git https://github.com/facebook/buck2.git buck2
2525
```
2626

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

rust-toolchain

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
# has a dependency on buck2 git trunk.
1212
# * Update `../monarch/rust-toolchain` (one instance)
1313

14-
# @rustc_version: rustc 1.86.0-nightly (9cd60bd2c 2025-02-15)
15-
channel = "nightly-2025-02-16"
14+
# @rustc_version: rustc 1.87.0-nightly (920d95eaf 2025-03-28)
15+
channel = "nightly-2025-03-29"
1616
components = ["llvm-tools-preview","rustc-dev","rust-src"]

starlark-rust/starlark/src/collections/alloca.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl Alloca {
171171
// If the pointer changed, it means a callback called alloca again,
172172
// which allocated a new buffer. So we are abandoning the current allocation here,
173173
// and new allocations will use the new buffer even if the current buffer has space.
174-
if likely(self.alloc.get() == stop) {
174+
if likely(std::ptr::eq(self.alloc.get(), stop)) {
175175
self.alloc.set(old);
176176
}
177177

starlark-rust/starlark/src/docs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ pub struct DocProperty {
200200
}
201201

202202
/// A named member of an object.
203+
#[allow(clippy::large_enum_variant)]
203204
#[derive(Debug, Clone, PartialEq, Allocative)]
204205
pub enum DocMember {
205206
Property(DocProperty),

starlark-rust/starlark/src/eval/compiler/expr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@ pub(crate) enum EvalError {
10251025

10261026
/// Try fold expression `cmp(l == r)` into `cmp(type(x) == "y")`.
10271027
/// Return original `l` and `r` arguments if fold was unsuccessful.
1028+
#[allow(clippy::result_large_err)]
10281029
fn try_eval_type_is(
10291030
l: IrSpanned<ExprCompiled>,
10301031
r: IrSpanned<ExprCompiled>,

starlark-rust/starlark/src/eval/compiler/scope.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ impl<'f> Binding<'f> {
11251125

11261126
/// Initialize the slot during analysis.
11271127
pub(crate) fn init_slot(&mut self, slot: Slot, codemap: &CodeMap) -> Result<(), InternalError> {
1128-
match mem::replace(&mut self.slot, Some(slot)) {
1128+
match self.slot.replace(slot) {
11291129
Some(_) => Err(InternalError::msg(
11301130
"slot is already assigned",
11311131
self.span(),

0 commit comments

Comments
 (0)