Skip to content

Commit 8c4fbe9

Browse files
Add missing lifetime annotations for trait objects
This caused compiler errors for rust >= 1.65
1 parent 3ece4eb commit 8c4fbe9

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/vhdl/debug.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ impl<'b, 'a, 't: 'a> Alloc<'b, 't, konst2::IntegerConst<'t>> for &'a TypeVisitor
131131
}
132132
}
133133

134-
impl<'a, 'b, 't: 'a> AllocOwned<'b, 't, konst2::Const2<'t>> for &'a TypeVisitor<'t> {
134+
impl<'a, 'b, 't: 'a> AllocOwned<'b, 't, konst2::Const2<'t> + 't> for &'a TypeVisitor<'t> {
135135
fn alloc_owned(&'b self, value: OwnedConst<'t>) -> &'t Const2<'t> {
136136
self.const_arena.alloc_owned(value)
137137
}
138138
}
139139

140-
impl<'a, 'b, 't: 'a> AllocOwned<'b, 't, ty2::Type> for &'a TypeVisitor<'t> {
140+
impl<'a, 'b, 't: 'a> AllocOwned<'b, 't, ty2::Type + 't> for &'a TypeVisitor<'t> {
141141
fn alloc_owned(&'b self, value: ty2::OwnedType<'t>) -> &'t ty2::Type {
142142
self.type_arena.alloc_owned(value)
143143
}

src/vhdl/hir/expr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ pub trait Expr2<'t>: Node<'t> {
2929
pub trait ExprContext<'t>:
3030
SessionContext
3131
+ AllocInto<'t, IntegerConst<'t>>
32-
+ AllocOwnedInto<'t, Const2<'t>>
33-
+ AllocOwnedInto<'t, Type>
32+
+ AllocOwnedInto<'t, Const2<'t> + 't>
33+
+ AllocOwnedInto<'t, Type + 't>
3434
{
3535
}
3636

3737
impl<'t, T> ExprContext<'t> for T where
3838
T: SessionContext
3939
+ AllocInto<'t, IntegerConst<'t>>
40-
+ AllocOwnedInto<'t, Const2<'t>>
41-
+ AllocOwnedInto<'t, Type>
40+
+ AllocOwnedInto<'t, Const2<'t> + 't>
41+
+ AllocOwnedInto<'t, Type + 't>
4242
{
4343
}
4444

src/vhdl/hir/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::syntax::ast;
1818
#[derive(Debug)]
1919
pub struct Library<'t> {
2020
name: Name,
21-
units: Vec<&'t LatentNode<'t, Node<'t>>>,
21+
units: Vec<&'t LatentNode<'t, Node<'t> + 't>>,
2222
scope: &'t ScopeData<'t>,
2323
}
2424

@@ -59,7 +59,7 @@ impl<'t> Library<'t> {
5959
}
6060

6161
/// Return a slice of the design units in this library.
62-
pub fn units(&self) -> &[&'t LatentNode<'t, Node<'t>>] {
62+
pub fn units(&self) -> &[&'t LatentNode<'t, Node<'t> + 't>] {
6363
&self.units
6464
}
6565

src/vhdl/hir/pkg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct Package2<'t> {
1111
id: NodeId,
1212
span: Span,
1313
name: Spanned<Name>,
14-
decls: Vec<&'t LatentNode<'t, Decl2<'t>>>,
14+
decls: Vec<&'t LatentNode<'t, Decl2<'t> + 't>>,
1515
scope: &'t ScopeData<'t>,
1616
}
1717

@@ -22,7 +22,7 @@ impl<'t> Package2<'t> {
2222
}
2323

2424
/// Return the declarations made in this package.
25-
pub fn decls(&self) -> &[&'t LatentNode<'t, Decl2<'t>>] {
25+
pub fn decls(&self) -> &[&'t LatentNode<'t, Decl2<'t> + 't>] {
2626
&self.decls
2727
}
2828

src/vhdl/konst2/arena.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ make_arenas!(
1313
}
1414
);
1515

16-
impl<'t> AllocOwned<'t, 't, Const2<'t>> for ConstArena<'t> {
16+
impl<'t> AllocOwned<'t, 't, Const2<'t> + 't> for ConstArena<'t> {
1717
fn alloc_owned(&'t self, value: OwnedConst<'t>) -> &'t Const2<'t> {
1818
match value {
1919
OwnedConst::Integer(k) => self.alloc(k),

src/vhdl/scope2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::score::ResolvableName;
2323
#[derive(Copy, Clone)]
2424
pub enum Def2<'t> {
2525
/// Any node.
26-
Node(&'t hir::LatentNode<'t, Node<'t>>),
26+
Node(&'t hir::LatentNode<'t, Node<'t> + 't>),
2727
/// A library.
2828
Lib(&'t hir::Library<'t>),
2929
/// A package.

src/vhdl/ty2/arena.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ make_arenas!(
2424
}
2525
);
2626

27-
impl<'t> AllocOwned<'t, 't, Type> for TypeArena<'t> {
27+
impl<'t> AllocOwned<'t, 't, Type + 't> for TypeArena<'t> {
2828
fn alloc_owned(&'t self, value: OwnedType<'t>) -> &'t Type {
2929
match value {
3030
OwnedType::IntegerBasetype(t) => self.alloc(t),

0 commit comments

Comments
 (0)