about summary refs log tree commit diff
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-12-17 19:29:14 +0800
committer许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-12-17 19:57:42 +0800
commit7424b898e94b019b49e0854ec061abfdc071e61e (patch)
treee1023cd7a68c32dc4b493991576e554c9b018249
parent88f8bf7e560f5ea9c2efe2f587b2586f95984c4c (diff)
downloadrust-7424b898e94b019b49e0854ec061abfdc071e61e.tar.gz
rust-7424b898e94b019b49e0854ec061abfdc071e61e.zip
Adjust `tests/ui/attr-usage-inline.rs`
- Move `tests/ui/attr-usage-inline.rs` to `tests/ui/attributes/inline/`.
- Briefly document test intent.
- Drop unnecessary `#[allow(dead_code)]` as this is allowed-by-default
  for ui test suite.
-rw-r--r--tests/ui/attributes/inline/attr-usage-inline.rs (renamed from tests/ui/attr-usage-inline.rs)3
-rw-r--r--tests/ui/attributes/inline/attr-usage-inline.stderr (renamed from tests/ui/attr-usage-inline.stderr)4
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/ui/attr-usage-inline.rs b/tests/ui/attributes/inline/attr-usage-inline.rs
index 674c12454cd..d8ca0fce163 100644
--- a/tests/ui/attr-usage-inline.rs
+++ b/tests/ui/attributes/inline/attr-usage-inline.rs
@@ -1,4 +1,5 @@
-#![allow(dead_code)]
+//! Check that `#[inline]` attribute can only be applied to fn-like targets (e.g. function or
+//! closure), and when misapplied to other targets an error is emitted.
 
 #[inline]
 fn f() {}
diff --git a/tests/ui/attr-usage-inline.stderr b/tests/ui/attributes/inline/attr-usage-inline.stderr
index 22a0bf47e20..2123438032c 100644
--- a/tests/ui/attr-usage-inline.stderr
+++ b/tests/ui/attributes/inline/attr-usage-inline.stderr
@@ -1,5 +1,5 @@
 error[E0518]: attribute should be applied to function or closure
-  --> $DIR/attr-usage-inline.rs:6:1
+  --> $DIR/attr-usage-inline.rs:7:1
    |
 LL | #[inline]
    | ^^^^^^^^^
@@ -7,7 +7,7 @@ LL | struct S;
    | --------- not a function or closure
 
 error[E0518]: attribute should be applied to function or closure
-  --> $DIR/attr-usage-inline.rs:20:1
+  --> $DIR/attr-usage-inline.rs:21:1
    |
 LL | #[inline]
    | ^^^^^^^^^ not a function or closure