about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorJieyou Xu <jieyouxu@outlook.com>2025-09-11 09:00:01 +0800
committerJieyou Xu <jieyouxu@outlook.com>2025-09-11 09:10:46 +0800
commitba107fcffba2aefc83e199286a5ccdbb29f69d5d (patch)
treedaf907e81297d32a678f585f95e2edc0f85da036 /tests
parent5782d9e802790935b5b897d55d4a57613e29667c (diff)
downloadrust-ba107fcffba2aefc83e199286a5ccdbb29f69d5d.tar.gz
rust-ba107fcffba2aefc83e199286a5ccdbb29f69d5d.zip
Revert "Rollup merge of #122661 - estebank:assert-macro-span, r=petrochenkov"
This reverts commit 1eeb8e8b151d1da7daa73837a25dc5f7a1a7fa28, reversing
changes made to 324bf2b9fd8bf9661e7045c8a93f5ff0ec1a8ca5.

Unfortunately the assert desugaring change is not backwards compatible,
see RUST-145770.

Code such as

```rust
#[derive(Debug)]
struct F {
    data: bool
}

impl std::ops::Not for F {
  type Output = bool;
  fn not(self) -> Self::Output { !self.data }
}

fn main() {
  let f = F { data: true };

  assert!(f);
}
```

would be broken by the assert desugaring change. We may need to land
the change over an edition boundary, or limit the editions that the
desugaring change impacts.
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/const_is_empty.rs1
-rw-r--r--tests/ui/const_is_empty.stderr10
-rw-r--r--tests/ui/incompatible_msrv.rs2
3 files changed, 3 insertions, 10 deletions
diff --git a/tests/ui/const_is_empty.rs b/tests/ui/const_is_empty.rs
index 63c6342a323..8bb4f0e5d97 100644
--- a/tests/ui/const_is_empty.rs
+++ b/tests/ui/const_is_empty.rs
@@ -196,7 +196,6 @@ fn issue_13106() {
 
     const {
         assert!(EMPTY_STR.is_empty());
-        //~^ const_is_empty
     }
 
     const {
diff --git a/tests/ui/const_is_empty.stderr b/tests/ui/const_is_empty.stderr
index 9a42518698e..2ba189058e8 100644
--- a/tests/ui/const_is_empty.stderr
+++ b/tests/ui/const_is_empty.stderr
@@ -158,16 +158,10 @@ LL |     let _ = val.is_empty();
    |             ^^^^^^^^^^^^^^
 
 error: this expression always evaluates to true
-  --> tests/ui/const_is_empty.rs:198:17
-   |
-LL |         assert!(EMPTY_STR.is_empty());
-   |                 ^^^^^^^^^^^^^^^^^^^^
-
-error: this expression always evaluates to true
-  --> tests/ui/const_is_empty.rs:203:9
+  --> tests/ui/const_is_empty.rs:202:9
    |
 LL |         EMPTY_STR.is_empty();
    |         ^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 28 previous errors
+error: aborting due to 27 previous errors
 
diff --git a/tests/ui/incompatible_msrv.rs b/tests/ui/incompatible_msrv.rs
index 882f909e30c..f7f21e1850d 100644
--- a/tests/ui/incompatible_msrv.rs
+++ b/tests/ui/incompatible_msrv.rs
@@ -1,6 +1,6 @@
 #![warn(clippy::incompatible_msrv)]
 #![feature(custom_inner_attributes)]
-#![allow(stable_features, clippy::diverging_sub_expression)]
+#![allow(stable_features)]
 #![feature(strict_provenance)] // For use in test
 #![clippy::msrv = "1.3.0"]