about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorGnomedDev <david2005thomas@gmail.com>2024-09-18 21:59:31 +0100
committerGnomedDev <david2005thomas@gmail.com>2024-09-19 13:13:42 +0100
commit25da0e2e5db45cb7d8d265ad90de6b4d213ce94c (patch)
treee7a8fec2c8068f319a321d834e9871830ee51e17 /library
parent15240a93c984fbd0f061066914547d12ce9e891c (diff)
downloadrust-25da0e2e5db45cb7d8d265ad90de6b4d213ce94c.tar.gz
rust-25da0e2e5db45cb7d8d265ad90de6b4d213ce94c.zip
[Clippy] Swap `manual_while_let_some` to use diagnostic items instead of paths
Diffstat (limited to 'library')
-rw-r--r--library/alloc/src/vec/mod.rs2
-rw-r--r--library/core/src/option.rs2
2 files changed, 4 insertions, 0 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index a7e736299be..13b06584223 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -2384,6 +2384,7 @@ impl<T, A: Allocator> Vec<T, A> {
     /// Takes *O*(1) time.
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg_attr(not(test), rustc_diagnostic_item = "vec_pop")]
     pub fn pop(&mut self) -> Option<T> {
         if self.len == 0 {
             None
@@ -2577,6 +2578,7 @@ impl<T, A: Allocator> Vec<T, A> {
     /// assert!(!v.is_empty());
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg_attr(not(test), rustc_diagnostic_item = "vec_is_empty")]
     pub fn is_empty(&self) -> bool {
         self.len() == 0
     }
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index 265f056dc87..5ba13969605 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -923,6 +923,7 @@ impl<T> Option<T> {
     #[inline]
     #[track_caller]
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg_attr(not(test), rustc_diagnostic_item = "option_expect")]
     #[rustc_const_unstable(feature = "const_option", issue = "67441")]
     pub const fn expect(self, msg: &str) -> T {
         match self {
@@ -960,6 +961,7 @@ impl<T> Option<T> {
     #[inline(always)]
     #[track_caller]
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg_attr(not(test), rustc_diagnostic_item = "option_unwrap")]
     #[rustc_const_unstable(feature = "const_option", issue = "67441")]
     pub const fn unwrap(self) -> T {
         match self {