Skip to content

Commit 633a2e3

Browse files
committed
Suppress MIR comments for FnDef in ty::Const
1 parent 1a22a0f commit 633a2e3

File tree

64 files changed

+12
-336
lines changed

Some content is hidden

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

64 files changed

+12
-336
lines changed

src/librustc_mir/util/pretty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ impl Visitor<'tcx> for ExtraComments<'tcx> {
405405
let ty::Const { ty, val, .. } = constant;
406406
match ty.kind {
407407
ty::Int(_) | ty::Uint(_) | ty::Bool | ty::Char => {}
408+
ty::FnDef(..) => {}
408409
_ => {
409410
self.push("ty::Const");
410411
self.push(&format!("+ ty: {:?}", ty));

src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir.32bit

-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ fn main() -> () {
3737
StorageLive(_6); // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
3838
_6 = _3; // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
3939
_5 = const foo(move _6) -> bb1; // scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
40-
// ty::Const
41-
// + ty: unsafe fn(*mut usize) -> u32 {foo}
42-
// + val: Value(Scalar(<ZST>))
4340
// mir::Constant
4441
// + span: $DIR/array-index-is-temporary.rs:16:21: 16:24
4542
// + literal: Const { ty: unsafe fn(*mut usize) -> u32 {foo}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir.64bit

-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ fn main() -> () {
3737
StorageLive(_6); // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
3838
_6 = _3; // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
3939
_5 = const foo(move _6) -> bb1; // scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
40-
// ty::Const
41-
// + ty: unsafe fn(*mut usize) -> u32 {foo}
42-
// + val: Value(Scalar(<ZST>))
4340
// mir::Constant
4441
// + span: $DIR/array-index-is-temporary.rs:16:21: 16:24
4542
// + literal: Const { ty: unsafe fn(*mut usize) -> u32 {foo}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir

-6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ fn main() -> () {
1515
StorageLive(_2); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
1616
_2 = Box(S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
1717
(*_2) = const S::new() -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
18-
// ty::Const
19-
// + ty: fn() -> S {S::new}
20-
// + val: Value(Scalar(<ZST>))
2118
// mir::Constant
2219
// + span: $DIR/box_expr.rs:7:17: 7:23
2320
// + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
@@ -42,9 +39,6 @@ fn main() -> () {
4239
StorageLive(_4); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
4340
_4 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
4441
_3 = const std::mem::drop::<std::boxed::Box<S>>(move _4) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
45-
// ty::Const
46-
// + ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}
47-
// + val: Value(Scalar(<ZST>))
4842
// mir::Constant
4943
// + span: $DIR/box_expr.rs:8:5: 8:9
5044
// + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) }

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

-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
+ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
3535
_1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
3636
_0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
37-
// ty::Const
38-
// + ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}
39-
// + val: Value(Scalar(<ZST>))
4037
// mir::Constant
4138
// + span: $DIR/const-promotion-extern-static.rs:9:36: 9:42
4239
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) }

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

-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
+ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
3737
_1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
3838
_0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
39-
// ty::Const
40-
// + ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}
41-
// + val: Value(Scalar(<ZST>))
4239
// mir::Constant
4340
// + span: $DIR/const-promotion-extern-static.rs:13:47: 13:53
4441
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff

-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
StorageLive(_5); // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:10: 8:11
3232
_5 = _1; // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:10: 8:11
3333
_4 = const read(move _5) -> bb1; // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:5: 8:12
34-
// ty::Const
35-
// + ty: fn(usize) {read}
36-
// + val: Value(Scalar(<ZST>))
3734
// mir::Constant
3835
// + span: $DIR/const_prop_fails_gracefully.rs:8:5: 8:9
3936
// + literal: Const { ty: fn(usize) {read}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff

-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
bb2: {
3030
StorageLive(_2); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
3131
const std::rt::begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
32-
// ty::Const
33-
// + ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}
34-
// + val: Value(Scalar(<ZST>))
3532
// mir::Constant
3633
// + span: $SRC_DIR/std/src/macros.rs:LL:COL
3734
// + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/const_prop/issue_66971.main.ConstProp.diff

-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
(_2.2: u8) = const 0_u8; // scope 0 at $DIR/issue-66971.rs:16:12: 16:22
2424
StorageDead(_3); // scope 0 at $DIR/issue-66971.rs:16:21: 16:22
2525
_1 = const encode(move _2) -> bb1; // scope 0 at $DIR/issue-66971.rs:16:5: 16:23
26-
// ty::Const
27-
// + ty: fn(((), u8, u8)) {encode}
28-
// + val: Value(Scalar(<ZST>))
2926
// mir::Constant
3027
// + span: $DIR/issue-66971.rs:16:5: 16:11
3128
// + literal: Const { ty: fn(((), u8, u8)) {encode}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/const_prop/issue_67019.main.ConstProp.diff

-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
+ (_2.0: (u8, u8)) = (const 1_u8, const 2_u8); // scope 0 at $DIR/issue-67019.rs:11:10: 11:19
1818
StorageDead(_3); // scope 0 at $DIR/issue-67019.rs:11:18: 11:19
1919
_1 = const test(move _2) -> bb1; // scope 0 at $DIR/issue-67019.rs:11:5: 11:20
20-
// ty::Const
21-
// + ty: fn(((u8, u8),)) {test}
22-
// + val: Value(Scalar(<ZST>))
2320
// mir::Constant
2421
// + span: $DIR/issue-67019.rs:11:5: 11:9
2522
// + literal: Const { ty: fn(((u8, u8),)) {test}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff

-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
bb0: {
1616
StorageLive(_1); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:5:9: 5:14
1717
_1 = const foo() -> bb1; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:5:29: 5:34
18-
// ty::Const
19-
// + ty: fn() -> (i32, i32) {foo}
20-
// + val: Value(Scalar(<ZST>))
2118
// mir::Constant
2219
// + span: $DIR/mutable_variable_aggregate_partial_read.rs:5:29: 5:32
2320
// + literal: Const { ty: fn() -> (i32, i32) {foo}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
bb0: {
2525
StorageLive(_1); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:5:9: 5:10
2626
_1 = const foo() -> bb1; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:5:13: 5:18
27-
// ty::Const
28-
// + ty: fn() -> i32 {foo}
29-
// + val: Value(Scalar(<ZST>))
3027
// mir::Constant
3128
// + span: $DIR/mutable_variable_unprop_assign.rs:5:13: 5:16
3229
// + literal: Const { ty: fn() -> i32 {foo}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
StorageLive(_2); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:26
1515
StorageLive(_3); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:17
1616
_3 = const main as fn() (Pointer(ReifyFnPointer)); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:17
17-
// ty::Const
18-
// + ty: fn() {main}
19-
// + val: Value(Scalar(<ZST>))
2017
// mir::Constant
2118
// + span: $DIR/reify_fn_ptr.rs:4:13: 4:17
2219
// + literal: Const { ty: fn() {main}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
- _2 = const consume(move _3) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:4:5: 4:15
2020
+ _3 = const 1_u32; // scope 1 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
2121
+ _2 = const consume(const 1_u32) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:4:5: 4:15
22-
// ty::Const
23-
// + ty: fn(u32) {consume}
24-
// + val: Value(Scalar(<ZST>))
2522
// mir::Constant
2623
// + span: $DIR/scalar_literal_propagation.rs:4:5: 4:12
2724
// + literal: Const { ty: fn(u32) {consume}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/const_prop/switch_int.main.ConstProp.diff

-6
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,13 @@
1414

1515
bb1: {
1616
_0 = const foo(const -1_i32) -> bb3; // scope 0 at $DIR/switch_int.rs:9:14: 9:21
17-
// ty::Const
18-
// + ty: fn(i32) {foo}
19-
// + val: Value(Scalar(<ZST>))
2017
// mir::Constant
2118
// + span: $DIR/switch_int.rs:9:14: 9:17
2219
// + literal: Const { ty: fn(i32) {foo}, val: Value(Scalar(<ZST>)) }
2320
}
2421

2522
bb2: {
2623
_0 = const foo(const 0_i32) -> bb3; // scope 0 at $DIR/switch_int.rs:8:14: 8:20
27-
// ty::Const
28-
// + ty: fn(i32) {foo}
29-
// + val: Value(Scalar(<ZST>))
3024
// mir::Constant
3125
// + span: $DIR/switch_int.rs:8:14: 8:17
3226
// + literal: Const { ty: fn(i32) {foo}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/const_prop/switch_int.main.SimplifyBranches-after-const-prop.diff

-6
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,13 @@
1414

1515
bb1: {
1616
_0 = const foo(const -1_i32) -> bb3; // scope 0 at $DIR/switch_int.rs:9:14: 9:21
17-
// ty::Const
18-
// + ty: fn(i32) {foo}
19-
// + val: Value(Scalar(<ZST>))
2017
// mir::Constant
2118
// + span: $DIR/switch_int.rs:9:14: 9:17
2219
// + literal: Const { ty: fn(i32) {foo}, val: Value(Scalar(<ZST>)) }
2320
}
2421

2522
bb2: {
2623
_0 = const foo(const 0_i32) -> bb3; // scope 0 at $DIR/switch_int.rs:8:14: 8:20
27-
// ty::Const
28-
// + ty: fn(i32) {foo}
29-
// + val: Value(Scalar(<ZST>))
3024
// mir::Constant
3125
// + span: $DIR/switch_int.rs:8:14: 8:17
3226
// + literal: Const { ty: fn(i32) {foo}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
- _3 = _1; // scope 1 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
2020
+ _3 = (const 1_u32, const 2_u32); // scope 1 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
2121
_2 = const consume(move _3) -> bb1; // scope 1 at $DIR/tuple_literal_propagation.rs:5:5: 5:15
22-
// ty::Const
23-
// + ty: fn((u32, u32)) {consume}
24-
// + val: Value(Scalar(<ZST>))
2522
// mir::Constant
2623
// + span: $DIR/tuple_literal_propagation.rs:5:5: 5:12
2724
// + literal: Const { ty: fn((u32, u32)) {consume}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/copy_propagation_arg.bar.CopyPropagation.diff

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
StorageLive(_3); // scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
1313
_3 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
1414
_2 = const dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:16:5: 16:13
15-
// ty::Const
16-
// + ty: fn(u8) -> u8 {dummy}
17-
// + val: Value(Scalar(<ZST>))
1815
// mir::Constant
1916
// + span: $DIR/copy_propagation_arg.rs:16:5: 16:10
2017
// + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(Scalar(<ZST>)) }

src/test/mir-opt/copy_propagation_arg.foo.CopyPropagation.diff

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
StorageLive(_3); // scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
1313
_3 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
1414
_2 = const dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
15-
// ty::Const
16-
// + ty: fn(u8) -> u8 {dummy}
17-
// + val: Value(Scalar(<ZST>))
1815
// mir::Constant
1916
// + span: $DIR/copy_propagation_arg.rs:11:9: 11:14
2017
// + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(Scalar(<ZST>)) }

0 commit comments

Comments
 (0)