Skip to content

Commit b76a558

Browse files
authored
Rollup merge of rust-lang#63684 - GrayJack:const_list_new, r=Centril
Constify LinkedList new function Change the `LinkedList::new()` function to become a const fn, allowing the use in constant context.
2 parents f6e43e8 + e0f7305 commit b76a558

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/liballoc/collections/linked_list.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl<T> LinkedList<T> {
276276
/// ```
277277
#[inline]
278278
#[stable(feature = "rust1", since = "1.0.0")]
279-
pub fn new() -> Self {
279+
pub const fn new() -> Self {
280280
LinkedList {
281281
head: None,
282282
tail: None,

0 commit comments

Comments
 (0)