about summary refs log tree commit diff
path: root/tests/ui/feature-gates/feature-gate-offset-of-slice.rs
blob: 23e8668bc685ed98b892241565e425a9490200b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use std::mem::offset_of;

struct S {
    a: u8,
    b: (u8, u8),
    c: [i32],
}

struct T {
    x: i32,
    y: S,
}

type Tup = (i32, [i32]);

fn main() {
    offset_of!(S, c); //~ ERROR size for values of type `[i32]` cannot be known at compilation time
}

fn other() {
    offset_of!(T, y); //~ ERROR size for values of type `[i32]` cannot be known at compilation time
}

fn tuple() {
    offset_of!(Tup, 1); //~ ERROR size for values of type `[i32]` cannot be known at compilation time
}