Skip to content

Commit

Permalink
[Clippy] Swap VecArgs::hir to use diagnostic items instead of paths
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev committed Sep 19, 2024
1 parent 6906fa9 commit b95bef0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions alloc/src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ impl<T> [T] {
#[rustc_allow_incoherent_impl]
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
#[cfg_attr(not(test), rustc_diagnostic_item = "slice_into_vec")]
pub fn into_vec<A: Allocator>(self: Box<Self, A>) -> Vec<T, A> {
// N.B., see the `hack` module in this file for more details.
hack::into_vec(self)
Expand Down
2 changes: 2 additions & 0 deletions alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ impl<T> Vec<T> {
/// ```
#[inline]
#[rustc_const_stable(feature = "const_vec_new", since = "1.39.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "vec_new")]
#[stable(feature = "rust1", since = "1.0.0")]
#[must_use]
pub const fn new() -> Self {
Expand Down Expand Up @@ -3046,6 +3047,7 @@ impl<T: PartialEq, A: Allocator> Vec<T, A> {
#[doc(hidden)]
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "vec_from_elem")]
pub fn from_elem<T: Clone>(elem: T, n: usize) -> Vec<T> {
<T as SpecFromElem>::from_elem(elem, n, Global)
}
Expand Down

0 comments on commit b95bef0

Please sign in to comment.