|
1 | 1 | error[E0080]: this constant likely exhibits undefined behavior
|
2 |
| - --> $DIR/union-ub-fat-ptr.rs:76:1 |
| 2 | + --> $DIR/union-ub-fat-ptr.rs:79:1 |
3 | 3 | |
|
4 | 4 | LL | const B: &str = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len: 999 } }.str};
|
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access at offset N, outside bounds of allocation N which has size N
|
6 | 6 | |
|
7 | 7 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
8 | 8 |
|
9 | 9 | error[E0080]: this constant likely exhibits undefined behavior
|
10 |
| - --> $DIR/union-ub-fat-ptr.rs:79:1 |
| 10 | + --> $DIR/union-ub-fat-ptr.rs:82:1 |
11 | 11 | |
|
12 | 12 | LL | const C: &str = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.str};
|
13 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered length is not a valid integer |
| 13 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered fat pointer length is not a valid integer |
14 | 14 | |
|
15 | 15 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
16 | 16 |
|
17 | 17 | error[E0080]: this constant likely exhibits undefined behavior
|
18 | 18 | --> $DIR/union-ub-fat-ptr.rs:85:1
|
19 | 19 | |
|
| 20 | +LL | const C2: &Str = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.my_str}; |
| 21 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered fat pointer length is not a valid integer |
| 22 | + | |
| 23 | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior |
| 24 | + |
| 25 | +error[E0080]: this constant likely exhibits undefined behavior |
| 26 | + --> $DIR/union-ub-fat-ptr.rs:91:1 |
| 27 | + | |
20 | 28 | LL | const B2: &[u8] = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len: 999 } }.slice};
|
21 | 29 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access at offset N, outside bounds of allocation N which has size N
|
22 | 30 | |
|
23 | 31 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
24 | 32 |
|
25 | 33 | error[E0080]: this constant likely exhibits undefined behavior
|
26 |
| - --> $DIR/union-ub-fat-ptr.rs:88:1 |
| 34 | + --> $DIR/union-ub-fat-ptr.rs:94:1 |
27 | 35 | |
|
28 |
| -LL | const C2: &[u8] = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.slice}; |
29 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered length is not a valid integer |
| 36 | +LL | const C3: &[u8] = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.slice}; |
| 37 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered fat pointer length is not a valid integer |
30 | 38 | |
|
31 | 39 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
32 | 40 |
|
33 | 41 | error[E0080]: this constant likely exhibits undefined behavior
|
34 |
| - --> $DIR/union-ub-fat-ptr.rs:92:1 |
| 42 | + --> $DIR/union-ub-fat-ptr.rs:98:1 |
35 | 43 | |
|
36 | 44 | LL | const D: &Trait = unsafe { DynTransmute { repr: DynRepr { ptr: &92, vtable: &3 } }.rust};
|
37 | 45 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tried to access memory with alignment N, but alignment N is required
|
38 | 46 | |
|
39 | 47 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
40 | 48 |
|
41 | 49 | error[E0080]: this constant likely exhibits undefined behavior
|
42 |
| - --> $DIR/union-ub-fat-ptr.rs:95:1 |
| 50 | + --> $DIR/union-ub-fat-ptr.rs:101:1 |
43 | 51 | |
|
44 | 52 | LL | const E: &Trait = unsafe { DynTransmute { repr2: DynRepr2 { ptr: &92, vtable: &3 } }.rust};
|
45 | 53 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a memory access tried to interpret some bytes as a pointer
|
46 | 54 | |
|
47 | 55 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
48 | 56 |
|
49 | 57 | error[E0080]: this constant likely exhibits undefined behavior
|
50 |
| - --> $DIR/union-ub-fat-ptr.rs:98:1 |
| 58 | + --> $DIR/union-ub-fat-ptr.rs:104:1 |
51 | 59 | |
|
52 | 60 | LL | const F: &Trait = unsafe { DynTransmute { bad: BadDynRepr { ptr: &92, vtable: 3 } }.rust};
|
53 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered vtable address is not a pointer |
| 61 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered fat pointer length is not a valid integer |
54 | 62 | |
|
55 | 63 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
56 | 64 |
|
57 | 65 | error[E0080]: this constant likely exhibits undefined behavior
|
58 |
| - --> $DIR/union-ub-fat-ptr.rs:102:1 |
| 66 | + --> $DIR/union-ub-fat-ptr.rs:108:1 |
59 | 67 | |
|
60 | 68 | LL | const G: &Trait = &unsafe { BoolTransmute { val: 3 }.bl };
|
61 | 69 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 3 at .<deref>, but expected something in the range 0..=1
|
62 | 70 | |
|
63 | 71 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
64 | 72 |
|
65 | 73 | error[E0080]: this constant likely exhibits undefined behavior
|
66 |
| - --> $DIR/union-ub-fat-ptr.rs:106:1 |
| 74 | + --> $DIR/union-ub-fat-ptr.rs:112:1 |
67 | 75 | |
|
68 | 76 | LL | const H: &[bool] = &[unsafe { BoolTransmute { val: 3 }.bl }];
|
69 | 77 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 3 at .<deref>[0], but expected something in the range 0..=1
|
70 | 78 | |
|
71 | 79 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
72 | 80 |
|
73 |
| -error: aborting due to 9 previous errors |
| 81 | +error: aborting due to 10 previous errors |
74 | 82 |
|
75 | 83 | For more information about this error, try `rustc --explain E0080`.
|
0 commit comments