Skip to content

Commit f8e2899

Browse files
authored
Address new lifetime errors in Rust 1.89 (#3620)
1 parent 63e98c1 commit f8e2899

File tree

16 files changed

+42
-42
lines changed

16 files changed

+42
-42
lines changed

crates/libs/metadata/src/reader/blob.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'a> Blob<'a> {
6161
}
6262
}
6363

64-
pub fn read_modifiers(&mut self) -> Vec<TypeDefOrRef> {
64+
pub fn read_modifiers(&mut self) -> Vec<TypeDefOrRef<'a>> {
6565
let mut mods = vec![];
6666
loop {
6767
let (value, offset) = self.peek();

crates/libs/metadata/src/reader/codes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ code! { AttributeType(3)
4242
(MemberRef, 3)
4343
}
4444

45-
impl AttributeType<'_> {
46-
pub fn parent(&self) -> MemberRefParent {
45+
impl<'a> AttributeType<'a> {
46+
pub fn parent(&self) -> MemberRefParent<'a> {
4747
match self {
4848
Self::MethodDef(row) => row.parent(),
4949
Self::MemberRef(row) => row.parent(),

crates/libs/metadata/src/reader/item_index.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<'a> ItemIndex<'a> {
4242
Self(members)
4343
}
4444

45-
pub fn iter(&self) -> impl Iterator<Item = (&str, &str, &Item)> + '_ {
45+
pub fn iter(&self) -> impl Iterator<Item = (&str, &str, &Item<'_>)> + '_ {
4646
self.0
4747
.iter()
4848
.flat_map(|(namespace, items)| {
@@ -55,11 +55,11 @@ impl<'a> ItemIndex<'a> {
5555
})
5656
}
5757

58-
pub fn items(&self) -> impl Iterator<Item = &Item> + '_ {
58+
pub fn items(&self) -> impl Iterator<Item = &Item<'_>> + '_ {
5959
self.0.values().flat_map(|items| items.values()).flatten()
6060
}
6161

62-
pub fn get(&self, namespace: &str, name: &str) -> impl Iterator<Item = &Item> + '_ {
62+
pub fn get(&self, namespace: &str, name: &str) -> impl Iterator<Item = &Item<'_>> + '_ {
6363
self.0
6464
.get(namespace)
6565
.and_then(|items| items.get(name))
@@ -68,7 +68,7 @@ impl<'a> ItemIndex<'a> {
6868
}
6969

7070
#[track_caller]
71-
pub fn expect(&self, namespace: &str, name: &str) -> &Item {
71+
pub fn expect(&self, namespace: &str, name: &str) -> &Item<'_> {
7272
let mut iter = self.get(namespace, name);
7373

7474
if let Some(item) = iter.next() {

crates/libs/metadata/src/reader/row.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub trait AsRow<'a>: Copy {
117117
)
118118
}
119119

120-
fn parent_row<P: AsRow<'a>>(&'a self, column: usize) -> P {
120+
fn parent_row<P: AsRow<'a>>(&self, column: usize) -> P {
121121
let row = self.to_row();
122122

123123
P::from_row(Row::new(

crates/libs/metadata/src/reader/tables/attribute.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ impl std::fmt::Debug for Attribute<'_> {
88
}
99
}
1010

11-
impl Attribute<'_> {
12-
pub fn parent(&self) -> HasAttribute {
11+
impl<'a> Attribute<'a> {
12+
pub fn parent(&self) -> HasAttribute<'a> {
1313
self.decode(0)
1414
}
1515

16-
pub fn ctor(&self) -> AttributeType {
16+
pub fn ctor(&self) -> AttributeType<'a> {
1717
self.decode(1)
1818
}
1919

crates/libs/metadata/src/reader/tables/constant.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::*;
22

3-
impl Constant<'_> {
3+
impl<'a> Constant<'a> {
44
pub fn ty(&self) -> Type {
55
match self.usize(0).try_into().unwrap() {
66
ELEMENT_TYPE_U1 => Type::U8,
@@ -18,7 +18,7 @@ impl Constant<'_> {
1818
}
1919
}
2020

21-
pub fn parent(&self) -> HasConstant {
21+
pub fn parent(&self) -> HasConstant<'a> {
2222
self.decode(1)
2323
}
2424

crates/libs/metadata/src/reader/tables/field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl<'a> Field<'a> {
2323
blob.read_type_signature(&[])
2424
}
2525

26-
pub fn constant(&self) -> Option<Constant> {
26+
pub fn constant(&self) -> Option<Constant<'a>> {
2727
self.equal_range(1, HasConstant::Field(*self).encode())
2828
.next()
2929
}

crates/libs/metadata/src/reader/tables/generic_param.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ impl std::fmt::Debug for GenericParam<'_> {
66
}
77
}
88

9-
impl GenericParam<'_> {
9+
impl<'a> GenericParam<'a> {
1010
pub fn sequence(&self) -> u16 {
1111
self.usize(0).try_into().unwrap()
1212
}
@@ -15,7 +15,7 @@ impl GenericParam<'_> {
1515
GenericParamAttributes(self.usize(1).try_into().unwrap())
1616
}
1717

18-
pub fn owner(&self) -> TypeOrMethodDef {
18+
pub fn owner(&self) -> TypeOrMethodDef<'a> {
1919
self.decode(2)
2020
}
2121

crates/libs/metadata/src/reader/tables/impl_map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ impl std::fmt::Debug for ImplMap<'_> {
66
}
77
}
88

9-
impl ImplMap<'_> {
9+
impl<'a> ImplMap<'a> {
1010
pub fn flags(&self) -> PInvokeAttributes {
1111
PInvokeAttributes(self.usize(0).try_into().unwrap())
1212
}
@@ -15,7 +15,7 @@ impl ImplMap<'_> {
1515
self.str(2)
1616
}
1717

18-
pub fn import_scope(&self) -> ModuleRef {
18+
pub fn import_scope(&self) -> ModuleRef<'a> {
1919
self.row(3)
2020
}
2121
}

crates/libs/metadata/src/reader/tables/interface_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ impl std::fmt::Debug for InterfaceImpl<'_> {
66
}
77
}
88

9-
impl InterfaceImpl<'_> {
10-
pub fn class(&self) -> TypeDef {
9+
impl<'a> InterfaceImpl<'a> {
10+
pub fn class(&self) -> TypeDef<'a> {
1111
self.row(0)
1212
}
1313

0 commit comments

Comments
 (0)