Skip to content

The include_bytes! macro bugs #142027

Closed as not planned
Closed as not planned
@zhangxuan2011

Description

@zhangxuan2011

I tried this code:

const DEFAULT_FONT_DATA: &[u8] = include_bytes!("../../fonts/default.bmf");     // I'm sure that file exists and it is correct!

This includes a Bitmap font file. Lately I'm making up an operating system, and i got the exact value from the serial, and converted them as ASCII character, but it is different from the origin one.

Meta

rustc --version --verbose:

rustc 1.89.0-nightly (4d08223c0 2025-05-31)
binary: rustc
commit-hash: 4d08223c054cf5a56d9761ca925fd46ffebe7115
commit-date: 2025-05-31
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-gubCategory: the reverse of a compiler bug is generally UB

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions