Skip to content

Conversation

@fmease
Copy link
Member

@fmease fmease commented Jan 16, 2024

This introduces <Type as ~const Trait>::AssocTy and <Type as const Trait>::AssocTy under feature const_trait_impl as discussed.

In this approach, the host effect param still gets synthesized at the very end of the generic parameter list requiring us to special-case host effect args when instantiating generic parameter defaults since rustc isn't equipped to handle forward references inside defaults (hence E0128) which can now occur:

#[const_trait]
trait A<T = <() as ~const B>::Type> {}
#[const_trait]
trait B { type Type; }

////////////////////

trait A<T = <() as B</*host*/host>>::Type, /*host*/const host: bool = true> {}
//                           ^^^^ forward reference      ---- definition

I've created ty::EarlyBinder::instantiate_with_host_effect(tcx, args, host_effect) which is basically ty::EarlyBinder::instantiate but it can deal with forward references to host effect params.
CON: Requires a lot of code to re-implement instantiate and all users of type_of(type_param)/const_param_default(const_param) now need to be aware that they should use instantiate_with_host_effect instead of instantiate (which could theoretically be mitigated by introducing a new wrapper type ty::EarlyBinderWithForwardRefs).

We probably want to take approach “reorder”, this PR solely exists because it was my initial approach and because it might be helpful for others to understand the problem.


Check out the alternative approach “reorder”: #120029.
Waiting on project-const-traits for a decision on which approach to take.
r? ghost

@fmease fmease added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. S-waiting-on-team DEPRECATED: Use the team-based variants `S-waiting-on-t-lang`, `S-waiting-on-t-compiler`, ... F-const_trait_impl `#![feature(const_trait_impl)]` F-effects `#![feature(effects)]` labels Jan 16, 2024
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 16, 2024
@fmease fmease removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 16, 2024
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Built container sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Looks like docker image is the same as before, not uploading
https://ci-caches.rust-lang.org/docker/7ebc15c01a233894034d277c8cce4e949f4e7791f66b4727c8fb6e058a0b8171d6152e1441d677cef0653843ceeee469c097b8699b2bb74249e674f6aa1a8813
sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
  local time: Tue Jan 16 19:25:04 UTC 2024
  network time: Tue, 16 Jan 2024 19:25:04 GMT
  network time: Tue, 16 Jan 2024 19:25:04 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---

---- [ui] tests/ui/lang-items/required-lang-item.rs stdout ----
diff of stderr:

- error: requires `ResumeTy` lang_item
-   --> $DIR/required-lang-item.rs:10:14
+ error: requires `future_trait` lang_item
3    |
3    |
4 LL | async fn x() {}
+    | ^^^^^^^^^^^^
6 
7 error: aborting due to 1 previous error
8 
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/lang-items/required-lang-item.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lang-items/required-lang-item" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lang-items/required-lang-item/auxiliary" "--edition=2018"
stdout: none
--- stderr -------------------------------
error: requires `future_trait` lang_item
   |
   |
LL | async fn x() {} //~ ERROR requires `ResumeTy` lang_item

error: aborting due to 1 previous error
------------------------------------------



---- [ui] tests/ui/thir-print/thir-tree-match.rs stdout ----
diff of stdout:

4         ty: Foo
5         ty_span: Some($DIR/thir-tree-match.rs:15:19: 15:22 (#0))
6         self_kind: None
-         hir_id: Some(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).1))
+         hir_id: Some(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).5))
8         param: Some( 
9             Pat: {
10                 ty: Foo


14                         mutability: Not
15                         name: "foo"
16                         mode: ByValue
-                         var: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).2))
+                         var: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).6))
18                         ty: Foo
19                         is_primary: true
20                         subpattern: None
27 body:
28     Expr {
29         ty: bool
-         temp_lifetime: Some(Node(26))
-         temp_lifetime: Some(Node(26))
+         temp_lifetime: Some(Node(30))
31         span: $DIR/thir-tree-match.rs:15:32: 21:2 (#0)
33             Scope {

-                 region_scope: Node(26)
-                 region_scope: Node(26)
-                 lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).26))
+                 region_scope: Node(30)
+                 lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).30))
37                     Expr {
38                         ty: bool

-                         temp_lifetime: Some(Node(26))
-                         temp_lifetime: Some(Node(26))
+                         temp_lifetime: Some(Node(30))
40                         span: $DIR/thir-tree-match.rs:15:32: 21:2 (#0)
42                             Block {


43                                 targeted_by_break: false
44                                 span: $DIR/thir-tree-match.rs:15:32: 21:2 (#0)
-                                 region_scope: Node(25)
+                                 region_scope: Node(29)
46                                 safety_mode: Safe
47                                 stmts: []

49                                     Expr {
50                                         ty: bool
-                                         temp_lifetime: Some(Node(26))
-                                         temp_lifetime: Some(Node(26))
+                                         temp_lifetime: Some(Node(30))
52                                         span: $DIR/thir-tree-match.rs:16:5: 20:6 (#0)
54                                             Scope {

-                                                 region_scope: Node(3)
-                                                 region_scope: Node(3)
-                                                 lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).3))
+                                                 region_scope: Node(7)
+                                                 lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).7))
58                                                     Expr {
59                                                         ty: bool

-                                                         temp_lifetime: Some(Node(26))
-                                                         temp_lifetime: Some(Node(26))
+                                                         temp_lifetime: Some(Node(30))
61                                                         span: $DIR/thir-tree-match.rs:16:5: 20:6 (#0)
63                                                             Match {

64                                                                 scrutinee:
65                                                                     Expr {
65                                                                     Expr {
66                                                                         ty: Foo
-                                                                         temp_lifetime: Some(Node(26))
+                                                                         temp_lifetime: Some(Node(30))
68                                                                         span: $DIR/thir-tree-match.rs:16:11: 16:14 (#0)
70                                                                             Scope {

-                                                                                 region_scope: Node(4)
-                                                                                 region_scope: Node(4)
-                                                                                 lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).4))
+                                                                                 region_scope: Node(8)
+                                                                                 lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).8))
74                                                                                     Expr {
75                                                                                         ty: Foo

-                                                                                         temp_lifetime: Some(Node(26))
-                                                                                         temp_lifetime: Some(Node(26))
+                                                                                         temp_lifetime: Some(Node(30))
77                                                                                         span: $DIR/thir-tree-match.rs:16:11: 16:14 (#0)
79                                                                                             VarRef {


-                                                                                                 id: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).2))
+                                                                                                 id: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).6))
82                                                                                     }
83                                                                             }

124                                                                         body: 
124                                                                         body: 
125                                                                             Expr {
126                                                                                 ty: bool
-                                                                                 temp_lifetime: Some(Node(12))
+                                                                                 temp_lifetime: Some(Node(16))
128                                                                                 span: $DIR/thir-tree-match.rs:17:36: 17:40 (#0)
130                                                                                     Scope {

-                                                                                         region_scope: Node(13)
-                                                                                         region_scope: Node(13)
-                                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).13))
+                                                                                         region_scope: Node(17)
+                                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).17))
134                                                                                             Expr {
135                                                                                                 ty: bool

-                                                                                                 temp_lifetime: Some(Node(12))
-                                                                                                 temp_lifetime: Some(Node(12))
+                                                                                                 temp_lifetime: Some(Node(16))
137                                                                                                 span: $DIR/thir-tree-match.rs:17:36: 17:40 (#0)
138                                                                                                 kind: 
139                                                                                                     Literal( lit: Spanned { node: Bool(true), span: $DIR/thir-tree-match.rs:17:36: 17:40 (#0) }, neg: false)
141                                                                                             }
142                                                                                     }
143                                                                             }
143                                                                             }
-                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).12))
-                                                                         scope: Node(12)
+                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).16))
+                                                                         scope: Node(16)
146                                                                         span: $DIR/thir-tree-match.rs:17:9: 17:40 (#0)
148                                                                     Arm {

176                                                                         body: 
177                                                                             Expr {
177                                                                             Expr {
178                                                                                 ty: bool
-                                                                                 temp_lifetime: Some(Node(18))
+                                                                                 temp_lifetime: Some(Node(22))
180                                                                                 span: $DIR/thir-tree-match.rs:18:27: 18:32 (#0)
182                                                                                     Scope {

-                                                                                         region_scope: Node(19)
-                                                                                         region_scope: Node(19)
-                                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).19))
+                                                                                         region_scope: Node(23)
+                                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).23))
186                                                                                             Expr {
187                                                                                                 ty: bool

-                                                                                                 temp_lifetime: Some(Node(18))
-                                                                                                 temp_lifetime: Some(Node(18))
+                                                                                                 temp_lifetime: Some(Node(22))
189                                                                                                 span: $DIR/thir-tree-match.rs:18:27: 18:32 (#0)
190                                                                                                 kind: 
191                                                                                                     Literal( lit: Spanned { node: Bool(false), span: $DIR/thir-tree-match.rs:18:27: 18:32 (#0) }, neg: false)
193                                                                                             }
194                                                                                     }
195                                                                             }
195                                                                             }
-                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).18))
-                                                                         scope: Node(18)
+                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).22))
+                                                                         scope: Node(22)
198                                                                         span: $DIR/thir-tree-match.rs:18:9: 18:32 (#0)
200                                                                     Arm {

220                                                                         body: 
221                                                                             Expr {
221                                                                             Expr {
222                                                                                 ty: bool
-                                                                                 temp_lifetime: Some(Node(23))
+                                                                                 temp_lifetime: Some(Node(27))
224                                                                                 span: $DIR/thir-tree-match.rs:19:24: 19:28 (#0)
226                                                                                     Scope {

-                                                                                         region_scope: Node(24)
-                                                                                         region_scope: Node(24)
-                                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).24))
+                                                                                         region_scope: Node(28)
+                                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).28))
230                                                                                             Expr {
231                                                                                                 ty: bool

-                                                                                                 temp_lifetime: Some(Node(23))
-                                                                                                 temp_lifetime: Some(Node(23))
+                                                                                                 temp_lifetime: Some(Node(27))
233                                                                                                 span: $DIR/thir-tree-match.rs:19:24: 19:28 (#0)
234                                                                                                 kind: 
235                                                                                                     Literal( lit: Spanned { node: Bool(true), span: $DIR/thir-tree-match.rs:19:24: 19:28 (#0) }, neg: false)
237                                                                                             }
238                                                                                     }
239                                                                             }
239                                                                             }
-                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).23))
-                                                                         scope: Node(23)
+                                                                         lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).27))
+                                                                         scope: Node(27)
242                                                                         span: $DIR/thir-tree-match.rs:19:9: 19:28 (#0)
244                                                                 ]


The actual stdout differed from the expected stdout.
The actual stdout differed from the expected stdout.
Actual stdout saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thir-print/thir-tree-match/thir-tree-match.stdout
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args thir-print/thir-tree-match.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/thir-print/thir-tree-match.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thir-print/thir-tree-match" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thir-print/thir-tree-match/auxiliary" "-Zunpretty=thir-tree"
--- stdout -------------------------------
DefId(0:16 ~ thir_tree_match[fcf8]::has_match):
params: [
    Param {
        ty: Foo
        ty_span: Some(/checkout/tests/ui/thir-print/thir-tree-match.rs:15:19: 15:22 (#0))
        self_kind: None
        hir_id: Some(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).5))
        param: Some( 
            Pat: {
                ty: Foo
                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:15:14: 15:17 (#0)
                kind: PatKind {
                        mutability: Not
                        name: "foo"
                        mode: ByValue
                        mode: ByValue
                        var: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).6))
                        ty: Foo
                        is_primary: true
                        subpattern: None
                }
            }
        )
    }
    }
]
body:
    Expr {
        ty: bool
        temp_lifetime: Some(Node(30))
        span: /checkout/tests/ui/thir-print/thir-tree-match.rs:15:32: 21:2 (#0)
            Scope {
                region_scope: Node(30)
                region_scope: Node(30)
                lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).30))
                    Expr {
                        ty: bool
                        temp_lifetime: Some(Node(30))
                        temp_lifetime: Some(Node(30))
                        span: /checkout/tests/ui/thir-print/thir-tree-match.rs:15:32: 21:2 (#0)
                            Block {
                            Block {
                                targeted_by_break: false
                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:15:32: 21:2 (#0)
                                region_scope: Node(29)
                                safety_mode: Safe
                                stmts: []
                                    Expr {
                                        ty: bool
                                        temp_lifetime: Some(Node(30))
                                        temp_lifetime: Some(Node(30))
                                        span: /checkout/tests/ui/thir-print/thir-tree-match.rs:16:5: 20:6 (#0)
                                            Scope {
                                                region_scope: Node(7)
                                                region_scope: Node(7)
                                                lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).7))
                                                    Expr {
                                                        ty: bool
                                                        temp_lifetime: Some(Node(30))
                                                        temp_lifetime: Some(Node(30))
                                                        span: /checkout/tests/ui/thir-print/thir-tree-match.rs:16:5: 20:6 (#0)
                                                            Match {
                                                                scrutinee:
                                                                    Expr {
                                                                        ty: Foo
                                                                        ty: Foo
                                                                        temp_lifetime: Some(Node(30))
                                                                        span: /checkout/tests/ui/thir-print/thir-tree-match.rs:16:11: 16:14 (#0)
                                                                            Scope {
                                                                                region_scope: Node(8)
                                                                                region_scope: Node(8)
                                                                                lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).8))
                                                                                    Expr {
                                                                                        ty: Foo
                                                                                        temp_lifetime: Some(Node(30))
                                                                                        temp_lifetime: Some(Node(30))
                                                                                        span: /checkout/tests/ui/thir-print/thir-tree-match.rs:16:11: 16:14 (#0)
                                                                                            VarRef {
                                                                                            VarRef {
                                                                                                id: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).6))
                                                                                    }
                                                                            }
                                                                    }
                                                                arms: [
                                                                arms: [
                                                                    Arm {
                                                                        pattern: 
                                                                            Pat: {
                                                                                ty: Foo
                                                                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:17:9: 17:32 (#0)
                                                                                kind: PatKind {
                                                                                    Variant {
                                                                                        adt_def: 
                                                                                            AdtDef {
                                                                                                did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
                                                                                                variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags:  }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags:  }]
                                                                                                flags: IS_ENUM
                                                                                                repr: ReprOptions { int: None, align: None, pack: None, flags: , field_shuffle_seed: 3477539199540094892 }
                                                                                        variant_index: 0
                                                                                        subpatterns: [
                                                                                            Pat: {
                                                                                                ty: Bar
                                                                                                ty: Bar
                                                                                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:17:21: 17:31 (#0)
                                                                                                kind: PatKind {
                                                                                                    Variant {
                                                                                                        adt_def: 
                                                                                                            AdtDef {
                                                                                                                did: DefId(0:3 ~ thir_tree_match[fcf8]::Bar)
                                                                                                                variants: [VariantDef { def_id: DefId(0:4 ~ thir_tree_match[fcf8]::Bar::First), ctor: Some((Const, DefId(0:5 ~ thir_tree_match[fcf8]::Bar::First::{constructor#0}))), name: "First", discr: Relative(0), fields: [], flags:  }, VariantDef { def_id: DefId(0:6 ~ thir_tree_match[fcf8]::Bar::Second), ctor: Some((Const, DefId(0:7 ~ thir_tree_match[fcf8]::Bar::Second::{constructor#0}))), name: "Second", discr: Relative(1), fields: [], flags:  }, VariantDef { def_id: DefId(0:8 ~ thir_tree_match[fcf8]::Bar::Third), ctor: Some((Const, DefId(0:9 ~ thir_tree_match[fcf8]::Bar::Third::{constructor#0}))), name: "Third", discr: Relative(2), fields: [], flags:  }]
                                                                                                                flags: IS_ENUM
                                                                                                                repr: ReprOptions { int: None, align: None, pack: None, flags: , field_shuffle_seed: 10333377570083945360 }
                                                                                                        variant_index: 0
                                                                                                        subpatterns: []
                                                                                                    }
                                                                                                }
                                                                                                }
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                }
                                                                            }
                                                                        guard: None
                                                                        body: 
                                                                            Expr {
                                                                                ty: bool
                                                                                temp_lifetime: Some(Node(16))
                                                                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:17:36: 17:40 (#0)
                                                                                    Scope {
                                                                                        region_scope: Node(17)
                                                                                        region_scope: Node(17)
                                                                                        lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).17))
                                                                                            Expr {
                                                                                                ty: bool
                                                                                                temp_lifetime: Some(Node(16))
                                                                                                temp_lifetime: Some(Node(16))
                                                                                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:17:36: 17:40 (#0)
                                                                                                kind: 
                                                                                                    Literal( lit: Spanned { node: Bool(true), span: /checkout/tests/ui/thir-print/thir-tree-match.rs:17:36: 17:40 (#0) }, neg: false)
                                                                                            }
                                                                                    }
                                                                            }
                                                                            }
                                                                        lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).16))
                                                                        scope: Node(16)
                                                                        span: /checkout/tests/ui/thir-print/thir-tree-match.rs:17:9: 17:40 (#0)
                                                                    Arm {
                                                                        pattern: 
                                                                            Pat: {
                                                                                ty: Foo
                                                                                ty: Foo
                                                                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:18:9: 18:23 (#0)
                                                                                kind: PatKind {
                                                                                    Variant {
                                                                                        adt_def: 
                                                                                            AdtDef {
                                                                                                did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
                                                                                                variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags:  }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags:  }]
                                                                                                flags: IS_ENUM
                                                                                                repr: ReprOptions { int: None, align: None, pack: None, flags: , field_shuffle_seed: 3477539199540094892 }
                                                                                        variant_index: 0
                                                                                        subpatterns: [
                                                                                            Pat: {
                                                                                                ty: Bar
                                                                                                ty: Bar
                                                                                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:18:21: 18:22 (#0)
                                                                                                kind: PatKind {
                                                                                                }
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                    }
                                                                                }
                                                                            }
                                                                        guard: None
                                                                        body: 
                                                                            Expr {
                                                                                ty: bool
                                                                                temp_lifetime: Some(Node(22))
                                                                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:18:27: 18:32 (#0)
                                                                                    Scope {
                                                                                        region_scope: Node(23)
                                                                                        region_scope: Node(23)
                                                                                        lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).23))
                                                                                            Expr {
                                                                                                ty: bool
                                                                                                temp_lifetime: Some(Node(22))
                                                                                                temp_lifetime: Some(Node(22))
                                                                                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:18:27: 18:32 (#0)
                                                                                                kind: 
                                                                                                    Literal( lit: Spanned { node: Bool(false), span: /checkout/tests/ui/thir-print/thir-tree-match.rs:18:27: 18:32 (#0) }, neg: false)
                                                                                            }
                                                                                    }
                                                                            }
                                                                            }
                                                                        lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).22))
                                                                        scope: Node(22)
                                                                        span: /checkout/tests/ui/thir-print/thir-tree-match.rs:18:9: 18:32 (#0)
                                                                    Arm {
                                                                        pattern: 
                                                                            Pat: {
                                                                                ty: Foo
                                                                                ty: Foo
                                                                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:19:9: 19:20 (#0)
                                                                                kind: PatKind {
                                                                                    Variant {
                                                                                        adt_def: 
                                                                                            AdtDef {
                                                                                                did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
                                                                                                variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags:  }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags:  }]
                                                                                                flags: IS_ENUM
                                                                                                repr: ReprOptions { int: None, align: None, pack: None, flags: , field_shuffle_seed: 3477539199540094892 }
                                                                                        variant_index: 1
                                                                                        subpatterns: []
                                                                                    }
                                                                                }
                                                                                }
                                                                            }
                                                                        guard: None
                                                                        body: 
                                                                            Expr {
                                                                                ty: bool
                                                                                temp_lifetime: Some(Node(27))
                                                                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:19:24: 19:28 (#0)
                                                                                    Scope {
                                                                                        region_scope: Node(28)
                                                                                        region_scope: Node(28)
                                                                                        lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).28))
                                                                                            Expr {
                                                                                                ty: bool
                                                                                                temp_lifetime: Some(Node(27))
                                                                                                temp_lifetime: Some(Node(27))
                                                                                                span: /checkout/tests/ui/thir-print/thir-tree-match.rs:19:24: 19:28 (#0)
                                                                                                kind: 
                                                                                                    Literal( lit: Spanned { node: Bool(true), span: /checkout/tests/ui/thir-print/thir-tree-match.rs:19:24: 19:28 (#0) }, neg: false)
                                                                                            }
                                                                                    }
                                                                            }
                                                                            }
                                                                        lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).27))
                                                                        scope: Node(27)
                                                                        span: /checkout/tests/ui/thir-print/thir-tree-match.rs:19:9: 19:28 (#0)
                                                                ]
                                                            }
                                                    }
                                            }
                                            }
                                    }
                            }
                    }
            }
    }


DefId(0:17 ~ thir_tree_match[fcf8]::main):
params: [
body:
    Expr {
        ty: ()
        temp_lifetime: Some(Node(2))
        temp_lifetime: Some(Node(2))
        span: /checkout/tests/ui/thir-print/thir-tree-match.rs:23:11: 23:13 (#0)
            Scope {
                region_scope: Node(2)
                region_scope: Node(2)
                lint_level: Explicit(HirId(DefId(0:17 ~ thir_tree_match[fcf8]::main).2))
                    Expr {
                        ty: ()
                        temp_lifetime: Some(Node(2))
                        temp_lifetime: Some(Node(2))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-const_trait_impl `#![feature(const_trait_impl)]` F-effects `#![feature(effects)]` S-waiting-on-team DEPRECATED: Use the team-based variants `S-waiting-on-t-lang`, `S-waiting-on-t-compiler`, ... T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants