Skip to content

Commit

Permalink
Allow (temporarilly) unused LinkedList::const_new
Browse files Browse the repository at this point in the history
  • Loading branch information
mental32 committed Aug 31, 2020
1 parent 86992e8 commit f186bd9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tokio/src/util/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ unsafe impl<T: Sync> Sync for Pointers<T> {}
// ===== impl LinkedList =====

impl<L, T> LinkedList<L, T> {
/// Constant constructor for a `LinkedList`.
#[allow(dead_code)] // NOTE: This will get removed with: https://github.com/tokio-rs/tokio/pull/2790
pub(crate) const fn const_new() -> LinkedList<L, T> {
LinkedList {
head: None,
Expand Down Expand Up @@ -325,6 +327,11 @@ mod tests {
}};
}

#[test]
fn const_new() {
const _: LinkedList<&Entry, <&Entry as Link>::Target> = LinkedList::const_new();
}

#[test]
fn push_and_drain() {
let a = entry(5);
Expand Down

0 comments on commit f186bd9

Please sign in to comment.