Skip to content

Commit f8a08a9

Browse files
committed
Update tests for erasing regions in typeck
1 parent 54f7202 commit f8a08a9

19 files changed

+108
-87
lines changed

Diff for: src/test/incremental/hashes/closure_expressions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn add_type_ascription_to_parameter() {
8484
}
8585

8686
#[cfg(not(cfail1))]
87-
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, typeck_tables_of")]
87+
#[rustc_clean(cfg="cfail2", except="HirBody, typeck_tables_of")]
8888
#[rustc_clean(cfg="cfail3")]
8989
pub fn add_type_ascription_to_parameter() {
9090
let closure = |x: u32| x + 1u32;

Diff for: src/test/incremental/hashes/inherent_impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ impl Foo {
360360
impl Foo {
361361
#[rustc_clean(
362362
cfg="cfail2",
363-
except="Hir,HirBody,generics_of,predicates_of,type_of,typeck_tables_of"
363+
except="Hir,HirBody,generics_of,predicates_of,type_of"
364364
)]
365365
#[rustc_clean(cfg="cfail3")]
366366
pub fn add_lifetime_bound_to_lifetime_param_of_method<'a, 'b: 'a>(&self) { }

Diff for: src/test/incremental/hashes/unary_and_binary_exprs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub fn var_deref(x: &i32, y: &i32) -> i32 {
8181
}
8282

8383
#[cfg(not(cfail1))]
84-
#[rustc_clean(except="HirBody,optimized_mir,mir_built,typeck_tables_of", cfg="cfail2")]
84+
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
8585
#[rustc_clean(cfg="cfail3")]
8686
pub fn var_deref(x: &i32, y: &i32) -> i32 {
8787
*y

Diff for: src/test/mir-opt/const-promotion-extern-static.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ extern "C" {
44

55
static Y: i32 = 42;
66

7-
static mut BAR: *const &'static i32 = [&Y].as_ptr();
7+
static mut BAR: *const &i32 = [&Y].as_ptr();
88

9-
static mut FOO: *const &'static i32 = [unsafe { &X }].as_ptr();
9+
static mut FOO: *const &i32 = [unsafe { &X }].as_ptr();
1010

1111
fn main() {}
1212

@@ -18,8 +18,8 @@ fn main() {}
1818
// _4 = &(*_5);
1919
// _3 = [move _4];
2020
// _2 = &_3;
21-
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
22-
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
21+
// _1 = move _2 as &[&i32] (Pointer(Unsize));
22+
// _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
2323
// }
2424
// ...
2525
// bb2: {
@@ -35,8 +35,8 @@ fn main() {}
3535
// _4 = &(*_5);
3636
// _3 = [move _4];
3737
// _2 = &_3;
38-
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
39-
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
38+
// _1 = move _2 as &[&i32] (Pointer(Unsize));
39+
// _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
4040
// }
4141
// ...
4242
// bb2: {
@@ -50,8 +50,8 @@ fn main() {}
5050
// ...
5151
// _6 = const BAR::promoted[0];
5252
// _2 = &(*_6);
53-
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
54-
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
53+
// _1 = move _2 as &[&i32] (Pointer(Unsize));
54+
// _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
5555
// }
5656
// ...
5757
// bb2: {
@@ -63,8 +63,8 @@ fn main() {}
6363
// ...
6464
// _6 = const FOO::promoted[0];
6565
// _2 = &(*_6);
66-
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
67-
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
66+
// _1 = move _2 as &[&i32] (Pointer(Unsize));
67+
// _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
6868
// }
6969
// ...
7070
// bb2: {

Diff for: src/test/mir-opt/remove_fake_borrows.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ fn main() {
2626
// goto -> bb7;
2727
// }
2828
// bb2: {
29-
// switchInt((*(*((_1 as Some).0: &'<empty> &'<empty> i32)))) -> [0i32: bb3, otherwise: bb1];
29+
// switchInt((*(*((_1 as Some).0: &&i32)))) -> [0i32: bb3, otherwise: bb1];
3030
// }
3131
// bb3: {
3232
// goto -> bb4;
3333
// }
3434
// bb4: {
3535
// _4 = &shallow _1;
36-
// _5 = &shallow ((_1 as Some).0: &'<empty> &'<empty> i32);
37-
// _6 = &shallow (*((_1 as Some).0: &'<empty> &'<empty> i32));
38-
// _7 = &shallow (*(*((_1 as Some).0: &'<empty> &'<empty> i32)));
36+
// _5 = &shallow ((_1 as Some).0: &&i32);
37+
// _6 = &shallow (*((_1 as Some).0: &&i32));
38+
// _7 = &shallow (*(*((_1 as Some).0: &&i32)));
3939
// StorageLive(_8);
4040
// _8 = _2;
4141
// switchInt(move _8) -> [false: bb6, otherwise: bb5];
@@ -72,7 +72,7 @@ fn main() {
7272
// goto -> bb7;
7373
// }
7474
// bb2: {
75-
// switchInt((*(*((_1 as Some).0: &'<empty> &'<empty> i32)))) -> [0i32: bb3, otherwise: bb1];
75+
// switchInt((*(*((_1 as Some).0: &&i32)))) -> [0i32: bb3, otherwise: bb1];
7676
// }
7777
// bb3: {
7878
// goto -> bb4;

Diff for: src/test/mir-opt/storage_live_dead_in_statics.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ fn main() {
3535

3636
// END RUST SOURCE
3737
// START rustc.XXX.mir_map.0.mir
38-
// let mut _0: &'static Foo;
39-
// let _1: &'static Foo;
38+
// let mut _0: &Foo;
39+
// let _1: &Foo;
4040
// let _2: Foo;
41-
// let mut _3: &'static [(u32, u32)];
42-
// let mut _4: &'static [(u32, u32); 42];
43-
// let _5: &'static [(u32, u32); 42];
41+
// let mut _3: &[(u32, u32)];
42+
// let mut _4: &[(u32, u32); 42];
43+
// let _5: &[(u32, u32); 42];
4444
// let _6: [(u32, u32); 42];
4545
// let mut _7: (u32, u32);
4646
// let mut _8: (u32, u32);
@@ -178,7 +178,7 @@ fn main() {
178178
// _6 = [move _7, move _8, move _9, move _10, move _11, move _12, move _13, move _14, move _15, move _16, move _17, move _18, move _19, move _20, move _21, move _22, move _23, move _24, move _25, move _26, move _27, move _28, move _29, move _30, move _31, move _32, move _33, move _34, move _35, move _36, move _37, move _38, move _39, move _40, move _41, move _42, move _43, move _44, move _45, move _46, move _47, move _48];
179179
// _5 = &_6;
180180
// _4 = &(*_5);
181-
// _3 = move _4 as &'static [(u32, u32)] (Pointer(Unsize));
181+
// _3 = move _4 as &[(u32, u32)] (Pointer(Unsize));
182182
// _2 = Foo { tup: const "hi", data: move _3 };
183183
// _1 = &_2;
184184
// _0 = &(*_1);

Diff for: src/test/pretty/issue-4264.pp

+22-22
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,29 @@
3434
((::alloc::fmt::format as
3535
for<'r> fn(std::fmt::Arguments<'r>) -> std::string::String {std::fmt::format})(((::core::fmt::Arguments::new_v1
3636
as
37-
fn(&[&str], &[std::fmt::ArgumentV1<'_>]) -> std::fmt::Arguments<'_> {std::fmt::Arguments::<'_>::new_v1})((&([("test"
38-
as
39-
&'static str)]
40-
as
41-
[&str; 1])
42-
as
43-
&[&str; 1]),
44-
(&(match (()
45-
as
46-
())
47-
{
48-
()
49-
=>
50-
([]
51-
as
52-
[std::fmt::ArgumentV1<'_>; 0]),
53-
}
54-
as
55-
[std::fmt::ArgumentV1<'_>; 0])
56-
as
57-
&[std::fmt::ArgumentV1<'_>; 0]))
37+
fn(&[&str], &[std::fmt::ArgumentV1]) -> std::fmt::Arguments {std::fmt::Arguments::new_v1})((&([("test"
38+
as
39+
&str)]
40+
as
41+
[&str; 1])
42+
as
43+
&[&str; 1]),
44+
(&(match (()
45+
as
46+
())
47+
{
48+
()
49+
=>
50+
([]
51+
as
52+
[std::fmt::ArgumentV1; 0]),
53+
}
54+
as
55+
[std::fmt::ArgumentV1; 0])
56+
as
57+
&[std::fmt::ArgumentV1; 0]))
5858
as
59-
std::fmt::Arguments<'_>))
59+
std::fmt::Arguments))
6060
as std::string::String);
6161
(res as std::string::String)
6262
} as std::string::String);

Diff for: src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
2121
| ^^^^^^^^^^^^^^^^^^^
2222
|
2323
= note: source type: `usize` (word size)
24-
= note: target type: `&'static [u8]` (2 * word size)
24+
= note: target type: `&[u8]` (2 * word size)
2525

2626
error: could not evaluate constant pattern
2727
--> $DIR/transmute-size-mismatch-before-typeck.rs:10:9

Diff for: src/test/ui/error-codes/E0121.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | static BAR: _ = "test";
1414
| ^
1515
| |
1616
| not allowed in type signatures
17-
| help: replace `_` with the correct type: `&'static str`
17+
| help: replace `_` with the correct type: `&str`
1818

1919
error: aborting due to 2 previous errors
2020

Diff for: src/test/ui/issues/issue-21174.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-
44
LL | let new: T::B = unsafe { std::mem::transmute(value) };
55
| ^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: source type: `<T as Trait<'a>>::A` (size can vary because of <T as Trait>::A)
8-
= note: target type: `<T as Trait<'a>>::B` (size can vary because of <T as Trait>::B)
7+
= note: source type: `<T as Trait>::A` (this type does not have a fixed size)
8+
= note: target type: `<T as Trait>::B` (this type does not have a fixed size)
99

1010
error: aborting due to previous error
1111

Diff for: src/test/ui/lint/uninitialized-zeroed.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: the type `&'static T` does not permit zero-initialization
1+
error: the type `&T` does not permit zero-initialization
22
--> $DIR/uninitialized-zeroed.rs:29:32
33
|
44
LL | let _val: &'static T = mem::zeroed();
@@ -14,7 +14,7 @@ LL | #![deny(invalid_value)]
1414
| ^^^^^^^^^^^^^
1515
= note: references must be non-null
1616

17-
error: the type `&'static T` does not permit being left uninitialized
17+
error: the type `&T` does not permit being left uninitialized
1818
--> $DIR/uninitialized-zeroed.rs:30:32
1919
|
2020
LL | let _val: &'static T = mem::uninitialized();
@@ -25,7 +25,7 @@ LL | let _val: &'static T = mem::uninitialized();
2525
|
2626
= note: references must be non-null
2727

28-
error: the type `Wrap<&'static T>` does not permit zero-initialization
28+
error: the type `Wrap<&T>` does not permit zero-initialization
2929
--> $DIR/uninitialized-zeroed.rs:32:38
3030
|
3131
LL | let _val: Wrap<&'static T> = mem::zeroed();
@@ -40,7 +40,7 @@ note: references must be non-null (in this struct field)
4040
LL | struct Wrap<T> { wrapped: T }
4141
| ^^^^^^^^^^
4242

43-
error: the type `Wrap<&'static T>` does not permit being left uninitialized
43+
error: the type `Wrap<&T>` does not permit being left uninitialized
4444
--> $DIR/uninitialized-zeroed.rs:33:38
4545
|
4646
LL | let _val: Wrap<&'static T> = mem::uninitialized();
@@ -121,7 +121,7 @@ LL | let _val: Void = mem::uninitialized();
121121
|
122122
= note: enums with no variants have no valid value
123123

124-
error: the type `&'static i32` does not permit zero-initialization
124+
error: the type `&i32` does not permit zero-initialization
125125
--> $DIR/uninitialized-zeroed.rs:49:34
126126
|
127127
LL | let _val: &'static i32 = mem::zeroed();
@@ -132,7 +132,7 @@ LL | let _val: &'static i32 = mem::zeroed();
132132
|
133133
= note: references must be non-null
134134

135-
error: the type `&'static i32` does not permit being left uninitialized
135+
error: the type `&i32` does not permit being left uninitialized
136136
--> $DIR/uninitialized-zeroed.rs:50:34
137137
|
138138
LL | let _val: &'static i32 = mem::uninitialized();
@@ -366,7 +366,7 @@ LL | let _val: NonBig = mem::uninitialized();
366366
|
367367
= note: `NonBig` must be initialized inside its custom valid range
368368

369-
error: the type `&'static i32` does not permit zero-initialization
369+
error: the type `&i32` does not permit zero-initialization
370370
--> $DIR/uninitialized-zeroed.rs:84:34
371371
|
372372
LL | let _val: &'static i32 = mem::transmute(0usize);
@@ -377,7 +377,7 @@ LL | let _val: &'static i32 = mem::transmute(0usize);
377377
|
378378
= note: references must be non-null
379379

380-
error: the type `&'static [i32]` does not permit zero-initialization
380+
error: the type `&[i32]` does not permit zero-initialization
381381
--> $DIR/uninitialized-zeroed.rs:85:36
382382
|
383383
LL | let _val: &'static [i32] = mem::transmute((0usize, 0usize));

Diff for: src/test/ui/pattern/usefulness/always-inhabited-union-ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn uninhab_union() -> Foo {
2121

2222
fn match_on_uninhab() {
2323
match uninhab_ref() {
24-
//~^ ERROR non-exhaustive patterns: type `&'static !` is non-empty
24+
//~^ ERROR non-exhaustive patterns: type `&!` is non-empty
2525
}
2626

2727
match uninhab_union() {

0 commit comments

Comments
 (0)