Skip to content

Commit e926e9d

Browse files
committed
revert unneeded changes
1 parent 349ab5a commit e926e9d

5 files changed

Lines changed: 23 additions & 35 deletions

File tree

‎libcc2rs/src/iterators.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ pub struct StringIterator<T> {
259259
ptr: Ptr<T>,
260260
}
261261

262-
impl<T: 'static> Iterator for StringIterator<T> {
262+
impl<T> Iterator for StringIterator<T> {
263263
type Item = Ptr<T>;
264264
fn next(&mut self) -> Option<Self::Item> {
265265
// stop before the null terminator at the last position

‎libcc2rs/src/rc.rs‎

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,7 @@ impl<T> Ptr<T> {
316316
}
317317

318318
#[inline]
319-
pub fn len(&self) -> usize
320-
where
321-
T: 'static,
322-
{
319+
pub fn len(&self) -> usize {
323320
match &self.kind {
324321
PtrKind::Null => 0,
325322
PtrKind::StackSingle(_) | PtrKind::HeapSingle(_) | PtrKind::Field(_) => 1,
@@ -334,10 +331,7 @@ impl<T> Ptr<T> {
334331
}
335332

336333
#[inline]
337-
pub fn is_empty(&self) -> bool
338-
where
339-
T: 'static,
340-
{
334+
pub fn is_empty(&self) -> bool {
341335
match &self.kind {
342336
PtrKind::Null => true,
343337
PtrKind::StackSingle(_) | PtrKind::HeapSingle(_) | PtrKind::Field(_) => false,
@@ -376,10 +370,7 @@ impl<T> Ptr<T> {
376370
}
377371

378372
#[inline]
379-
pub fn to_last(&self) -> Self
380-
where
381-
T: 'static,
382-
{
373+
pub fn to_last(&self) -> Self {
383374
// A field is a single object, whose offset is that of the pointer.
384375
if let PtrKind::Field(_) = self.kind {
385376
return self.clone();
@@ -391,10 +382,7 @@ impl<T> Ptr<T> {
391382
}
392383

393384
#[inline]
394-
pub fn to_end(&self) -> Self
395-
where
396-
T: 'static,
397-
{
385+
pub fn to_end(&self) -> Self {
398386
if let PtrKind::Field(_) = self.kind {
399387
return self.offset(1);
400388
}
@@ -698,7 +686,7 @@ impl<T: std::io::Write + ByteRepr> Ptr<T> {
698686
}
699687
}
700688

701-
impl<T: std::cmp::Ord + 'static> Ptr<T> {
689+
impl<T: std::cmp::Ord> Ptr<T> {
702690
pub fn sort(&self, last: usize) {
703691
match self.kind {
704692
PtrKind::Null => panic!("ub: dereference of null pointer"),
@@ -720,7 +708,7 @@ impl<T: std::cmp::Ord + 'static> Ptr<T> {
720708
}
721709
}
722710

723-
impl<T: Clone + 'static> Ptr<T> {
711+
impl<T: Clone> Ptr<T> {
724712
pub fn sort_with_cmp<F>(&self, last: usize, mut cmp: F)
725713
where
726714
F: FnMut(Ptr<T>, Ptr<T>) -> bool,
@@ -767,7 +755,7 @@ impl<T: Clone + 'static> Ptr<T> {
767755

768756
impl<T> IntoIterator for &Ptr<T>
769757
where
770-
T: Clone + 'static,
758+
T: Clone,
771759
{
772760
type Item = Ptr<T>;
773761
type IntoIter = Ptr<T>;
@@ -777,7 +765,7 @@ where
777765
}
778766
}
779767

780-
impl<T: 'static> Iterator for Ptr<T> {
768+
impl<T> Iterator for Ptr<T> {
781769
type Item = Ptr<T>;
782770
fn next(&mut self) -> Option<Self::Item> {
783771
if self.get_offset() < self.len() {

‎rules/algorithm/tgt_refcount.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::cell::RefCell;
66
use std::io::Write;
77
use std::rc::Rc;
88

9-
fn f1<T1: Ord + 'static>(a0: Ptr<T1>, a1: Ptr<T1>) {
9+
fn f1<T1: Ord>(a0: Ptr<T1>, a1: Ptr<T1>) {
1010
a0.sort(a1.get_offset())
1111
}
1212

@@ -36,7 +36,7 @@ fn f3<T1: PartialEq + Clone + ByteRepr>(a0: Ptr<T1>, a1: Ptr<T1>, a2: T1) -> Ptr
3636
)
3737
}
3838

39-
fn f6<T1: Ord + Clone + 'static, T2>(a0: Ptr<T1>, a1: Ptr<T1>, a2: T2)
39+
fn f6<T1: Ord + Clone, T2>(a0: Ptr<T1>, a1: Ptr<T1>, a2: T2)
4040
where
4141
T2: Callable2<Ptr<T1>, Ptr<T1>, bool>,
4242
{

‎rules/deque/tgt_refcount.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use libcc2rs::*;
55
use std::cell::RefCell;
66
use std::rc::Rc;
77

8-
fn f1<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
8+
fn f1<T1>(a0: Ptr<T1>) -> Ptr<T1> {
99
a0.to_last()
1010
}
1111

‎rules/vector/tgt_refcount.rs‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ fn f9<T1>(a0: Ptr<T1>) -> Ptr<T1> {
4545
a0
4646
}
4747

48-
fn f10<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
48+
fn f10<T1>(a0: Ptr<T1>) -> Ptr<T1> {
4949
a0.to_last()
5050
}
5151

5252
fn f13<T1>(a0: Ptr<T1>) -> Ptr<T1> {
5353
a0
5454
}
5555

56-
fn f17<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
56+
fn f17<T1>(a0: Ptr<T1>) -> Ptr<T1> {
5757
a0.to_end()
5858
}
5959

@@ -140,7 +140,7 @@ fn f37<T1: TryFrom<T2>, T2: Clone + ByteRepr>(a0: Ptr<T2>, a1: Ptr<T2>) -> Vec<T
140140
.collect::<Vec<_>>()
141141
}
142142

143-
fn f40<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
143+
fn f40<T1>(a0: Ptr<T1>) -> Ptr<T1> {
144144
a0.to_end()
145145
}
146146

@@ -163,7 +163,7 @@ fn f43<T1>(a0: Ptr<T1>) -> Ptr<T1> {
163163
a0
164164
}
165165

166-
fn f44<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
166+
fn f44<T1>(a0: Ptr<T1>) -> Ptr<T1> {
167167
a0.to_end()
168168
}
169169

@@ -175,7 +175,7 @@ fn f50<T1: ByteRepr>(a0: Ptr<Vec<T1>>, a1: usize) -> Ptr<Vec<T1>> {
175175
}
176176
}
177177

178-
fn f51<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
178+
fn f51<T1>(a0: Ptr<T1>) -> Ptr<T1> {
179179
a0.to_last()
180180
}
181181

@@ -206,7 +206,7 @@ fn f55<T1: ByteRepr + Clone>(a0: Ptr<Vec<T1>>, a1: &mut Vec<T1>) {
206206
a0.write(std::mem::take(&mut *a1))
207207
}
208208

209-
fn f57<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
209+
fn f57<T1>(a0: Ptr<T1>) -> Ptr<T1> {
210210
a0.to_end()
211211
}
212212

@@ -232,15 +232,15 @@ fn f68<T1>(a0: Ptr<T1>) -> Ptr<T1> {
232232
a0
233233
}
234234

235-
fn f69<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
235+
fn f69<T1>(a0: Ptr<T1>) -> Ptr<T1> {
236236
a0.to_last()
237237
}
238238

239239
fn f72<T1>(a0: Ptr<T1>) -> Ptr<T1> {
240240
a0
241241
}
242242

243-
fn f76<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
243+
fn f76<T1>(a0: Ptr<T1>) -> Ptr<T1> {
244244
a0.to_end()
245245
}
246246

@@ -323,15 +323,15 @@ fn f95<T1>(a0: Ptr<T1>) -> Ptr<T1> {
323323
a0
324324
}
325325

326-
fn f96<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
326+
fn f96<T1>(a0: Ptr<T1>) -> Ptr<T1> {
327327
a0.to_end()
328328
}
329329

330330
fn f98<T1>(a0: Ptr<T1>, a1: usize) -> Ptr<T1> {
331331
a0.offset(a1 as isize)
332332
}
333333

334-
fn f99<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
334+
fn f99<T1>(a0: Ptr<T1>) -> Ptr<T1> {
335335
a0.to_last()
336336
}
337337

@@ -354,7 +354,7 @@ fn f103<T1: ByteRepr + Clone>(a0: Ptr<Vec<T1>>, a1: &mut Vec<T1>) {
354354
a0.write(std::mem::take(&mut *a1))
355355
}
356356

357-
fn f104<T1: 'static>(a0: Ptr<T1>) -> Ptr<T1> {
357+
fn f104<T1>(a0: Ptr<T1>) -> Ptr<T1> {
358358
a0.to_end()
359359
}
360360

0 commit comments

Comments
 (0)