summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-07-31 02:12:32 +0000
committerMichael Goulet <michael@errs.io>2025-07-31 02:28:11 +0000
commit51cd9b564f75b8330893b919b90e293530d1c395 (patch)
treeb039f6db349597df2c8fc8076cb092443d06b93f /tests
parente5e79f8bd428d0b8d26e8240d718b134ef297459 (diff)
downloadrust-51cd9b564f75b8330893b919b90e293530d1c395.tar.gz
rust-51cd9b564f75b8330893b919b90e293530d1c395.zip
Consider operator's span when computing binop expr span
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/lint/wide_pointer_comparisons.rs4
-rw-r--r--tests/ui/lint/wide_pointer_comparisons.stderr18
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/ui/lint/wide_pointer_comparisons.rs b/tests/ui/lint/wide_pointer_comparisons.rs
index 05097cbf1e3..a5e3f4754b8 100644
--- a/tests/ui/lint/wide_pointer_comparisons.rs
+++ b/tests/ui/lint/wide_pointer_comparisons.rs
@@ -146,12 +146,10 @@ fn main() {
     {
         macro_rules! cmp {
             ($a:tt, $b:tt) => { $a == $b }
+            //~^ WARN ambiguous wide pointer comparison
         }
 
-        // FIXME: This lint uses some custom span combination logic.
-        // Rewrite it to adapt to the new metavariable span rules.
         cmp!(a, b);
-        //~^ WARN ambiguous wide pointer comparison
     }
 
     {
diff --git a/tests/ui/lint/wide_pointer_comparisons.stderr b/tests/ui/lint/wide_pointer_comparisons.stderr
index 4f5238e8252..4199ff62e2a 100644
--- a/tests/ui/lint/wide_pointer_comparisons.stderr
+++ b/tests/ui/lint/wide_pointer_comparisons.stderr
@@ -720,18 +720,20 @@ LL +         std::ptr::eq(*a, *b)
    |
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
-  --> $DIR/wide_pointer_comparisons.rs:153:14
+  --> $DIR/wide_pointer_comparisons.rs:148:33
    |
+LL |             ($a:tt, $b:tt) => { $a == $b }
+   |                                 ^^^^^^^^
+...
 LL |         cmp!(a, b);
-   |              ^^^^
-   |
-help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
+   |         ---------- in this macro invocation
    |
-LL |         cmp!(std::ptr::addr_eq(a, b));
-   |              ++++++++++++++++++    +
+   = help: use explicit `std::ptr::eq` method to compare metadata and addresses
+   = help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
+   = note: this warning originates in the macro `cmp` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
-  --> $DIR/wide_pointer_comparisons.rs:159:39
+  --> $DIR/wide_pointer_comparisons.rs:157:39
    |
 LL |             ($a:ident, $b:ident) => { $a == $b }
    |                                       ^^^^^^^^
@@ -747,7 +749,7 @@ LL +             ($a:ident, $b:ident) => { std::ptr::addr_eq($a, $b) }
    |
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
-  --> $DIR/wide_pointer_comparisons.rs:169:37
+  --> $DIR/wide_pointer_comparisons.rs:167:37
    |
 LL |             ($a:expr, $b:expr) => { $a == $b }
    |                                     ^^^^^^^^