[Clippy] Swap VecArgs::hir to use diagnostic items instead of paths · qinheping/verify-rust-std@b95bef0 (original) (raw)
2 files changed
lines changed
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -496,6 +496,7 @@ impl [T] { | ||
| 496 | 496 | #[rustc_allow_incoherent_impl] |
| 497 | 497 | #[stable(feature = "rust1", since = "1.0.0")] |
| 498 | 498 | #[inline] |
| 499 | +#[cfg_attr(not(test), rustc_diagnostic_item = "slice_into_vec")] | |
| 499 | 500 | pub fn into_vec<A: Allocator>(self: Box<Self, A>) -> Vec<T, A> { |
| 500 | 501 | // N.B., see the `hack` module in this file for more details. |
| 501 | 502 | hack::into_vec(self) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -416,6 +416,7 @@ impl Vec { | ||
| 416 | 416 | /// ``` |
| 417 | 417 | #[inline] |
| 418 | 418 | #[rustc_const_stable(feature = "const_vec_new", since = "1.39.0")] |
| 419 | +#[cfg_attr(not(test), rustc_diagnostic_item = "vec_new")] | |
| 419 | 420 | #[stable(feature = "rust1", since = "1.0.0")] |
| 420 | 421 | #[must_use] |
| 421 | 422 | pub const fn new() -> Self { |
| @@ -3046,6 +3047,7 @@ impl<T: PartialEq, A: Allocator> Vec<T, A> { | ||
| 3046 | 3047 | #[doc(hidden)] |
| 3047 | 3048 | #[cfg(not(no_global_oom_handling))] |
| 3048 | 3049 | #[stable(feature = "rust1", since = "1.0.0")] |
| 3050 | +#[cfg_attr(not(test), rustc_diagnostic_item = "vec_from_elem")] | |
| 3049 | 3051 | pub fn from_elem<T: Clone>(elem: T, n: usize) -> Vec<T> { |
| 3050 | 3052 | <T as SpecFromElem>::from_elem(elem, n, Global) |
| 3051 | 3053 | } |