Skip to content

Commit a2152d2

Browse files
committed
tidy is reaching new levels every day...
1 parent e590b84 commit a2152d2

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Diff for: src/test/ui/consts/const-eval/ub-ref.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// ignore-tidy-linelength
21
#![feature(const_transmute)]
32
#![allow(const_err)] // make sure we cannot allow away the errors tested here
43

Diff for: src/test/ui/consts/const-eval/ub-ref.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/ub-ref.rs:9:1
2+
--> $DIR/ub-ref.rs:8:1
33
|
44
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
66
|
77
= 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
88

99
error[E0080]: it is undefined behavior to use this value
10-
--> $DIR/ub-ref.rs:12:1
10+
--> $DIR/ub-ref.rs:11:1
1111
|
1212
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
1414
|
1515
= 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
1616

1717
error[E0080]: it is undefined behavior to use this value
18-
--> $DIR/ub-ref.rs:15:1
18+
--> $DIR/ub-ref.rs:14:1
1919
|
2020
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
2121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer at .<deref>, but expected plain (non-pointer) bytes
2222
|
2323
= 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
2424

2525
error[E0080]: it is undefined behavior to use this value
26-
--> $DIR/ub-ref.rs:18:1
26+
--> $DIR/ub-ref.rs:17:1
2727
|
2828
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
2929
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling reference (created from integer)

0 commit comments

Comments
 (0)