@@ -37,14 +37,26 @@ error[E0080]: constructing invalid value: encountered an unaligned reference (re
3737LL | let _x: &u32 = transmute(&[0u8; 4]);
3838 | ^^^^^^^^^^^^^^^^^^^^ evaluation of `UNALIGNED_PTR` failed here
3939
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+
4052error[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
4254 |
4355LL | let v = *addr_of!(data).cast::<UninhDiscriminant>();
4456 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `UNINHABITED_VARIANT` failed here
4557
4658error[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
4860 |
4961LL | let _val = *(&mem as *const Align as *const [*const u8; 2]);
5062 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `PARTIAL_POINTER` failed here
@@ -53,11 +65,11 @@ LL | let _val = *(&mem as *const Align as *const [*const u8; 2]);
5365 = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
5466
5567error[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
5769 |
5870LL | let _val = &*slice;
5971 | ^^^^^^^ evaluation of `OVERSIZED_REF` failed here
6072
61- error: aborting due to 8 previous errors
73+ error: aborting due to 9 previous errors
6274
6375For more information about this error, try `rustc --explain E0080`.
0 commit comments