Skip to content

Commit

Permalink
Update platform010 & platform010-aarch64 symlinks
Browse files Browse the repository at this point in the history
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
  • Loading branch information
diliop authored and facebook-github-bot committed Oct 7, 2024
1 parent f459c08 commit f0a47e3
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 42 deletions.
4 changes: 2 additions & 2 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ cargo install --path=app/buck2
Or, alternatively, install it directly from GitHub:

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

### Side note: using [Nix] to compile the source
Expand Down
1 change: 1 addition & 0 deletions allocative/allocative/src/rc_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::ops::Deref;
use std::rc::Rc;

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

impl<'a> From<&'a str> for RcStr {
Expand Down
4 changes: 1 addition & 3 deletions app/buck2_build_api/src/actions/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,12 @@ pub fn iter_action_inputs<'a>(
type Item = &'a SetProjectionInputs;

fn next(&mut self) -> Option<Self::Item> {
self.queue.pop_front().map(|node| {
self.queue.pop_front().inspect(|node| {
for child in &*node.node.children {
if self.visited.insert(child) {
self.queue.push_back(child);
}
}

node
})
}
}
Expand Down
1 change: 0 additions & 1 deletion app/buck2_common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

//! Common core components of buck2

#![feature(fs_try_exists)]
#![feature(io_error_more)]
#![feature(is_sorted)]
#![feature(map_try_insert)]
Expand Down
6 changes: 3 additions & 3 deletions app/buck2_common/src/temp_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ mod tests {
let temp_path = TempPath::new().unwrap();
let path = temp_path.path().to_path_buf();

assert!(!fs::try_exists(&path).unwrap());
assert!(!path.try_exists().unwrap());

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

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

temp_path.close().unwrap();

assert!(!fs::try_exists(&path).unwrap());
assert!(!path.try_exists().unwrap());
}
}
4 changes: 2 additions & 2 deletions app/buck2_core/src/env/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct EnvInfoEntry {

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

Expand All @@ -53,7 +53,7 @@ mod tests {
assert_eq!(
&EnvInfoEntry {
name: "TEST_VAR_1",
ty: "std::string::String",
ty: "std :: string :: String",
default: None,
applicability: Applicability::Internal,
},
Expand Down
10 changes: 5 additions & 5 deletions app/buck2_core/src/fs/fs_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ pub fn read_dir_if_exists<P: AsRef<AbsNormPath>>(path: P) -> Result<Option<ReadD
pub fn try_exists<P: AsRef<AbsPath>>(path: P) -> Result<bool, IoError> {
let _guard = IoCounterKey::Stat.guard();
make_error!(
fs::try_exists(path.as_ref().as_maybe_relativized()),
path.as_ref().as_maybe_relativized().try_exists(),
format!("try_exists({})", P::as_ref(&path).display())
)
}
Expand Down Expand Up @@ -1060,7 +1060,7 @@ mod tests {
let dir_path = root.join("dir");
create_dir_all(AbsPath::new(&dir_path)?)?;
assert_matches!(remove_file(&dir_path), Err(..));
assert!(fs::try_exists(&dir_path)?);
assert!(dir_path.try_exists()?);
Ok(())
}

Expand Down Expand Up @@ -1102,7 +1102,7 @@ mod tests {
let path = root.join("file");
fs::write(&path, b"regular")?;
remove_all(&path)?;
assert!(!fs::try_exists(&path)?);
assert!(!path.try_exists()?);
Ok(())
}

Expand All @@ -1114,7 +1114,7 @@ mod tests {
fs::create_dir(&path)?;
fs::write(path.join("file"), b"regular file in a dir")?;
remove_all(&path)?;
assert!(!fs::try_exists(&path)?);
assert!(!path.try_exists()?);
Ok(())
}

Expand Down Expand Up @@ -1163,7 +1163,7 @@ mod tests {
let file_path = root.join("file");
fs::write(&file_path, b"File content")?;
assert!(remove_dir_all(&file_path).is_err());
assert!(fs::try_exists(&file_path)?);
assert!(file_path.try_exists()?);
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion app/buck2_core/src/fs/paths/abs_norm_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ fn verify_abs_path_windows_part(path: &str) -> bool {
// TODO(nga): behavior of UNC paths is under-specified in `AbsPath`.
let path = path.strip_prefix("\\\\.\\").unwrap_or(path);

for component in path.split(|c| c == '/' || c == '\\') {
for component in path.split(['/', '\\']) {
if component == "." || component == ".." {
return false;
}
Expand Down
1 change: 0 additions & 1 deletion app/buck2_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#![feature(error_generic_member_access)]
#![feature(decl_macro)]
#![feature(fs_try_exists)]
#![feature(never_type)]
#![feature(pattern)]
#![feature(box_patterns)]
Expand Down
1 change: 1 addition & 0 deletions app/buck2_daemon/src/daemonize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ type Errno = libc::c_int;

/// This error type for `Daemonize` `start` method.
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Dupe)]
#[allow(dead_code)]
struct Error {
kind: ErrorKind,
}
Expand Down
2 changes: 1 addition & 1 deletion app/buck2_test/src/local_resource_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl<'a> LocalResourceRegistry<'a> {
futures::future::join_all(futs)
.await
.into_iter()
.collect::<Result<_, _>>()?;
.collect::<Result<(), _>>()?;

Ok::<(), anyhow::Error>(())
};
Expand Down
4 changes: 2 additions & 2 deletions docs/about/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ To get started, first install [rustup](https://rustup.rs/), then compile the
`buck2` executable:

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

The above commands install `buck2` into a suitable directory, such as
Expand Down
2 changes: 1 addition & 1 deletion gazebo/dupe/src/__macro_refs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
use crate::Dupe;

#[inline]
pub const fn assert_dupe<T: Dupe + ?Sized>() {}
pub const fn assert_dupe<T: Dupe>() {}
4 changes: 2 additions & 2 deletions rust-toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
# * NOTE: You may have to change this file in a follow up commit as ocamlrep
# has a dependency on buck2 git trunk.

# @rustc_version: rustc 1.80.0-nightly (804421dff 2024-06-07)
channel = "nightly-2024-06-08"
# @rustc_version: rustc 1.81.0-nightly (506985649 2024-07-20)
channel = "nightly-2024-07-21"
components = ["llvm-tools-preview","rustc-dev","rust-src"]
1 change: 1 addition & 0 deletions starlark-rust/starlark/src/tests/derive/freeze/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ use crate as starlark;
use crate::values::Freeze;

#[derive(Freeze)]
#[allow(dead_code)]
struct TestUnitStruct;
4 changes: 2 additions & 2 deletions starlark-rust/starlark/src/tests/uncategorized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ fn test_fuzzer_59102() {
let res: Result<AstModule, crate::Error> =
AstModule::parse("hello_world.star", src.to_owned(), &Dialect::Standard);
// The panic actually only happens when we format the result
format!("{:?}", res);
let _unused = format!("{:?}", res);
}

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

#[test]
Expand Down
7 changes: 2 additions & 5 deletions starlark-rust/starlark/src/values/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ impl ValueError {

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

Expand All @@ -114,7 +111,7 @@ impl ValueError {

/// Helper to create an [`OperationNotSupported`](ValueError::OperationNotSupportedBinary) error.
#[cold]
pub fn unsupported_with<'v, T, V: StarlarkValue<'v> + ?Sized>(
pub fn unsupported_with<'v, T, V: StarlarkValue<'v>>(
_left: &V,
op: &str,
right: Value,
Expand Down
4 changes: 2 additions & 2 deletions starlark-rust/starlark/src/values/layout/vtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ pub(crate) struct AValueVTable {
allocative: unsafe fn(StarlarkValueRawPtr) -> *const dyn Allocative,
}

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

impl<'v, T: StarlarkValue<'v> + ?Sized> GetTypeId<'v, T> {
impl<'v, T: StarlarkValue<'v>> GetTypeId<'v, T> {
const TYPE_ID: ConstTypeId = ConstTypeId::of::<<T as ProvidesStaticType>::StaticType>();
const STARLARK_TYPE_ID: StarlarkTypeId = StarlarkTypeId::of::<T>();
}
Expand Down
2 changes: 1 addition & 1 deletion starlark-rust/starlark/src/values/type_repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl<T: StarlarkTypeRepr> StarlarkTypeRepr for SetType<T> {
}
}

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

fn starlark_type_repr() -> Ty {
Expand Down
2 changes: 1 addition & 1 deletion starlark-rust/starlark/src/values/types/string/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ pub(crate) fn string_methods(builder: &mut MethodsBuilder) {
let mut s = this;
let mut lines: Vec<StringValue> = Vec::new();
loop {
if let Some(x) = s.find(|x| x == '\n' || x == '\r') {
if let Some(x) = s.find(['\n', '\r']) {
let y = x;
let x = match s.get(y..y + 2) {
Some("\r\n") => y + 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,10 @@ impl<'v, V: ValueLike<'v>> Hash for TypeCompiled<V> {
impl<'v, V: ValueLike<'v>> PartialEq for TypeCompiled<V> {
#[allow(clippy::manual_unwrap_or)]
fn eq(&self, other: &Self) -> bool {
match self.0.to_value().equals(other.0.to_value()) {
Ok(b) => b,
Err(_) => {
// Unreachable, but we should not panic in `PartialEq`.
false
}
}
self.0
.to_value()
.equals(other.0.to_value())
.unwrap_or_default()
}
}

Expand Down

0 comments on commit f0a47e3

Please sign in to comment.