summaryrefslogtreecommitdiffstats
path: root/tests/ui/offset-of/offset-of-unsized.rs
blob: 49c8328da5c553806dc749a1835e01600294ac9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// build-pass
// regression test for #112051, not in `offset-of-dst` as the issue is in codegen,
// and isn't triggered in the presence of typeck errors

#![feature(offset_of)]

struct S<T: ?Sized> {
    a: u64,
    b: T,
}
trait Tr {}

fn main() {
    let _a = core::mem::offset_of!(S<dyn Tr>, a);
    let _b = core::mem::offset_of!((u64, dyn Tr), 0);
}