Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails due to type deduction #251

Open
snarlawar123 opened this issue May 24, 2023 · 3 comments
Open

Build fails due to type deduction #251

snarlawar123 opened this issue May 24, 2023 · 3 comments

Comments

@snarlawar123
Copy link

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
Copy link
Author

I had used - rustc 1.65.0

@nmjfry
Copy link

nmjfry commented May 31, 2023

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

stefanlippuner added a commit to stefanlippuner/moore that referenced this issue Sep 10, 2023
Newer toolchains fail due to type deduction errors, see
fabianschuiki#251
stefanlippuner added a commit to stefanlippuner/moore that referenced this issue Sep 10, 2023
Newer toolchains fail due to type deduction errors, see
fabianschuiki#251
@antRainZ
Copy link

antRainZ commented Mar 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants