Skip to content

Commit 37af399

Browse files
committed
Update tests
1 parent 7bf791d commit 37af399

34 files changed

+127
-455
lines changed

library/std/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
#![feature(const_cstr_unchecked)]
247247
#![feature(const_fn_floating_point_arithmetic)]
248248
#![feature(const_fn_fn_ptr_basics)]
249-
#![feature(const_fn_transmute)]
249+
#![cfg_attr(bootstrap, feature(const_fn_transmute))]
250250
#![feature(const_io_structs)]
251251
#![feature(const_ip)]
252252
#![feature(const_ipv4)]

src/test/mir-opt/issues/issue-75439.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// EMIT_MIR issue_75439.foo.MatchBranchSimplification.diff
22

3-
#![feature(const_fn_transmute)]
4-
53
use std::mem::transmute;
64

75
pub fn foo(bytes: [u8; 16]) -> Option<[u8; 4]> {
@@ -16,5 +14,5 @@ pub fn foo(bytes: [u8; 16]) -> Option<[u8; 4]> {
1614
}
1715

1816
fn main() {
19-
let _ = foo([0; 16]);
17+
let _ = foo([0; 16]);
2018
}

src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
+ // MIR for `foo` after MatchBranchSimplification
33

44
fn foo(_1: [u8; 16]) -> Option<[u8; 4]> {
5-
debug bytes => _1; // in scope 0 at $DIR/issue-75439.rs:7:12: 7:17
6-
let mut _0: std::option::Option<[u8; 4]>; // return place in scope 0 at $DIR/issue-75439.rs:7:32: 7:47
7-
let _2: [u32; 4]; // in scope 0 at $DIR/issue-75439.rs:9:9: 9:15
8-
let mut _3: [u8; 16]; // in scope 0 at $DIR/issue-75439.rs:9:47: 9:52
9-
let mut _5: [u8; 4]; // in scope 0 at $DIR/issue-75439.rs:12:14: 12:38
10-
let mut _6: u32; // in scope 0 at $DIR/issue-75439.rs:12:33: 12:35
5+
debug bytes => _1; // in scope 0 at $DIR/issue-75439.rs:5:12: 5:17
6+
let mut _0: std::option::Option<[u8; 4]>; // return place in scope 0 at $DIR/issue-75439.rs:5:32: 5:47
7+
let _2: [u32; 4]; // in scope 0 at $DIR/issue-75439.rs:7:9: 7:15
8+
let mut _3: [u8; 16]; // in scope 0 at $DIR/issue-75439.rs:7:47: 7:52
9+
let mut _5: [u8; 4]; // in scope 0 at $DIR/issue-75439.rs:10:14: 10:38
10+
let mut _6: u32; // in scope 0 at $DIR/issue-75439.rs:10:33: 10:35
1111
scope 1 {
12-
debug dwords => _2; // in scope 1 at $DIR/issue-75439.rs:9:9: 9:15
13-
let _4: u32; // in scope 1 at $DIR/issue-75439.rs:11:27: 11:29
12+
debug dwords => _2; // in scope 1 at $DIR/issue-75439.rs:7:9: 7:15
13+
let _4: u32; // in scope 1 at $DIR/issue-75439.rs:9:27: 9:29
1414
scope 3 {
15-
debug ip => _4; // in scope 3 at $DIR/issue-75439.rs:11:27: 11:29
15+
debug ip => _4; // in scope 3 at $DIR/issue-75439.rs:9:27: 9:29
1616
scope 4 {
1717
}
1818
}
@@ -21,67 +21,67 @@
2121
}
2222

2323
bb0: {
24-
StorageLive(_2); // scope 0 at $DIR/issue-75439.rs:9:9: 9:15
25-
StorageLive(_3); // scope 2 at $DIR/issue-75439.rs:9:47: 9:52
26-
_3 = _1; // scope 2 at $DIR/issue-75439.rs:9:47: 9:52
27-
_2 = transmute::<[u8; 16], [u32; 4]>(move _3) -> bb1; // scope 2 at $DIR/issue-75439.rs:9:37: 9:53
24+
StorageLive(_2); // scope 0 at $DIR/issue-75439.rs:7:9: 7:15
25+
StorageLive(_3); // scope 2 at $DIR/issue-75439.rs:7:47: 7:52
26+
_3 = _1; // scope 2 at $DIR/issue-75439.rs:7:47: 7:52
27+
_2 = transmute::<[u8; 16], [u32; 4]>(move _3) -> bb1; // scope 2 at $DIR/issue-75439.rs:7:37: 7:53
2828
// mir::Constant
29-
// + span: $DIR/issue-75439.rs:9:37: 9:46
29+
// + span: $DIR/issue-75439.rs:7:37: 7:46
3030
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn([u8; 16]) -> [u32; 4] {std::intrinsics::transmute::<[u8; 16], [u32; 4]>}, val: Value(Scalar(<ZST>)) }
3131
}
3232

3333
bb1: {
34-
StorageDead(_3); // scope 2 at $DIR/issue-75439.rs:9:52: 9:53
35-
switchInt(_2[0 of 4]) -> [0_u32: bb2, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:11:13: 11:14
34+
StorageDead(_3); // scope 2 at $DIR/issue-75439.rs:7:52: 7:53
35+
switchInt(_2[0 of 4]) -> [0_u32: bb2, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:9:13: 9:14
3636
}
3737

3838
bb2: {
39-
switchInt(_2[1 of 4]) -> [0_u32: bb3, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:11:16: 11:17
39+
switchInt(_2[1 of 4]) -> [0_u32: bb3, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:9:16: 9:17
4040
}
4141

4242
bb3: {
43-
switchInt(_2[2 of 4]) -> [0_u32: bb6, 4294901760_u32: bb7, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:11:19: 11:20
43+
switchInt(_2[2 of 4]) -> [0_u32: bb6, 4294901760_u32: bb7, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:9:19: 9:20
4444
}
4545

4646
bb4: {
47-
discriminant(_0) = 0; // scope 1 at $DIR/issue-75439.rs:14:9: 14:13
48-
goto -> bb9; // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
47+
discriminant(_0) = 0; // scope 1 at $DIR/issue-75439.rs:12:9: 12:13
48+
goto -> bb9; // scope 1 at $DIR/issue-75439.rs:9:5: 13:6
4949
}
5050

5151
bb5: {
52-
StorageLive(_5); // scope 3 at $DIR/issue-75439.rs:12:14: 12:38
53-
StorageLive(_6); // scope 4 at $DIR/issue-75439.rs:12:33: 12:35
54-
_6 = _4; // scope 4 at $DIR/issue-75439.rs:12:33: 12:35
55-
_5 = transmute::<u32, [u8; 4]>(move _6) -> bb8; // scope 4 at $DIR/issue-75439.rs:12:23: 12:36
52+
StorageLive(_5); // scope 3 at $DIR/issue-75439.rs:10:14: 10:38
53+
StorageLive(_6); // scope 4 at $DIR/issue-75439.rs:10:33: 10:35
54+
_6 = _4; // scope 4 at $DIR/issue-75439.rs:10:33: 10:35
55+
_5 = transmute::<u32, [u8; 4]>(move _6) -> bb8; // scope 4 at $DIR/issue-75439.rs:10:23: 10:36
5656
// mir::Constant
57-
// + span: $DIR/issue-75439.rs:12:23: 12:32
57+
// + span: $DIR/issue-75439.rs:10:23: 10:32
5858
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u32) -> [u8; 4] {std::intrinsics::transmute::<u32, [u8; 4]>}, val: Value(Scalar(<ZST>)) }
5959
}
6060

6161
bb6: {
62-
StorageLive(_4); // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
63-
_4 = _2[3 of 4]; // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
64-
goto -> bb5; // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
62+
StorageLive(_4); // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
63+
_4 = _2[3 of 4]; // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
64+
goto -> bb5; // scope 1 at $DIR/issue-75439.rs:9:5: 13:6
6565
}
6666

6767
bb7: {
68-
StorageLive(_4); // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
69-
_4 = _2[3 of 4]; // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
70-
goto -> bb5; // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
68+
StorageLive(_4); // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
69+
_4 = _2[3 of 4]; // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
70+
goto -> bb5; // scope 1 at $DIR/issue-75439.rs:9:5: 13:6
7171
}
7272

7373
bb8: {
74-
StorageDead(_6); // scope 4 at $DIR/issue-75439.rs:12:35: 12:36
75-
((_0 as Some).0: [u8; 4]) = move _5; // scope 3 at $DIR/issue-75439.rs:12:9: 12:39
76-
discriminant(_0) = 1; // scope 3 at $DIR/issue-75439.rs:12:9: 12:39
77-
StorageDead(_5); // scope 3 at $DIR/issue-75439.rs:12:38: 12:39
78-
StorageDead(_4); // scope 1 at $DIR/issue-75439.rs:13:5: 13:6
79-
goto -> bb9; // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
74+
StorageDead(_6); // scope 4 at $DIR/issue-75439.rs:10:35: 10:36
75+
((_0 as Some).0: [u8; 4]) = move _5; // scope 3 at $DIR/issue-75439.rs:10:9: 10:39
76+
discriminant(_0) = 1; // scope 3 at $DIR/issue-75439.rs:10:9: 10:39
77+
StorageDead(_5); // scope 3 at $DIR/issue-75439.rs:10:38: 10:39
78+
StorageDead(_4); // scope 1 at $DIR/issue-75439.rs:11:5: 11:6
79+
goto -> bb9; // scope 1 at $DIR/issue-75439.rs:9:5: 13:6
8080
}
8181

8282
bb9: {
83-
StorageDead(_2); // scope 0 at $DIR/issue-75439.rs:16:1: 16:2
84-
return; // scope 0 at $DIR/issue-75439.rs:16:2: 16:2
83+
StorageDead(_2); // scope 0 at $DIR/issue-75439.rs:14:1: 14:2
84+
return; // scope 0 at $DIR/issue-75439.rs:14:2: 14:2
8585
}
8686
}
8787

src/test/ui/consts/const-eval/const_transmute.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22

3-
#![feature(const_fn_union)]
43
#![allow(dead_code)]
54

65
#[repr(C)]

src/test/ui/consts/const-eval/feature-gate-const_fn_union.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/test/ui/consts/const-eval/feature-gate-const_fn_union.stderr

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/test/ui/consts/const-eval/issue-49296.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// issue-49296: Unsafe shenigans in constants can result in missing errors
22

3-
#![feature(const_fn_union)]
43
#![feature(const_fn_trait_bound)]
54

65
const unsafe fn transmute<T: Copy, U: Copy>(t: T) -> U {

src/test/ui/consts/const-eval/issue-49296.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0080]: evaluation of constant value failed
2-
--> $DIR/issue-49296.rs:19:16
2+
--> $DIR/issue-49296.rs:18:16
33
|
44
LL | const X: u64 = *wat(42);
55
| ^^^^^^^^ pointer to alloc2 was dereferenced after this allocation got freed

src/test/ui/consts/const-eval/promoted_const_fn_fail.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(const_fn_union)]
2-
31
#![allow(const_err)]
42

53
#[repr(C)]

src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0716]: temporary value dropped while borrowed
2-
--> $DIR/promoted_const_fn_fail.rs:21:27
2+
--> $DIR/promoted_const_fn_fail.rs:19:27
33
|
44
LL | let x: &'static u8 = &(bar() + 1);
55
| ----------- ^^^^^^^^^^^ creates a temporary which is freed while still in use

0 commit comments

Comments
 (0)