Skip to content

Commit 6118ee3

Browse files
committed
address review
1 parent 897adb8 commit 6118ee3

File tree

108 files changed

+214
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+214
-213
lines changed

compiler/rustc_middle/src/ty/print/pretty.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
21282128
if let Some(name) = available_names.pop() {
21292129
name
21302130
} else {
2131-
Symbol::intern(&format!("'t{}", index - num_available))
2131+
Symbol::intern(&format!("'z{}", index - num_available))
21322132
}
21332133
}
21342134

@@ -2161,7 +2161,8 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
21612161

21622162
define_scoped_cx!(self);
21632163

2164-
let possible_names = vec![Symbol::intern("'t"), Symbol::intern("'s"), Symbol::intern("'r")];
2164+
let possible_names =
2165+
('a'..='z').rev().map(|s| Symbol::intern(&format!("'{s}"))).collect::<Vec<_>>();
21652166

21662167
let mut available_names = possible_names
21672168
.into_iter()

compiler/rustc_middle/src/ty/sty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ impl<'tcx> Region<'tcx> {
14621462
ty::ReEarlyBound(ebr) => Some(ebr.name),
14631463
ty::ReLateBound(_, br) => br.kind.get_name(),
14641464
ty::ReFree(fr) => fr.bound_region.get_name(),
1465-
ty::ReStatic => Some(Symbol::intern("static")),
1465+
ty::ReStatic => Some(kw::StaticLifetime),
14661466
ty::RePlaceholder(placeholder) => placeholder.name.get_name(),
14671467
_ => None,
14681468
};

src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
_2 = <T as Clone>::clone(move _3) -> bb1; // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
2525
// mir::Constant
2626
// + span: $DIR/combine_clone_of_primitives.rs:8:5: 8:9
27-
// + literal: Const { ty: for<'r> fn(&'r T) -> T {<T as Clone>::clone}, val: Value(<ZST>) }
27+
// + literal: Const { ty: for<'a> fn(&'a T) -> T {<T as Clone>::clone}, val: Value(<ZST>) }
2828
}
2929

3030
bb1: {
@@ -37,7 +37,7 @@
3737
- _5 = <u64 as Clone>::clone(move _6) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
3838
- // mir::Constant
3939
- // + span: $DIR/combine_clone_of_primitives.rs:9:5: 9:11
40-
- // + literal: Const { ty: for<'r> fn(&'r u64) -> u64 {<u64 as Clone>::clone}, val: Value(<ZST>) }
40+
- // + literal: Const { ty: for<'a> fn(&'a u64) -> u64 {<u64 as Clone>::clone}, val: Value(<ZST>) }
4141
+ _6 = _7; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
4242
+ _5 = (*_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
4343
+ goto -> bb2; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
@@ -53,7 +53,7 @@
5353
- _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
5454
- // mir::Constant
5555
- // + span: $DIR/combine_clone_of_primitives.rs:10:5: 10:16
56-
- // + literal: Const { ty: for<'r> fn(&'r [f32; 3]) -> [f32; 3] {<[f32; 3] as Clone>::clone}, val: Value(<ZST>) }
56+
- // + literal: Const { ty: for<'a> fn(&'a [f32; 3]) -> [f32; 3] {<[f32; 3] as Clone>::clone}, val: Value(<ZST>) }
5757
+ _9 = _10; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
5858
+ _8 = (*_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
5959
+ goto -> bb3; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16

src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
_0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:31: +0:44
3434
// mir::Constant
3535
// + span: $DIR/const-promotion-extern-static.rs:9:36: 9:42
36-
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(<ZST>) }
36+
// + literal: Const { ty: for<'a> fn(&'a [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(<ZST>) }
3737
}
3838

3939
bb1: {

src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
_0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:31: +0:55
3636
// mir::Constant
3737
// + span: $DIR/const-promotion-extern-static.rs:13:47: 13:53
38-
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(<ZST>) }
38+
// + literal: Const { ty: for<'a> fn(&'a [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(<ZST>) }
3939
}
4040

4141
bb1: {

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
@@ -20,7 +20,7 @@
2020
_2 = core::str::<impl str>::as_bytes(move _3) -> bb1; // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
2121
// mir::Constant
2222
// + span: $DIR/deduplicate_blocks.rs:5:13: 5:21
23-
// + literal: Const { ty: for<'r> fn(&'r str) -> &'r [u8] {core::str::<impl str>::as_bytes}, val: Value(<ZST>) }
23+
// + literal: Const { ty: for<'a> fn(&'a str) -> &'a [u8] {core::str::<impl str>::as_bytes}, val: Value(<ZST>) }
2424
}
2525

2626
bb1: {

src/test/mir-opt/derefer_complex_case.main.Derefer.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
_7 = <std::slice::Iter<'_, i32> as Iterator>::next(move _8) -> bb3; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
5757
// mir::Constant
5858
// + span: $DIR/derefer_complex_case.rs:6:17: 6:26
59-
// + literal: Const { ty: for<'r> fn(&'r mut std::slice::Iter<'_, i32>) -> Option<<std::slice::Iter<'_, i32> as Iterator>::Item> {<std::slice::Iter<'_, i32> as Iterator>::next}, val: Value(<ZST>) }
59+
// + literal: Const { ty: for<'a> fn(&'a mut std::slice::Iter<'_, i32>) -> Option<<std::slice::Iter<'_, i32> as Iterator>::Item> {<std::slice::Iter<'_, i32> as Iterator>::next}, val: Value(<ZST>) }
6060
}
6161

6262
bb3: {

src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
- // MIR for `nrvo` before DestinationPropagation
22
+ // MIR for `nrvo` after DestinationPropagation
33

4-
fn nrvo(_1: for<'r> fn(&'r mut [u8; 1024])) -> [u8; 1024] {
4+
fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] {
55
debug init => _1; // in scope 0 at $DIR/simple.rs:+0:9: +0:13
66
let mut _0: [u8; 1024]; // return place in scope 0 at $DIR/simple.rs:+0:39: +0:49
77
let mut _2: [u8; 1024]; // in scope 0 at $DIR/simple.rs:+1:9: +1:16
88
let _3: (); // in scope 0 at $DIR/simple.rs:+2:5: +2:19
9-
let mut _4: for<'r> fn(&'r mut [u8; 1024]); // in scope 0 at $DIR/simple.rs:+2:5: +2:9
9+
let mut _4: for<'a> fn(&'a mut [u8; 1024]); // in scope 0 at $DIR/simple.rs:+2:5: +2:9
1010
let mut _5: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:+2:10: +2:18
1111
let mut _6: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:+2:10: +2:18
1212
scope 1 {

src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
_4 = Formatter::<'_>::sign_plus(move _5) -> bb1; // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
4242
// mir::Constant
4343
// + span: $DIR/funky_arms.rs:15:26: 15:35
44-
// + literal: Const { ty: for<'r> fn(&'r Formatter<'_>) -> bool {Formatter::<'_>::sign_plus}, val: Value(<ZST>) }
44+
// + literal: Const { ty: for<'a> fn(&'a Formatter<'_>) -> bool {Formatter::<'_>::sign_plus}, val: Value(<ZST>) }
4545
}
4646

4747
bb1: {
@@ -69,7 +69,7 @@
6969
_7 = Formatter::<'_>::precision(move _8) -> bb5; // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
7070
// mir::Constant
7171
// + span: $DIR/funky_arms.rs:24:34: 24:43
72-
// + literal: Const { ty: for<'r> fn(&'r Formatter<'_>) -> Option<usize> {Formatter::<'_>::precision}, val: Value(<ZST>) }
72+
// + literal: Const { ty: for<'a> fn(&'a Formatter<'_>) -> Option<usize> {Formatter::<'_>::precision}, val: Value(<ZST>) }
7373
}
7474

7575
bb5: {
@@ -100,7 +100,7 @@
100100
_0 = float_to_exponential_common_exact::<T>(move _11, move _12, move _13, move _14, move _17) -> bb7; // scope 3 at $DIR/funky_arms.rs:+15:9: +15:87
101101
// mir::Constant
102102
// + span: $DIR/funky_arms.rs:26:9: 26:42
103-
// + literal: Const { ty: for<'r, 's, 't> fn(&'r mut Formatter<'s>, &'t T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::<T>}, val: Value(<ZST>) }
103+
// + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::<T>}, val: Value(<ZST>) }
104104
}
105105

106106
bb7: {
@@ -125,7 +125,7 @@
125125
_0 = float_to_exponential_common_shortest::<T>(move _18, move _19, move _20, move _21) -> bb9; // scope 2 at $DIR/funky_arms.rs:+17:9: +17:68
126126
// mir::Constant
127127
// + span: $DIR/funky_arms.rs:28:9: 28:45
128-
// + literal: Const { ty: for<'r, 's, 't> fn(&'r mut Formatter<'s>, &'t T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::<T>}, val: Value(<ZST>) }
128+
// + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::<T>}, val: Value(<ZST>) }
129129
}
130130

131131
bb9: {

src/test/mir-opt/inline/cycle.f.Inline.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
_2 = <impl Fn() as Fn<()>>::call(move _3, move _4) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/cycle.rs:+1:5: +1:8
1818
// mir::Constant
1919
// + span: $DIR/cycle.rs:6:5: 6:6
20-
// + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) }
20+
// + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) }
2121
}
2222

2323
bb1: {

0 commit comments

Comments
 (0)