fabianschuiki / moore

A hardware compiler based on LLHD and CIRCT
http://www.llhd.io
Apache License 2.0
243 stars 31 forks source link

Build fails due to type deduction #251

Open snarlawar123 opened 1 year ago

snarlawar123 commented 1 year ago

I have build llvm and circt as mentioned in the README.md using submodule clone.

While installing moore using the command - cargo install --path . I get below build errors -

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
  --> src/vhdl/hir/lib.rs:21:35
   |
21 |     units: Vec<&'t LatentNode<'t, Node<'t>>>,
   |                                   ^^^^^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
  --> src/vhdl/hir/pkg.rs:14:35
   |
14 |     decls: Vec<&'t LatentNode<'t, Decl2<'t>>>,
   |                                   ^^^^^^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
  --> src/vhdl/scope2.rs:26:34
   |
26 |     Node(&'t hir::LatentNode<'t, Node<'t>>),
   |                                  ^^^^^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
   --> src/vhdl/debug.rs:134:41
    |
134 | impl<'a, 'b, 't: 'a> AllocOwned<'b, 't, konst2::Const2<'t>> for &'a TypeVisitor<'t> {
    |                                         ^^^^^^^^^^^^^^^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
   --> src/vhdl/debug.rs:140:41
    |
140 | impl<'a, 'b, 't: 'a> AllocOwned<'b, 't, ty2::Type> for &'a TypeVisitor<'t> {
    |                                         ^^^^^^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
  --> src/vhdl/hir/expr.rs:32:26
   |
32 |     + AllocOwnedInto<'t, Const2<'t>>
   |                          ^^^^^^^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
  --> src/vhdl/hir/expr.rs:33:26
   |
33 |     + AllocOwnedInto<'t, Type>
   |                          ^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
  --> src/vhdl/hir/expr.rs:40:30
   |
40 |         + AllocOwnedInto<'t, Const2<'t>>
   |                              ^^^^^^^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
  --> src/vhdl/hir/expr.rs:41:30
   |
41 |         + AllocOwnedInto<'t, Type>
   |                              ^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
  --> src/vhdl/hir/lib.rs:62:49
   |
62 |     pub fn units(&self) -> &[&'t LatentNode<'t, Node<'t>>] {
   |                                                 ^^^^^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
  --> src/vhdl/hir/pkg.rs:25:49
   |
25 |     pub fn decls(&self) -> &[&'t LatentNode<'t, Decl2<'t>>] {
   |                                                 ^^^^^^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
  --> src/vhdl/konst2/arena.rs:16:29
   |
16 | impl<'t> AllocOwned<'t, 't, Const2<'t>> for ConstArena<'t> {
   |                             ^^^^^^^^^^

error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an 
explicit bound
  --> src/vhdl/ty2/arena.rs:27:29
   |
27 | impl<'t> AllocOwned<'t, 't, Type> for TypeArena<'t> {
   |                             ^^^^

For more information about this error, try `rustc --explain E0228`.
snarlawar123 commented 1 year ago

I had used - rustc 1.65.0

Nmjfry commented 1 year ago

I tried rustc 1.63.0, it seems to work! (I had the same error)

antRainZ commented 4 months ago
rustc --version
rustc 1.63.0 (4b91a6ea7 2022-08-08)

Cargo.toml add dependencies

regex = "=1.9.6"
home = "=0.5.5"
backtrace = "=0.3.68"

Run successfully !!!

 ./test/run.sh 

...
   elaborate  ./test/vhdl/type_file.vhd(foo(bar))  [passed]
       parse  ./test/vhdl/type_int.vhd  [passed]
       parse  ./test/vhdl/type_phys.vhd  [passed]
       parse  ./test/vhdl/type_record.vhd  [passed]
       parse  ./test/vhdl/use_with_generic_pkgs.vhd  [passed]

  result: 108 passed