Skip to content

Commit bddcd85

Browse files
David Tolnayfacebook-github-bot
authored andcommitted
Update fbcode and xplat Rust toolchain
Summary: Release notes: https://blog.rust-lang.org/2024/06/13/Rust-1.79.0.html Stabilized features: - `absolute_path` - `associated_type_bounds` - `inline_const` - `pointer_is_aligned` - `slice_ptr_len` This release raises a new warning when a trait impl contains a signature that is more refined than the corresponding signature in the trait, impacting `buck2_query`. ```lang=text warning: impl trait in impl method signature does not match trait method signature --> fbcode/buck2/app/buck2_query/src/query/environment/tests.rs:73:30 | 73 | fn deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ::: fbcode/buck2/app/buck2_query/src/query/environment.rs:98:30 | 98 | fn deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a; | ----------------------------------------------- return type from trait method defined here | = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate = note: we are soliciting feedback, see issue #121718 <rust-lang/rust#121718> for more information = note: `#[warn(refining_impl_trait_internal)]` on by default help: replace the return type so that it matches the trait | 73 | fn deps<'a>(&'a self) -> impl Iterator<Item = &'a <Self as node::LabeledNode>::Key> + std::marker::Send + 'a { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` It also contains changes to the `dead_code` lint, which are addressed in {D59622902} and {D59623034}. Reviewed By: zertosh Differential Revision: D58982552 fbshipit-source-id: a17eaf91d07234209fddf5cbdebce4424dda57ae
1 parent a10182f commit bddcd85

File tree

9 files changed

+58
-33
lines changed

9 files changed

+58
-33
lines changed

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-2024-03-17
26-
cargo +nightly-2024-03-17 install --git https://github.com/facebook/buck2.git buck2
25+
rustup install nightly-2024-04-28
26+
cargo +nightly-2024-04-28 install --git https://github.com/facebook/buck2.git buck2
2727
```
2828

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

app/buck2_core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#![feature(io_error_more)]
1818
#![feature(once_cell_try)]
1919
#![feature(try_blocks)]
20-
#![cfg_attr(windows, feature(absolute_path))]
2120
#![feature(used_with_arg)]
2221
#![feature(let_chains)]
2322

app/buck2_query/src/query/environment/tests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,23 @@ impl QueryTarget for TestTarget {
7070
unimplemented!()
7171
}
7272

73-
fn deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
73+
fn deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
7474
Box::new(self.deps.iter())
7575
}
7676

77-
fn exec_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
77+
fn exec_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
7878
Box::new(std::iter::empty())
7979
}
8080

81-
fn target_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
81+
fn target_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
8282
Box::new(std::iter::empty())
8383
}
8484

85-
fn configuration_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
85+
fn configuration_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
8686
Box::new(std::iter::empty())
8787
}
8888

89-
fn toolchain_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
89+
fn toolchain_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
9090
Box::new(std::iter::empty())
9191
}
9292

app/buck2_query/src/query/syntax/simple/eval/tests.rs

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,39 @@ impl QueryTarget for Target {
7070
unimplemented!()
7171
}
7272

73-
fn deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
74-
unimplemented!()
73+
fn deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
74+
let _iterator: Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a>;
75+
unimplemented!();
76+
#[allow(unreachable_code)]
77+
_iterator
7578
}
7679

77-
fn exec_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
78-
unimplemented!()
80+
fn exec_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
81+
let _iterator: Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a>;
82+
unimplemented!();
83+
#[allow(unreachable_code)]
84+
_iterator
7985
}
8086

81-
fn target_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
82-
unimplemented!()
87+
fn target_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
88+
let _iterator: Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a>;
89+
unimplemented!();
90+
#[allow(unreachable_code)]
91+
_iterator
8392
}
8493

85-
fn configuration_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
86-
unimplemented!()
94+
fn configuration_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
95+
let _iterator: Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a>;
96+
unimplemented!();
97+
#[allow(unreachable_code)]
98+
_iterator
8799
}
88100

89-
fn toolchain_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
90-
unimplemented!()
101+
fn toolchain_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
102+
let _iterator: Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a>;
103+
unimplemented!();
104+
#[allow(unreachable_code)]
105+
_iterator
91106
}
92107

93108
fn special_attrs_for_each<E, F: FnMut(&str, &Self::Attr<'_>) -> Result<(), E>>(

app/buck2_query/src/query/traversal.rs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,20 +308,32 @@ mod tests {
308308
unimplemented!()
309309
}
310310

311-
fn exec_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
312-
unimplemented!()
311+
fn exec_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
312+
let _iterator: Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a>;
313+
unimplemented!();
314+
#[allow(unreachable_code)]
315+
_iterator
313316
}
314317

315-
fn target_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
316-
unimplemented!()
318+
fn target_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
319+
let _iterator: Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a>;
320+
unimplemented!();
321+
#[allow(unreachable_code)]
322+
_iterator
317323
}
318324

319-
fn configuration_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
320-
unimplemented!()
325+
fn configuration_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
326+
let _iterator: Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a>;
327+
unimplemented!();
328+
#[allow(unreachable_code)]
329+
_iterator
321330
}
322331

323-
fn toolchain_deps<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a> {
324-
unimplemented!()
332+
fn toolchain_deps<'a>(&'a self) -> impl Iterator<Item = &'a Self::Key> + Send + 'a {
333+
let _iterator: Box<dyn Iterator<Item = &'a Self::Key> + Send + 'a>;
334+
unimplemented!();
335+
#[allow(unreachable_code)]
336+
_iterator
325337
}
326338
}
327339

docs/getting_started.md

Lines changed: 2 additions & 2 deletions
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-03-17
22-
cargo +nightly-2024-03-17 install --git https://github.com/facebook/buck2.git buck2
21+
rustup install nightly-2024-04-28
22+
cargo +nightly-2024-04-28 install --git https://github.com/facebook/buck2.git buck2
2323
```
2424

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

gazebo/gazebo/src/ext/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use std::str::pattern::*;
1313
/// Extension traits on [`str`].
1414
///
1515
/// Set the configuration option `str_pattern_extensions` to enable the associated methods.
16-
/// The setting `str_pattern_extensions` requires the unstable features
17-
/// `pattern` and `associated_type_bounds`, so only works with Rust nightly.
16+
/// The setting `str_pattern_extensions` requires the unstable feature `pattern`,
17+
/// so only works with Rust nightly.
1818
pub trait StrExt {
1919
/// Like `split`, but only separates off the first element. For example:
2020
///

gazebo/gazebo/src/lib.rs

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

1010
#![cfg_attr(feature = "str_pattern_extensions", feature(pattern))]
11-
#![cfg_attr(feature = "str_pattern_extensions", feature(associated_type_bounds))]
1211

1312
//! A collection of well-tested primitives that have been useful. Most modules stand alone.
1413

rust-toolchain

Lines changed: 2 additions & 2 deletions
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.78.0-nightly (766bdce74 2024-03-16)
13-
channel = "nightly-2024-03-17"
12+
# @rustc_version: rustc 1.79.0-nightly (aed2187d5 2024-04-27)
13+
channel = "nightly-2024-04-28"
1414
components = ["llvm-tools-preview","rustc-dev","rust-src"]

0 commit comments

Comments
 (0)