diff --git a/library/alloc/src/vec/spec_from_elem.rs b/library/alloc/src/vec/spec_from_elem.rs index 4e4150d9435..63225b41cbd 100644 --- a/library/alloc/src/vec/spec_from_elem.rs +++ b/library/alloc/src/vec/spec_from_elem.rs @@ -64,7 +64,7 @@ impl SpecFromElem for u8 { // but this cannot be implemented currently impl SpecFromElem for () { #[inline] - fn from_elem(elem: (), n: usize, alloc: A) -> Vec<(), A> { + fn from_elem(_elem: (), n: usize, alloc: A) -> Vec<(), A> { let mut v = Vec::with_capacity_in(n, alloc); // SAFETY: the capacity has just been set to `n` and `()` // is a ZST with trivial `Clone` implementation