about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorRenato Lochetti <renato.lochetti@gmail.com>2023-06-08 19:04:35 +0100
committerRenato Lochetti <renato.lochetti@gmail.com>2023-06-08 19:04:35 +0100
commit55c9100334ceeccecc75fbdfc5bef321404bc066 (patch)
tree3914b54f5093026013b75fba450b9edf6dabab09 /tests/ui
parent60258b061d0e77f97bb40a377a53bb705178c0ba (diff)
downloadrust-55c9100334ceeccecc75fbdfc5bef321404bc066.tar.gz
rust-55c9100334ceeccecc75fbdfc5bef321404bc066.zip
Don't ling `as_conversions` in proc macros
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/as_conversions.rs11
-rw-r--r--tests/ui/as_conversions.stderr6
2 files changed, 13 insertions, 4 deletions
diff --git a/tests/ui/as_conversions.rs b/tests/ui/as_conversions.rs
index 890bf0b0a7e..48ca2f6d143 100644
--- a/tests/ui/as_conversions.rs
+++ b/tests/ui/as_conversions.rs
@@ -1,10 +1,11 @@
 //@aux-build:proc_macros.rs
 
 #![warn(clippy::as_conversions)]
-#![allow(clippy::borrow_as_ptr)]
+#![allow(clippy::borrow_as_ptr, unused)]
 
 extern crate proc_macros;
 use proc_macros::external;
+use proc_macros::with_span;
 
 fn main() {
     let i = 0u32 as u64;
@@ -13,3 +14,11 @@ fn main() {
 
     external!(0u32 as u64);
 }
+
+with_span!(
+    span
+
+    fn coverting() {
+        let x = 0u32 as u64;
+    }
+);
diff --git a/tests/ui/as_conversions.stderr b/tests/ui/as_conversions.stderr
index 54037a64997..ca41d1378aa 100644
--- a/tests/ui/as_conversions.stderr
+++ b/tests/ui/as_conversions.stderr
@@ -1,5 +1,5 @@
 error: using a potentially dangerous silent `as` conversion
-  --> $DIR/as_conversions.rs:10:13
+  --> $DIR/as_conversions.rs:11:13
    |
 LL |     let i = 0u32 as u64;
    |             ^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL |     let i = 0u32 as u64;
    = note: `-D clippy::as-conversions` implied by `-D warnings`
 
 error: using a potentially dangerous silent `as` conversion
-  --> $DIR/as_conversions.rs:12:13
+  --> $DIR/as_conversions.rs:13:13
    |
 LL |     let j = &i as *const u64 as *mut u64;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -16,7 +16,7 @@ LL |     let j = &i as *const u64 as *mut u64;
    = help: consider using a safe wrapper for this conversion
 
 error: using a potentially dangerous silent `as` conversion
-  --> $DIR/as_conversions.rs:12:13
+  --> $DIR/as_conversions.rs:13:13
    |
 LL |     let j = &i as *const u64 as *mut u64;
    |             ^^^^^^^^^^^^^^^^