Skip to content

Commit

Permalink
Add missing lifetime annotations for trait objects
Browse files Browse the repository at this point in the history
This caused compiler errors for rust >= 1.65
  • Loading branch information
stefanlippuner committed Sep 30, 2023
1 parent 3ece4eb commit 8c4fbe9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/vhdl/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ impl<'b, 'a, 't: 'a> Alloc<'b, 't, konst2::IntegerConst<'t>> for &'a TypeVisitor
}
}

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

impl<'a, 'b, 't: 'a> AllocOwned<'b, 't, ty2::Type> for &'a TypeVisitor<'t> {
impl<'a, 'b, 't: 'a> AllocOwned<'b, 't, ty2::Type + 't> for &'a TypeVisitor<'t> {
fn alloc_owned(&'b self, value: ty2::OwnedType<'t>) -> &'t ty2::Type {
self.type_arena.alloc_owned(value)
}
Expand Down
8 changes: 4 additions & 4 deletions src/vhdl/hir/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ pub trait Expr2<'t>: Node<'t> {
pub trait ExprContext<'t>:
SessionContext
+ AllocInto<'t, IntegerConst<'t>>
+ AllocOwnedInto<'t, Const2<'t>>
+ AllocOwnedInto<'t, Type>
+ AllocOwnedInto<'t, Const2<'t> + 't>
+ AllocOwnedInto<'t, Type + 't>
{
}

impl<'t, T> ExprContext<'t> for T where
T: SessionContext
+ AllocInto<'t, IntegerConst<'t>>
+ AllocOwnedInto<'t, Const2<'t>>
+ AllocOwnedInto<'t, Type>
+ AllocOwnedInto<'t, Const2<'t> + 't>
+ AllocOwnedInto<'t, Type + 't>
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/vhdl/hir/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::syntax::ast;
#[derive(Debug)]
pub struct Library<'t> {
name: Name,
units: Vec<&'t LatentNode<'t, Node<'t>>>,
units: Vec<&'t LatentNode<'t, Node<'t> + 't>>,
scope: &'t ScopeData<'t>,
}

Expand Down Expand Up @@ -59,7 +59,7 @@ impl<'t> Library<'t> {
}

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

Expand Down
4 changes: 2 additions & 2 deletions src/vhdl/hir/pkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct Package2<'t> {
id: NodeId,
span: Span,
name: Spanned<Name>,
decls: Vec<&'t LatentNode<'t, Decl2<'t>>>,
decls: Vec<&'t LatentNode<'t, Decl2<'t> + 't>>,
scope: &'t ScopeData<'t>,
}

Expand All @@ -22,7 +22,7 @@ impl<'t> Package2<'t> {
}

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

Expand Down
2 changes: 1 addition & 1 deletion src/vhdl/konst2/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ make_arenas!(
}
);

impl<'t> AllocOwned<'t, 't, Const2<'t>> for ConstArena<'t> {
impl<'t> AllocOwned<'t, 't, Const2<'t> + 't> for ConstArena<'t> {
fn alloc_owned(&'t self, value: OwnedConst<'t>) -> &'t Const2<'t> {
match value {
OwnedConst::Integer(k) => self.alloc(k),
Expand Down
2 changes: 1 addition & 1 deletion src/vhdl/scope2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::score::ResolvableName;
#[derive(Copy, Clone)]
pub enum Def2<'t> {
/// Any node.
Node(&'t hir::LatentNode<'t, Node<'t>>),
Node(&'t hir::LatentNode<'t, Node<'t> + 't>),
/// A library.
Lib(&'t hir::Library<'t>),
/// A package.
Expand Down
2 changes: 1 addition & 1 deletion src/vhdl/ty2/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ make_arenas!(
}
);

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

0 comments on commit 8c4fbe9

Please sign in to comment.