You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use rustpython_vm as vm;fnmain() -> vm::PyResult<()>{
vm::Interpreter::without_stdlib(Default::default()).enter(|vm| {let scope = vm.new_scope_with_builtins();let source = r#"print("Hello World!")"#;let code_obj = vm
.compile(source, vm::compiler::Mode::Exec,"<embedded>".to_owned()).map_err(|err| vm.new_syntax_error(&err,Some(source)))?;
vm.run_code_obj(code_obj, scope)?;Ok(())})}
But when I try a cargo run --release with the code above, I get an assertion error:
Compiling rustpython-compiler-core v0.3.0
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-->~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustpython-ast-0.3.0/src/impls.rs:60:1
|
60 | static_assertions::assert_eq_size!(crate::Stmt, [u8; 160]);| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: source type: `generic::Stmt` (1216 bits)
= note: target type: `[u8; 160]` (1280 bits)
= note: this error originates in the macro `static_assertions::assert_eq_size` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-->~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustpython-ast-0.3.0/src/impls.rs:62:1
|
62 | static_assertions::assert_eq_size!(crate::Pattern, [u8; 96]);| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: source type: `generic::Pattern` (704 bits)
= note: target type: `[u8; 96]` (768 bits)
= note: this error originates in the macro `static_assertions::assert_eq_size` (in Nightly builds, run with -Z macro-backtrace for more info)
Compiling rustpython-derive-impl v0.3.0
For more information about this error, try `rustc --explain E0512`.
error: could not compile `rustpython-ast` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
~/dev/creative/nannou-sketches/rustpython-101 13:51:08
Summary
Hi all!
And thank you for the super interesting project.
I'm not sure if this is a bug or not - technically it's just a compile issue.
I wanted to try the embedded example (https://github.com/RustPython/RustPython/blob/main/examples/hello_embed.rs) :
But when I try a
cargo run --release
with the code above, I get an assertion error:I'm on:
$ rustc --version rustc 1.76.0 (07dca489a 2024-02-04) # Arch linux $ uname -r 6.7.2-arch1-2
And this is my
Cargo.toml
:Expected
The
hello_embed.rs
code run without errors.Actual
The
hello_embed.rs
example code doesn't compile.Thanks!
The text was updated successfully, but these errors were encountered: