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

Error on empty code block #23

Open
mlund opened this issue Apr 5, 2023 · 0 comments
Open

Error on empty code block #23

mlund opened this issue Apr 5, 2023 · 0 comments

Comments

@mlund
Copy link

mlund commented Apr 5, 2023

Update: The error can be reproduced by simply an empty code block, {}.

This code

use ufmt_stdio::*;
d_println!("this is shown only in Debug mode")

causes a compilation error (or crash?) if in Release mode. I also tried variants where code inside the println macro is disabled by a const variable or a feature flag, and I get the same error. It seems to be a problem when the macro is empty.

The errors look like this:

error: could not compile `eleven`; 2 warnings emitted

Caused by:
  process didn't exit successfully: `rustc --crate-name eleven --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C opt-level=s -C lto -C debuginfo=2 -C metadata=e63cb991ca2c34bc -C extra-filename=-e63cb991ca2c34bc --out-dir /workspaces/eleven/target/mos-mega65-none/release/deps --target mos-mega65-none -L dependency=/workspaces/eleven/target/mos-mega65-none/release/deps -L dependency=/workspaces/eleven/target/release/deps --extern 'noprelude:alloc=/workspaces/eleven/target/mos-mega65-none/release/deps/liballoc-d34ff214b6311af9.rlib' --extern 'noprelude:compiler_builtins=/workspaces/eleven/target/mos-mega65-none/release/deps/libcompiler_builtins-0e401619b0b3b909.rlib' --extern 'noprelude:core=/workspaces/eleven/target/mos-mega65-none/release/deps/libcore-e05457835ecac2ad.rlib' --extern eleven=/workspaces/eleven/target/mos-mega65-none/release/deps/libeleven-7528eecb988352d1.rlib --extern mos_alloc=/workspaces/eleven/target/mos-mega65-none/release/deps/libmos_alloc-490e59d66c4016cc.rlib --extern mos_hardware=/workspaces/eleven/target/mos-mega65-none/release/deps/libmos_hardware-5f164b1d74cf65da.rlib --extern rand=/workspaces/eleven/target/mos-mega65-none/release/deps/librand-33b4498fcc9f23f0.rlib --extern ufmt_stdio=/workspaces/eleven/target/mos-mega65-none/release/deps/libufmt_stdio-18e7fdf3e5dfc5ae.rlib -Z unstable-options -L native=/workspaces/eleven/target/mos-mega65-none/release/build/mos-hardware-f2f66bdf1ef951b3/out -L native=/workspaces/eleven/target/mos-mega65-none/release/build/mos-hardware-f2f66bdf1ef951b3/out` (signal: 11, SIGSEGV: invalid memory reference)

Meta

I'm using the mrkits/rust-mos:latest docker image.

rustc --version --verbose:

rustc 1.66.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: aarch64-unknown-linux-gnu
release: 1.66.0-dev
LLVM version: 16.0.0
@mlund mlund changed the title Cannot use ufmt::stdio::d_println! Empty macro error / cannot use ufmt::stdio::d_println! Apr 5, 2023
@mlund mlund changed the title Empty macro error / cannot use ufmt::stdio::d_println! Empty code block error / cannot use ufmt::stdio::d_println! Apr 5, 2023
@mlund mlund changed the title Empty code block error / cannot use ufmt::stdio::d_println! Error on empty code block Apr 5, 2023
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

1 participant