rust-ethereum / evm

Pure Rust implementation of Ethereum Virtual Machine
Apache License 2.0
1.16k stars 355 forks source link

`no-std` fails when trying to build #243

Closed mrLSD closed 9 months ago

mrLSD commented 9 months ago

Description

When running:

cargo build --no-default-features

There are compilation errors like:

   Compiling evm-interpreter v1.0.0-dev (/Users/evgeny/dev/rs/sputnikvm/interpreter)
error[E0412]: cannot find type `Vec` in this scope
   --> interpreter/src/call_create.rs:120:56
    |
120 |     pub fn code<H: RuntimeBackend>(&self, handler: &H) -> Vec<u8> {
    |                                                           ^^^ not found in this scope
    |
help: consider importing one of these items
    |
3   + use alloc::vec::Vec;
    |
3   + use crate::Vec;
    |

error[E0412]: cannot find type `Vec` in this scope
   --> interpreter/src/call_create.rs:131:13
    |
131 |     pub input: Vec<u8>,
    |                ^^^ not found in this scope
    |
help: consider importing one of these items
    |
3   + use alloc::vec::Vec;
    |
3   + use crate::Vec;
    |

error[E0433]: failed to resolve: use of undeclared type `Vec`
   --> interpreter/src/call_create.rs:176:15
    |
176 |             .unwrap_or(Vec::new());
    |                        ^^^ use of undeclared type `Vec`
    |
help: consider importing one of these items
    |
3   + use alloc::vec::Vec;
    |
3   + use crate::Vec;
    |

error[E0433]: failed to resolve: use of undeclared type `Vec`
   --> interpreter/src/call_create.rs:212:27
    |
212 |         state.as_mut().retbuf = Vec::new();
    |                                 ^^^ use of undeclared type `Vec`
    |
help: consider importing one of these items
    |
3   + use alloc::vec::Vec;
    |
3   + use crate::Vec;
    |

error[E0412]: cannot find type `Vec` in this scope
   --> interpreter/src/call_create.rs:268:11
    |
268 |         retbuf: Vec<u8>,
    |                 ^^^ not found in this scope
    |
help: consider importing one of these items
    |
3   + use alloc::vec::Vec;
    |
3   + use crate::Vec;
    |

error[E0412]: cannot find type `Vec` in this scope
   --> interpreter/src/call_create.rs:339:12
    |
339 |     pub code: Vec<u8>,
    |               ^^^ not found in this scope
    |
help: consider importing one of these items
    |
3   + use alloc::vec::Vec;
    |
3   + use crate::Vec;
    |

error[E0433]: failed to resolve: use of undeclared type `Vec`
   --> interpreter/src/call_create.rs:363:16
    |
363 |                 .unwrap_or(Vec::new());
    |                            ^^^ use of undeclared type `Vec`
    |
help: consider importing one of these items
    |
3   + use alloc::vec::Vec;
    |
3   + use crate::Vec;
    |

error[E0433]: failed to resolve: use of undeclared type `Vec`
   --> interpreter/src/call_create.rs:369:28
    |
369 |             state.as_mut().retbuf = Vec::new();
    |                                     ^^^ use of undeclared type `Vec`
    |
help: consider importing one of these items
    |
3   + use alloc::vec::Vec;
    |
3   + use crate::Vec;
    |

error[E0433]: failed to resolve: use of undeclared type `Vec`
   --> interpreter/src/call_create.rs:402:16
    |
402 |                 .unwrap_or(Vec::new());
    |                            ^^^ use of undeclared type `Vec`
    |
help: consider importing one of these items
    |
3   + use alloc::vec::Vec;
    |
3   + use crate::Vec;
    |

error[E0433]: failed to resolve: use of undeclared type `Vec`
   --> interpreter/src/call_create.rs:412:28
    |
412 |             state.as_mut().retbuf = Vec::new();
    |                                     ^^^ use of undeclared type `Vec`
    |
help: consider importing one of these items
    |
3   + use alloc::vec::Vec;
    |
3   + use crate::Vec;
    |

error[E0412]: cannot find type `Vec` in this scope
   --> interpreter/src/call_create.rs:428:11
    |
428 |         retbuf: Vec<u8>,
    |                 ^^^ not found in this scope
    |
help: consider importing one of these items
    |
3   + use alloc::vec::Vec;
    |
3   + use crate::Vec;
    |

error[E0412]: cannot find type `Vec` in this scope
  --> interpreter/src/runtime.rs:13:14
   |
13 |     pub retbuf: Vec<u8>,
   |                 ^^^ not found in this scope
   |
help: consider importing one of these items
   |
1  + use alloc::vec::Vec;
   |
1  + use crate::Vec;
   |

error[E0412]: cannot find type `Vec` in this scope
  --> interpreter/src/runtime.rs:64:14
   |
64 |     pub topics: Vec<H256>,
   |                 ^^^ not found in this scope
   |
help: consider importing one of these items
   |
1  + use alloc::vec::Vec;
   |
1  + use crate::Vec;
   |

error[E0412]: cannot find type `Vec` in this scope
  --> interpreter/src/runtime.rs:65:12
   |
65 |     pub data: Vec<u8>,
   |               ^^^ not found in this scope
   |
help: consider importing one of these items
   |
1  + use alloc::vec::Vec;
   |
1  + use crate::Vec;
   |

error[E0412]: cannot find type `Vec` in this scope
   --> interpreter/src/runtime.rs:111:35
    |
111 |     fn code(&self, address: H160) -> Vec<u8>;
    |                                      ^^^ not found in this scope
    |
help: consider importing one of these items
    |
1   + use alloc::vec::Vec;
    |
1   + use crate::Vec;
    |

error[E0412]: cannot find type `Vec` in this scope
   --> interpreter/src/runtime.rs:146:46
    |
146 | ...ddress: H160, code: Vec<u8>) -> Result<(), ExitError>;
    |                        ^^^ not found in this scope
    |
help: consider importing one of these items
    |
1   + use alloc::vec::Vec;
    |
1   + use crate::Vec;