From 76974a9050db9ec0237cafe6287509276224fee0 Mon Sep 17 00:00:00 2001 From: Waleed Khan Date: Wed, 23 Feb 2022 12:23:09 -0800 Subject: [PATCH] build: suppress `unstable_name_collisions` warnings on stable Originally, I had thought that these warnings would only potentially show up in nightly because there was a feature which exposed these functions, and we would be able to enable that feature and conditionally not define the conflicting methods. But it looks like these warnings also show up in stable. I've just suppressed each of them individually. Other options would be to rename them and just make them wrapper methods, or to disable `unstable_name_collisions` warnings at a higher scope (possibly including at the crate level). --- lib/src/index.rs | 6 ++++++ lib/src/nightly_shims.rs | 1 + 2 files changed, 7 insertions(+) diff --git a/lib/src/index.rs b/lib/src/index.rs index b2f190225..c32a4cad7 100644 --- a/lib/src/index.rs +++ b/lib/src/index.rs @@ -815,16 +815,20 @@ impl<'a> CompositeIndex<'a> { let mut result = BTreeSet::new(); while !(items1.is_empty() || items2.is_empty()) { + #[allow(unstable_name_collisions)] let entry1 = items1.last().unwrap(); + #[allow(unstable_name_collisions)] let entry2 = items2.last().unwrap(); match entry1.cmp(entry2) { Ordering::Greater => { + #[allow(unstable_name_collisions)] let entry1 = items1.pop_last().unwrap(); for parent_entry in entry1.0.parents() { items1.insert(IndexEntryByGeneration(parent_entry)); } } Ordering::Less => { + #[allow(unstable_name_collisions)] let entry2 = items2.pop_last().unwrap(); for parent_entry in entry2.0.parents() { items2.insert(IndexEntryByGeneration(parent_entry)); @@ -832,7 +836,9 @@ impl<'a> CompositeIndex<'a> { } Ordering::Equal => { result.insert(entry1.0.pos); + #[allow(unstable_name_collisions)] items1.pop_last(); + #[allow(unstable_name_collisions)] items2.pop_last(); } } diff --git a/lib/src/nightly_shims.rs b/lib/src/nightly_shims.rs index 6350273ba..97b3e13ad 100644 --- a/lib/src/nightly_shims.rs +++ b/lib/src/nightly_shims.rs @@ -85,6 +85,7 @@ impl BTreeSetExt for std::collections::BTreeSet { } fn pop_last(&mut self) -> Option { + #[allow(unstable_name_collisions)] let key = self.last()?; let key = key.clone(); // ownership hack self.take(&key)