@@ -37,14 +37,26 @@ error[E0080]: constructing invalid value: encountered an unaligned reference (re
37
37
LL | let _x: &u32 = transmute(&[0u8; 4]);
38
38
| ^^^^^^^^^^^^^^^^^^^^ evaluation of `UNALIGNED_PTR` failed here
39
39
40
+ error[E0080]: constructing invalid value: encountered a maybe-null function pointer
41
+ --> $DIR/detect-extra-ub.rs:57:20
42
+ |
43
+ LL | let _x: fn() = transmute({
44
+ | ____________________^
45
+ LL | |
46
+ LL | | fn fun() {}
47
+ LL | | let ptr = fun as fn();
48
+ LL | | (ptr as *const u8).wrapping_add(10)
49
+ LL | | });
50
+ | |______^ evaluation of `MAYBE_NULL_FN_PTR` failed here
51
+
40
52
error[E0080]: constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
41
- --> $DIR/detect-extra-ub.rs:58 :13
53
+ --> $DIR/detect-extra-ub.rs:68 :13
42
54
|
43
55
LL | let v = *addr_of!(data).cast::<UninhDiscriminant>();
44
56
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `UNINHABITED_VARIANT` failed here
45
57
46
58
error[E0080]: constructing invalid value at [0]: encountered a partial pointer or a mix of pointers
47
- --> $DIR/detect-extra-ub.rs:77 :16
59
+ --> $DIR/detect-extra-ub.rs:87 :16
48
60
|
49
61
LL | let _val = *(&mem as *const Align as *const [*const u8; 2]);
50
62
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `PARTIAL_POINTER` failed here
@@ -53,11 +65,11 @@ LL | let _val = *(&mem as *const Align as *const [*const u8; 2]);
53
65
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
54
66
55
67
error[E0080]: constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
56
- --> $DIR/detect-extra-ub.rs:91 :16
68
+ --> $DIR/detect-extra-ub.rs:101 :16
57
69
|
58
70
LL | let _val = &*slice;
59
71
| ^^^^^^^ evaluation of `OVERSIZED_REF` failed here
60
72
61
- error: aborting due to 8 previous errors
73
+ error: aborting due to 9 previous errors
62
74
63
75
For more information about this error, try `rustc --explain E0080`.
0 commit comments