Skip to content

offset_of! accepts unsized tuple field #112186

Closed
@tmiasko

Description

@tmiasko

I tried this code:

#![feature(offset_of)]
use std::fmt::Debug;
fn main() {
    core::mem::offset_of!((u8, dyn Debug), 1);
}

I expected the compilation to fail since the offset cannot be statically determined. Instead, the compilation succeeds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-offset_of`#![feature(offset_of)]`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions