Skip to content

Commit 7bc30a7

Browse files
committed
[Clippy] Swap manual_while_let_some to use diagnostic items instead of paths
1 parent 08b676d commit 7bc30a7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

alloc/src/vec/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2384,6 +2384,7 @@ impl<T, A: Allocator> Vec<T, A> {
23842384
/// Takes *O*(1) time.
23852385
#[inline]
23862386
#[stable(feature = "rust1", since = "1.0.0")]
2387+
#[cfg_attr(not(test), rustc_diagnostic_item = "vec_pop")]
23872388
pub fn pop(&mut self) -> Option<T> {
23882389
if self.len == 0 {
23892390
None
@@ -2577,6 +2578,7 @@ impl<T, A: Allocator> Vec<T, A> {
25772578
/// assert!(!v.is_empty());
25782579
/// ```
25792580
#[stable(feature = "rust1", since = "1.0.0")]
2581+
#[cfg_attr(not(test), rustc_diagnostic_item = "vec_is_empty")]
25802582
pub fn is_empty(&self) -> bool {
25812583
self.len() == 0
25822584
}

core/src/option.rs

+2
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ impl<T> Option<T> {
923923
#[inline]
924924
#[track_caller]
925925
#[stable(feature = "rust1", since = "1.0.0")]
926+
#[cfg_attr(not(test), rustc_diagnostic_item = "option_expect")]
926927
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
927928
pub const fn expect(self, msg: &str) -> T {
928929
match self {
@@ -960,6 +961,7 @@ impl<T> Option<T> {
960961
#[inline(always)]
961962
#[track_caller]
962963
#[stable(feature = "rust1", since = "1.0.0")]
964+
#[cfg_attr(not(test), rustc_diagnostic_item = "option_unwrap")]
963965
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
964966
pub const fn unwrap(self) -> T {
965967
match self {

0 commit comments

Comments
 (0)