From 1cad5dbb22859a73bf68ef680e10409cdc2e1313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Thu, 23 Jan 2025 18:40:41 +0000 Subject: [PATCH 1/3] Remove some unnecessary parens in `assert!` conditions While working on #122661, some of these started triggering our "unnecessary parens" lints due to a change in the `assert!` desugaring. A cursory search identified a few more. Some of these have been carried from before 1.0, were a bulk rename from the previous name of `assert!` left them in that state. I went and removed as many of these unnecessary parens as possible in order to have fewer annoyances in the future if we make the lint smarter. --- tests/pass/binops.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/pass/binops.rs b/tests/pass/binops.rs index 0988d7ccc4..0aff7acb29 100644 --- a/tests/pass/binops.rs +++ b/tests/pass/binops.rs @@ -2,23 +2,23 @@ fn test_nil() { assert_eq!((), ()); - assert!((!(() != ()))); - assert!((!(() < ()))); - assert!((() <= ())); - assert!((!(() > ()))); - assert!((() >= ())); + assert!(!(() != ())); + assert!(!(() < ())); + assert!(() <= ()); + assert!(!(() > ())); + assert!(() >= ()); } fn test_bool() { - assert!((!(true < false))); - assert!((!(true <= false))); - assert!((true > false)); - assert!((true >= false)); + assert!(!(true < false)); + assert!(!(true <= false)); + assert!(true > false); + assert!(true >= false); - assert!((false < true)); - assert!((false <= true)); - assert!((!(false > true))); - assert!((!(false >= true))); + assert!(false < true); + assert!(false <= true); + assert!(!(false > true)); + assert!(!(false >= true)); // Bools support bitwise binops assert_eq!(false & false, false); @@ -65,9 +65,9 @@ fn test_class() { assert_eq!(q, r); r.y = 17; - assert!((r.y != q.y)); + assert!(r.y != q.y); assert_eq!(r.y, 17); - assert!((q != r)); + assert!(q != r); } pub fn main() { From 077409111408550dbb71ee046cf295dc744e9c52 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Mon, 16 Dec 2024 14:57:22 +0100 Subject: [PATCH 2/3] remove use of `feature(trait_upcasting)` from miri --- src/lib.rs | 2 +- tests/fail/dyn-upcast-trait-mismatch.rs | 3 --- tests/pass/box-custom-alloc.rs | 3 +-- tests/pass/dyn-upcast.rs | 3 --- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 45054c37c4..a717d8ccf2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +#![cfg_attr(bootstrap, feature(trait_upcasting))] #![feature(rustc_private)] #![feature(cell_update)] #![feature(float_gamma)] @@ -9,7 +10,6 @@ #![feature(yeet_expr)] #![feature(nonzero_ops)] #![feature(let_chains)] -#![feature(trait_upcasting)] #![feature(strict_overflow_ops)] #![feature(pointer_is_aligned_to)] #![feature(unqualified_local_imports)] diff --git a/tests/fail/dyn-upcast-trait-mismatch.rs b/tests/fail/dyn-upcast-trait-mismatch.rs index f450e7e652..1fd791a91f 100644 --- a/tests/fail/dyn-upcast-trait-mismatch.rs +++ b/tests/fail/dyn-upcast-trait-mismatch.rs @@ -1,9 +1,6 @@ // Validation stops this too early. //@compile-flags: -Zmiri-disable-validation -#![feature(trait_upcasting)] -#![allow(incomplete_features)] - trait Foo: PartialEq + std::fmt::Debug + Send + Sync { #[allow(dead_code)] fn a(&self) -> i32 { diff --git a/tests/pass/box-custom-alloc.rs b/tests/pass/box-custom-alloc.rs index 71ce019187..f0614313e5 100644 --- a/tests/pass/box-custom-alloc.rs +++ b/tests/pass/box-custom-alloc.rs @@ -1,7 +1,6 @@ //@revisions: stack tree //@[tree]compile-flags: -Zmiri-tree-borrows -#![allow(incomplete_features)] // for trait upcasting -#![feature(allocator_api, trait_upcasting)] +#![feature(allocator_api)] use std::alloc::{AllocError, Allocator, Layout}; use std::cell::Cell; diff --git a/tests/pass/dyn-upcast.rs b/tests/pass/dyn-upcast.rs index f100c4d6a8..6f8adc0964 100644 --- a/tests/pass/dyn-upcast.rs +++ b/tests/pass/dyn-upcast.rs @@ -1,6 +1,3 @@ -#![feature(trait_upcasting)] -#![allow(incomplete_features)] - use std::fmt; fn main() { From 84143a7af7c3fdcc34e828dd3ad899fd3a583df7 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Sat, 8 Feb 2025 04:56:56 +0000 Subject: [PATCH 3/3] Preparing for merge from rustc --- rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-version b/rust-version index 04b9f1c3fa..dd48038e07 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -942db6782f4a28c55b0b75b38fd4394d0483390f +e0607238c95df66e3d25a6c17aebe18c6726fc74