Skip to content

Commit

Permalink
Rollup merge of rust-lang#63684 - GrayJack:const_list_new, r=Centril
Browse files Browse the repository at this point in the history
Constify LinkedList new function

Change the `LinkedList::new()` function to become a const fn, allowing the use in constant context.
  • Loading branch information
Centril authored Aug 30, 2019
2 parents de7f65d + e0f7305 commit 9d617df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/liballoc/collections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ impl<T> LinkedList<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn new() -> Self {
pub const fn new() -> Self {
LinkedList {
head: None,
tail: None,
Expand Down

0 comments on commit 9d617df

Please sign in to comment.