mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-28 23:55:54 +00:00
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).
This commit is contained in:
parent
38aee9f749
commit
76974a9050
2 changed files with 7 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,6 +85,7 @@ impl<K: Ord + Clone> BTreeSetExt<K> for std::collections::BTreeSet<K> {
|
|||
}
|
||||
|
||||
fn pop_last(&mut self) -> Option<K> {
|
||||
#[allow(unstable_name_collisions)]
|
||||
let key = self.last()?;
|
||||
let key = key.clone(); // ownership hack
|
||||
self.take(&key)
|
||||
|
|
Loading…
Reference in a new issue