rustwasm/twiggy

`cargo install twiggy` results in a compilation error

Closed this issue ยท 1 comments

๐Ÿ› Bug Description

Trying to install twiggy results in a compilation error.

twiggy version: v0.7.0

๐Ÿ‘Ÿ Steps to Reproduce

  • Run cargo install twiggy

๐Ÿ˜ฒ Actual Behavior

Console output (click to expand)
claudiu@Dell-Latitude-5511:~$ cargo install twiggy
    Updating crates.io index
  Installing twiggy v0.7.0
  Downloaded miniz_oxide v0.5.4
  Downloaded serde_derive v1.0.145
  Downloaded object v0.29.0
  Downloaded libc v0.2.135
  Downloaded fixedbitset v0.4.2
  Downloaded unicode-segmentation v1.10.0
  Downloaded syn v1.0.102
  Downloaded unicode-ident v1.0.5
  Downloaded serde v1.0.145
  Downloaded gimli v0.26.2
  Downloaded cpp_demangle v0.3.6
  Downloaded proc-macro2 v1.0.47
  Downloaded backtrace v0.3.66
  Downloaded petgraph v0.6.2
  Downloaded 14 crates (2.5 MB) in 0.54s
   Compiling proc-macro2 v1.0.47
   Compiling quote v1.0.21
   Compiling memchr v2.5.0
   Compiling unicode-ident v1.0.5
   Compiling syn v1.0.102
   Compiling cfg-if v1.0.0
   Compiling libc v0.2.135
   Compiling version_check v0.9.4
   Compiling autocfg v1.1.0
   Compiling serde v1.0.145
   Compiling adler v1.0.2
   Compiling cc v1.0.73
   Compiling hashbrown v0.12.3
   Compiling lazy_static v1.4.0
   Compiling rustc-demangle v0.1.21
   Compiling failure_derive v0.1.8
   Compiling serde_derive v1.0.145
   Compiling cpp_demangle v0.3.6
   Compiling gimli v0.26.2
   Compiling unicode-xid v0.2.4
   Compiling fixedbitset v0.4.2
   Compiling regex-automata v0.1.10
   Compiling ryu v1.0.11
   Compiling log v0.4.17
   Compiling frozen v1.0.0
   Compiling regex-syntax v0.6.27
   Compiling stable_deref_trait v1.2.0
   Compiling itoa v0.4.8
   Compiling unicode-segmentation v1.10.0
   Compiling fallible-iterator v0.2.0
   Compiling crc32fast v1.3.2
   Compiling unicode-width v0.1.10
   Compiling target-lexicon v0.10.0
   Compiling vec_map v0.8.2
   Compiling bitflags v1.3.2
   Compiling strsim v0.8.0
   Compiling ansi_term v0.12.1
   Compiling wasmparser v0.35.3
   Compiling plain v0.2.3
   Compiling uuid v0.8.2
   Compiling parity-wasm v0.41.0
   Compiling typed-arena v2.0.1
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling indexmap v1.9.1
   Compiling miniz_oxide v0.5.4
   Compiling backtrace v0.3.66
   Compiling textwrap v0.11.0
   Compiling heck v0.3.3
   Compiling gimli v0.25.0
   Compiling addr2line v0.17.0
error: `alloc` or `std` feature is required for this crate
  --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/lib.rs:44:1
   |
44 | compile_error!("`alloc` or `std` feature is required for this crate");
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
 --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:7:5
  |
7 | use alloc::boxed::Box;
  |     ^^^^^ use of undeclared crate or module `alloc`
  |
  = help: add `extern crate alloc` to use the `alloc` crate

error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
 --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:8:5
  |
8 | use alloc::string::String;
  |     ^^^^^ use of undeclared crate or module `alloc`
  |
  = help: add `extern crate alloc` to use the `alloc` crate

error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
 --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:9:5
  |
9 | use alloc::vec::Vec;
  |     ^^^^^ use of undeclared crate or module `alloc`
  |
  = help: add `extern crate alloc` to use the `alloc` crate

error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
 --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/index_str.rs:4:5
  |
4 | use alloc::string::String;
  |     ^^^^^ use of undeclared crate or module `alloc`
  |
  = help: add `extern crate alloc` to use the `alloc` crate

error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
 --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/subs.rs:5:5
  |
5 | use alloc::vec::Vec;
  |     ^^^^^ use of undeclared crate or module `alloc`
  |
  = help: add `extern crate alloc` to use the `alloc` crate

error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
  --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/lib.rs:54:5
   |
54 | use alloc::string::String;
   |     ^^^^^ use of undeclared crate or module `alloc`
   |
   = help: add `extern crate alloc` to use the `alloc` crate

error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
  --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/lib.rs:55:5
   |
55 | use alloc::vec::Vec;
   |     ^^^^^ use of undeclared crate or module `alloc`
   |
   = help: add `extern crate alloc` to use the `alloc` crate

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |           if false { let _ = format!($fmt, $($x)*); }
    |                              ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/lib.rs:422:9
    |
422 | /         log!(
423 | |             "Successfully parsed '{}' as
424 | |
425 | | AST = {:#?}
...   |
430 | |             symbol.substitutions
431 | |         );
    | |_________- in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |         if false { let _ = format!($fmt, $($x)*); }
    |                            ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/lib.rs:452:17
    |
452 |                 log!("Demangling error: {:#?}", err);
    |                 ------------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |           if false { let _ = format!($fmt, $($x)*); }
    |                              ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/lib.rs:241:9
    |
241 | /         log!(
242 | |             "Successfully parsed '{}' as
243 | |
244 | | AST = {:#?}
...   |
249 | |             symbol.substitutions
250 | |         );
    | |_________- in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `vec` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/subs.rs:162:32
    |
162 |             non_substitutions: vec![],
    |                                ^^^

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |         if false { let _ = format!($fmt, $($x)*); }
    |                            ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/subs.rs:141:9
    |
141 |         log!("SubstitutionTable::pop @ {}: {:?}", self.len(), self.last());
    |         ------------------------------------------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |         if false { let _ = format!($fmt, $($x)*); }
    |                            ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/subs.rs:107:9
    |
107 |         log!("SubstitutionTable::insert @ {}: {:?}", idx, entity);
    |         --------------------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `vec` in this scope
    --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:7865:23
     |
7865 |     let mut results = vec![];
     |                       ^^^

error: cannot find macro `vec` in this scope
    --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:7845:23
     |
7845 |     let mut results = vec![first];
     |                       ^^^

error: cannot find macro `format` in this scope
    --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
     |
15   |         if false { let _ = format!($fmt, $($x)*); }
     |                            ^^^^^^
     |
    ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:7290:9
     |
7290 |         log!("Found a reference to @ {}", idx);
     |         -------------------------------------- in this macro invocation
     |
     = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `vec` in this scope
    --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:7158:14
     |
7158 |             (vec![], tail)
     |              ^^^

error: cannot find macro `format` in this scope
    --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
     |
15   |         if false { let _ = format!($fmt, $($x)*); }
     |                            ^^^^^^
     |
    ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:6803:21
     |
6803 |                     log!("Error writing literal: {}", e);
     |                     ------------------------------------ in this macro invocation
     |
     = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `format` in this scope
    --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
     |
15   |         if false { let _ = format!($fmt, $($x)*); }
     |                            ^^^^^^
     |
    ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:6749:17
     |
6749 |                 log!("Error writing literal: {}", e);
     |                 ------------------------------------ in this macro invocation
     |
     = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `vec` in this scope
    --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:6325:52
     |
6325 |             return Ok((UnresolvedName::Nested1(ty, vec![], name), tail));
     |                                                    ^^^

error: cannot find macro `vec` in this scope
    --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:5304:14
     |
5304 |             (vec![], tail)
     |              ^^^

error: cannot find macro `format` in this scope
    --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
     |
15   |         if false { let _ = format!($fmt, $($x)*); }
     |                            ^^^^^^
     |
    ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:5021:17
     |
5021 |                 log!("Error obtaining template argument: {}", e);
     |                 ------------------------------------------------ in this macro invocation
     |
     = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `format` in this scope
    --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
     |
15   |         if false { let _ = format!($fmt, $($x)*); }
     |                            ^^^^^^
     |
    ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:3390:25
     |
3390 |                         log!("Error getting leaf name: {:?}", ty);
     |                         ----------------------------------------- in this macro invocation
     |
     = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `format` in this scope
    --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
     |
15   |         if false { let _ = format!($fmt, $($x)*); }
     |                            ^^^^^^
     |
    ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:3378:13
     |
3378 |             log!("Error getting leaf name: {}", e);
     |             -------------------------------------- in this macro invocation
     |
     = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `vec` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:754:31
    |
754 |         let mut saved_inner = vec![];
    |                               ^^^

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |           if false { let _ = format!($fmt, $($x)*); }
    |                              ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:701:17
    |
701 | /                 log!(
702 | |                     "DemangleContext::demangle_inner_prefixes: demangling prefix: {:?}",
703 | |                     inner
704 | |                 );
    | |_________________- in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |           if false { let _ = format!($fmt, $($x)*); }
    |                              ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:695:17
    |
695 | /                 log!(
696 | |                     "DemangleContext::demangle_inner_prefixes: not a prefix, saving: {:?}",
697 | |                     inner
698 | |                 );
    | |_________________- in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `vec` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:689:29
    |
689 |         let mut new_inner = vec![];
    |                             ^^^

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |         if false { let _ = format!($fmt, $($x)*); }
    |                            ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:665:9
    |
665 |         log!("DemangleContext::pop_inner: {:?}", popped);
    |         ------------------------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |         if false { let _ = format!($fmt, $($x)*); }
    |                            ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:658:9
    |
658 |         log!("DemangleContext::push_inner: {:?}", item);
    |         ----------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |         if false { let _ = format!($fmt, $($x)*); }
    |                            ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:624:13
    |
624 |             log!("Hit too much recursion at level {}", self.max_recursion);
    |             -------------------------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `vec` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:596:20
    |
596 |             inner: vec![],
    |                    ^^^

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |         if false { let _ = format!($fmt, $($x)*); }
    |                            ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:573:9
    |
573 |         log!("DemangleContext::write: '{}'", s);
    |         --------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |         if false { let _ = format!($fmt, $($x)*); }
    |                            ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:388:9
    |
388 |         log!("ArgScopeStack::push: {:?}", item);
    |         --------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find macro `format` in this scope
   --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/logging.rs:15:28
    |
15  |         if false { let _ = format!($fmt, $($x)*); }
    |                            ^^^^^^
    |
   ::: /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/ast.rs:199:13
    |
199 |             log!("Hit too much recursion at level {}", self.max_recursion);
    |             -------------------------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `log` (in Nightly builds, run with -Z macro-backtrace for more info)

   Compiling object v0.29.0
error[E0283]: type annotations needed
  --> /home/claudiu/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.3.6/src/subs.rs:76:5
   |
74 | #[derive(Clone, Default, PartialEq, Eq)]
   |                 ------- in this derive macro expansion
75 | pub struct SubstitutionTable {
76 |     substitutions: Vec<Substitutable>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
   |
   = note: cannot satisfy `_: Default`
   = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0283, E0433.
For more information about an error, try `rustc --explain E0283`.
error: could not compile `cpp_demangle` due to 37 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `twiggy v0.7.0`, intermediate artifacts can be found at `/tmp/cargo-installSAnrZp`

It seems that the most recent release of cpp_demangle of 0.3.6 breaks twiggy.
With cpp_demangle 0.3.5 the build passed without issues.

๐Ÿค” Expected Behavior

Twiggy should be installed without compilation errors.

It was fixed in cpp_demangle - see gimli-rs/cpp_demangle#274