Skip to content

Commit d0e05f0

Browse files
committed
update tests
1 parent 0078e54 commit d0e05f0

40 files changed

+204
-285
lines changed

src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,44 +21,44 @@ fn main() -> () {
2121
}
2222

2323
alloc1 (static: FOO, size: 16, align: 8) {
24-
╾───────alloc22───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
24+
╾───────alloc28───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
2525
}
2626

27-
alloc22 (size: 72, align: 8) {
28-
0x00 │ 00 00 00 00 __ __ __ __ ╾───────alloc9────────╼ │ ....░░░░╾──────╼
27+
alloc28 (size: 72, align: 8) {
28+
0x00 │ 00 00 00 00 __ __ __ __ ╾───────alloc13───────╼ │ ....░░░░╾──────╼
2929
0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
30-
0x20 │ ╾───────alloc14───────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
31-
0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc20───────╼ │ ....*...╾──────╼
30+
0x20 │ ╾───────alloc18───────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
31+
0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc26───────╼ │ ....*...╾──────╼
3232
0x40 │ 03 00 00 00 00 00 00 00 │ ........
3333
}
3434

35-
alloc9 (size: 0, align: 8) {}
35+
alloc13 (size: 0, align: 8) {}
3636

37-
alloc14 (size: 16, align: 8) {
38-
╾───────alloc12───────╼ ╾───────alloc13───────╼ │ ╾──────╼╾──────╼
37+
alloc18 (size: 16, align: 8) {
38+
╾───────alloc16───────╼ ╾───────alloc17───────╼ │ ╾──────╼╾──────╼
3939
}
4040

41-
alloc12 (size: 1, align: 1) {
41+
alloc16 (size: 1, align: 1) {
4242
05 │ .
4343
}
4444

45-
alloc13 (size: 1, align: 1) {
45+
alloc17 (size: 1, align: 1) {
4646
06 │ .
4747
}
4848

49-
alloc20 (size: 24, align: 8) {
50-
0x00 │ ╾─────alloc17+0x3─────╼ ╾───────alloc18───────╼ │ ╾──────╼╾──────╼
51-
0x10 │ ╾─────alloc19+0x2─────╼ │ ╾──────╼
49+
alloc26 (size: 24, align: 8) {
50+
0x00 │ ╾─────alloc22+0x3─────╼ ╾───────alloc23───────╼ │ ╾──────╼╾──────╼
51+
0x10 │ ╾─────alloc25+0x2─────╼ │ ╾──────╼
5252
}
5353

54-
alloc17 (size: 4, align: 1) {
54+
alloc22 (size: 4, align: 1) {
5555
2a 45 15 6f │ *E.o
5656
}
5757

58-
alloc18 (size: 1, align: 1) {
58+
alloc23 (size: 1, align: 1) {
5959
2a │ *
6060
}
6161

62-
alloc19 (size: 4, align: 1) {
62+
alloc25 (size: 4, align: 1) {
6363
2a 45 15 6f │ *E.o
6464
}

src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- _2 = transmute::<&str, &[u8]>(move _8) -> bb14; // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
2727
+ _2 = transmute::<&str, &[u8]>(move _8) -> bb12; // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
2828
// mir::Constant
29-
// + span: $DIR/deduplicate_blocks.rs:3:11: 3:23
29+
// + span: $SRC_DIR/core/src/str/mod.rs:LL:COL
3030
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&str) -> &[u8] {transmute::<&str, &[u8]>}, val: Value(Scalar(<ZST>)) }
3131
}
3232

src/test/mir-opt/inline/inline_diverging.g.Inline.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
// mir::Constant
4040
- // + span: $DIR/inline-diverging.rs:16:9: 16:14
4141
- // + literal: Const { ty: fn() -> ! {panic}, val: Value(Scalar(<ZST>)) }
42-
+ // + span: $DIR/inline-diverging.rs:16:9: 16:16
42+
+ // + span: $SRC_DIR/std/src/panic.rs:LL:COL
4343
+ // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(Scalar(<ZST>)) }
4444
+ // mir::Constant
4545
+ // + span: $SRC_DIR/std/src/panic.rs:LL:COL

src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@
3434
- (*_5) = Vec::<u32>::new() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
3535
+ StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
3636
+ _7 = &mut (*_5); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
37-
+ ((*_7).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32>::NEW; // scope 3 at $DIR/inline-into-box-place.rs:8:33: 8:43
38-
+ // ty::Const
39-
+ // + ty: alloc::raw_vec::RawVec<u32>
40-
+ // + val: Unevaluated(alloc::raw_vec::RawVec::<T>::NEW, [u32], None)
37+
+ ((*_7).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
4138
// mir::Constant
4239
- // + span: $DIR/inline-into-box-place.rs:8:33: 8:41
4340
- // + user_ty: UserType(1)
@@ -47,8 +44,8 @@
4744
- bb2: {
4845
+ // + span: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
4946
+ // + user_ty: UserType(0)
50-
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(5:77 ~ alloc[25db]::raw_vec::{impl#0}::NEW), const_param_did: None }, substs: [u32], promoted: None }) }
51-
+ ((*_7).1: usize) = const 0_usize; // scope 3 at $DIR/inline-into-box-place.rs:8:33: 8:43
47+
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [65535], len: Size { raw: 16 } }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
48+
+ ((*_7).1: usize) = const 0_usize; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
5249
+ StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
5350
_1 = move _5; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
5451
StorageDead(_5); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43

src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn num_to_digit(_1: char) -> u32 {
3838
_8 = _2; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
3939
_7 = char::methods::<impl char>::to_digit(move _8, const 8_u32) -> bb5; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
4040
// mir::Constant
41-
// + span: $DIR/issue-59352.rs:14:8: 14:23
41+
// + span: $SRC_DIR/core/src/char/methods.rs:LL:COL
4242
// + literal: Const { ty: fn(char, u32) -> Option<u32> {char::methods::<impl char>::to_digit}, val: Value(Scalar(<ZST>)) }
4343
}
4444

src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
_14 = &mut (*_8); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
5959
_7 = <std::ops::Range<i32> as iter::range::RangeIteratorImpl>::spec_next(move _14) -> bb4; // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
6060
// mir::Constant
61-
// + span: $DIR/remove_storage_markers.rs:8:14: 8:19
61+
// + span: $SRC_DIR/core/src/iter/range.rs:LL:COL
6262
// + literal: Const { ty: for<'r> fn(&'r mut std::ops::Range<i32>) -> Option<<std::ops::Range<i32> as iter::range::RangeIteratorImpl>::Item> {<std::ops::Range<i32> as iter::range::RangeIteratorImpl>::spec_next}, val: Value(Scalar(<ZST>)) }
6363
}
6464

src/test/ui/associated-consts/defaults-cyclic-fail.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// Cyclic assoc. const defaults don't error unless *used*
55
trait Tr {
66
const A: u8 = Self::B;
7-
//~^ ERROR cycle detected when const-evaluating + checking `Tr::A`
87

98
const B: u8 = Self::A;
109
}

src/test/ui/associated-consts/defaults-cyclic-fail.stderr

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,37 @@
1-
error[E0391]: cycle detected when const-evaluating + checking `Tr::A`
2-
--> $DIR/defaults-cyclic-fail.rs:5:5
1+
error[E0391]: cycle detected when normalizing `<() as Tr>::A`
2+
|
3+
note: ...which requires simplifying constant for the type system `Tr::A`...
4+
--> $DIR/defaults-cyclic-fail.rs:6:5
5+
|
6+
LL | const A: u8 = Self::B;
7+
| ^^^^^^^^^^^^^^^^^^^^^^
8+
note: ...which requires simplifying constant for the type system `Tr::A`...
9+
--> $DIR/defaults-cyclic-fail.rs:6:5
10+
|
11+
LL | const A: u8 = Self::B;
12+
| ^^^^^^^^^^^^^^^^^^^^^^
13+
note: ...which requires const-evaluating + checking `Tr::A`...
14+
--> $DIR/defaults-cyclic-fail.rs:6:5
315
|
416
LL | const A: u8 = Self::B;
517
| ^^^^^^^^^^^^^^^^^^^^^^
18+
= note: ...which requires normalizing `<() as Tr>::B`...
19+
note: ...which requires simplifying constant for the type system `Tr::B`...
20+
--> $DIR/defaults-cyclic-fail.rs:8:5
621
|
22+
LL | const B: u8 = Self::A;
23+
| ^^^^^^^^^^^^^^^^^^^^^^
24+
note: ...which requires simplifying constant for the type system `Tr::B`...
25+
--> $DIR/defaults-cyclic-fail.rs:8:5
26+
|
27+
LL | const B: u8 = Self::A;
28+
| ^^^^^^^^^^^^^^^^^^^^^^
729
note: ...which requires const-evaluating + checking `Tr::B`...
830
--> $DIR/defaults-cyclic-fail.rs:8:5
931
|
1032
LL | const B: u8 = Self::A;
1133
| ^^^^^^^^^^^^^^^^^^^^^^
12-
= note: ...which again requires const-evaluating + checking `Tr::A`, completing the cycle
34+
= note: ...which again requires normalizing `<() as Tr>::A`, completing the cycle
1335
note: cycle used when const-evaluating + checking `main::promoted[1]`
1436
--> $DIR/defaults-cyclic-fail.rs:14:1
1537
|

src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ LL | const BAR: u32 = TRAIT_REF_BAR;
66
|
77
= note: ...which requires normalizing `TRAIT_REF_BAR`...
88
note: ...which requires simplifying constant for the type system `TRAIT_REF_BAR`...
9+
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
10+
|
11+
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
12+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
913
note: ...which requires simplifying constant for the type system `TRAIT_REF_BAR`...
1014
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
1115
|
@@ -27,9 +31,6 @@ note: ...which requires simplifying constant for the type system `<impl at $DIR/
2731
|
2832
LL | const BAR: u32 = TRAIT_REF_BAR;
2933
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30-
=======
31-
|
32-
>>>>>>> 53eca42efca (bless tests)
3334
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
3435
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
3536
|

src/test/ui/borrowck/issue-88434-minimal-example.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Regression test related to issue 88434
22

33
const _CONST: &() = &f(&|_| {});
4-
//~^ ERROR any use of this value will cause an error
5-
//~| WARNING this was previously accepted by the compiler but is being phased out
64

75
const fn f<F>(_: &F)
86
where

0 commit comments

Comments
 (0)