rust/tests/ui/thir-print/thir-flat-const-variant.stdout
Nicholas Nethercote 64ea8eb1a9 Disentangle Debug and Display for Ty.
The `Debug` impl for `Ty` just calls the `Display` impl for `Ty`. This
is surprising and annoying. In particular, it means `Debug` doesn't show
as much information as `Debug` for `TyKind` does. And `Debug` is used in
some user-facing error messages, which seems bad.

This commit changes the `Debug` impl for `Ty` to call the `Debug` impl
for `TyKind`. It also does a number of follow-up changes to preserve
existing output, many of which involve inserting
`with_no_trimmed_paths!` calls. It also adds `Display` impls for
`UserType` and `Canonical`.

Some tests have changes to expected output:
- Those that use the `rustc_abi(debug)` attribute.
- Those that use the `EMIT_MIR` annotation.

In each case the output is slightly uglier than before. This isn't
ideal, but it's pretty weird (particularly for the attribute) that the
output is using `Debug` in the first place. They're fairly obscure
attributes (I hadn't heard of them) so I'm not worried by this.

For `async-is-unwindsafe.stderr`, there is one line that now lacks a
full path. This is a consistency improvement, because all the other
mentions of `Context` in this test lack a path.
2023-09-11 12:51:07 +10:00

464 lines
12 KiB
Plaintext

DefId(0:8 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR1):
Thir {
body_type: Const(
Adt(
Foo,
[
],
),
),
arms: [],
blocks: [],
exprs: [
Expr {
kind: Tuple {
fields: [],
},
ty: (),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:12:32: 12:34 (#0),
},
Expr {
kind: Scope {
region_scope: Node(7),
lint_level: Explicit(
HirId(DefId(0:8 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR1).7),
),
value: e0,
},
ty: (),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:12:32: 12:34 (#0),
},
Expr {
kind: Adt(
AdtExpr {
adt_def: Foo,
variant_index: 0,
args: [],
user_ty: None,
fields: [
FieldExpr {
name: 0,
expr: e1,
},
],
base: None,
},
),
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:12:23: 12:35 (#0),
},
Expr {
kind: Scope {
region_scope: Node(3),
lint_level: Explicit(
HirId(DefId(0:8 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR1).3),
),
value: e2,
},
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:12:23: 12:35 (#0),
},
Expr {
kind: Scope {
region_scope: Destruction(3),
lint_level: Inherited,
value: e3,
},
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:12:23: 12:35 (#0),
},
],
stmts: [],
params: [],
}
DefId(0:9 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR2):
Thir {
body_type: Const(
Adt(
Foo,
[
],
),
),
arms: [],
blocks: [],
exprs: [
Expr {
kind: Tuple {
fields: [],
},
ty: (),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:13:33: 13:35 (#0),
},
Expr {
kind: Scope {
region_scope: Node(8),
lint_level: Explicit(
HirId(DefId(0:9 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR2).8),
),
value: e0,
},
ty: (),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:13:33: 13:35 (#0),
},
Expr {
kind: Adt(
AdtExpr {
adt_def: Foo,
variant_index: 0,
args: [],
user_ty: None,
fields: [
FieldExpr {
name: 0,
expr: e1,
},
],
base: None,
},
),
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:13:23: 13:36 (#0),
},
Expr {
kind: Scope {
region_scope: Node(3),
lint_level: Explicit(
HirId(DefId(0:9 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR2).3),
),
value: e2,
},
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:13:23: 13:36 (#0),
},
Expr {
kind: Scope {
region_scope: Destruction(3),
lint_level: Inherited,
value: e3,
},
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:13:23: 13:36 (#0),
},
],
stmts: [],
params: [],
}
DefId(0:10 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR3):
Thir {
body_type: Const(
Adt(
Foo,
[
],
),
),
arms: [],
blocks: [],
exprs: [
Expr {
kind: Tuple {
fields: [],
},
ty: (),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:14:33: 14:35 (#0),
},
Expr {
kind: Scope {
region_scope: Node(7),
lint_level: Explicit(
HirId(DefId(0:10 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR3).7),
),
value: e0,
},
ty: (),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:14:33: 14:35 (#0),
},
Expr {
kind: Adt(
AdtExpr {
adt_def: Foo,
variant_index: 0,
args: [],
user_ty: None,
fields: [
FieldExpr {
name: 0,
expr: e1,
},
],
base: None,
},
),
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:14:24: 14:36 (#0),
},
Expr {
kind: Scope {
region_scope: Node(3),
lint_level: Explicit(
HirId(DefId(0:10 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR3).3),
),
value: e2,
},
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:14:24: 14:36 (#0),
},
Expr {
kind: Scope {
region_scope: Destruction(3),
lint_level: Inherited,
value: e3,
},
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:14:24: 14:36 (#0),
},
],
stmts: [],
params: [],
}
DefId(0:11 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR4):
Thir {
body_type: Const(
Adt(
Foo,
[
],
),
),
arms: [],
blocks: [],
exprs: [
Expr {
kind: Tuple {
fields: [],
},
ty: (),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:15:34: 15:36 (#0),
},
Expr {
kind: Scope {
region_scope: Node(8),
lint_level: Explicit(
HirId(DefId(0:11 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR4).8),
),
value: e0,
},
ty: (),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:15:34: 15:36 (#0),
},
Expr {
kind: Adt(
AdtExpr {
adt_def: Foo,
variant_index: 0,
args: [],
user_ty: None,
fields: [
FieldExpr {
name: 0,
expr: e1,
},
],
base: None,
},
),
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:15:24: 15:37 (#0),
},
Expr {
kind: Scope {
region_scope: Node(3),
lint_level: Explicit(
HirId(DefId(0:11 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR4).3),
),
value: e2,
},
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:15:24: 15:37 (#0),
},
Expr {
kind: Scope {
region_scope: Destruction(3),
lint_level: Inherited,
value: e3,
},
ty: Adt(
Foo,
[
],
),
temp_lifetime: Some(
Node(3),
),
span: $DIR/thir-flat-const-variant.rs:15:24: 15:37 (#0),
},
],
stmts: [],
params: [],
}
DefId(0:12 ~ thir_flat_const_variant[1f54]::main):
Thir {
body_type: Fn(
fn(),
),
arms: [],
blocks: [
Block {
targeted_by_break: false,
region_scope: Node(1),
opt_destruction_scope: None,
span: $DIR/thir-flat-const-variant.rs:18:11: 18:13 (#0),
stmts: [],
expr: None,
safety_mode: Safe,
},
],
exprs: [
Expr {
kind: Block {
block: b0,
},
ty: (),
temp_lifetime: Some(
Node(2),
),
span: $DIR/thir-flat-const-variant.rs:18:11: 18:13 (#0),
},
Expr {
kind: Scope {
region_scope: Node(2),
lint_level: Explicit(
HirId(DefId(0:12 ~ thir_flat_const_variant[1f54]::main).2),
),
value: e0,
},
ty: (),
temp_lifetime: Some(
Node(2),
),
span: $DIR/thir-flat-const-variant.rs:18:11: 18:13 (#0),
},
Expr {
kind: Scope {
region_scope: Destruction(2),
lint_level: Inherited,
value: e1,
},
ty: (),
temp_lifetime: Some(
Node(2),
),
span: $DIR/thir-flat-const-variant.rs:18:11: 18:13 (#0),
},
],
stmts: [],
params: [],
}