rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded constants".

This commit is contained in:
Eduard-Mihai Burtescu 2018-05-17 21:28:50 +03:00
parent 072b0f617f
commit 26aad25487
35 changed files with 334 additions and 306 deletions

View file

@ -1,11 +1,11 @@
error[E0391]: cycle detected when processing `X::A::{{initializer}}`
error[E0391]: cycle detected when processing `X::A::{{constant}}`
--> $DIR/issue-23302-1.rs:14:9
|
LL | A = X::A as isize, //~ ERROR E0391
| ^^^^^^^^^^^^^
|
= note: ...which again requires processing `X::A::{{initializer}}`, completing the cycle
note: cycle used when const-evaluating `X::A::{{initializer}}`
= note: ...which again requires processing `X::A::{{constant}}`, completing the cycle
note: cycle used when const-evaluating `X::A::{{constant}}`
--> $DIR/issue-23302-1.rs:14:9
|
LL | A = X::A as isize, //~ ERROR E0391

View file

@ -1,11 +1,11 @@
error[E0391]: cycle detected when processing `Y::A::{{initializer}}`
error[E0391]: cycle detected when processing `Y::A::{{constant}}`
--> $DIR/issue-23302-2.rs:14:9
|
LL | A = Y::B as isize, //~ ERROR E0391
| ^^^^^^^^^^^^^
|
= note: ...which again requires processing `Y::A::{{initializer}}`, completing the cycle
note: cycle used when const-evaluating `Y::A::{{initializer}}`
= note: ...which again requires processing `Y::A::{{constant}}`, completing the cycle
note: cycle used when const-evaluating `Y::A::{{constant}}`
--> $DIR/issue-23302-2.rs:14:9
|
LL | A = Y::B as isize, //~ ERROR E0391

View file

@ -1,4 +1,4 @@
error[E0391]: cycle detected when processing `Foo::B::{{initializer}}`
error[E0391]: cycle detected when processing `Foo::B::{{constant}}`
--> $DIR/issue-36163.rs:14:9
|
LL | B = A, //~ ERROR E0391
@ -9,8 +9,8 @@ note: ...which requires processing `A`...
|
LL | const A: isize = Foo::B as isize;
| ^^^^^^^^^^^^^^^
= note: ...which again requires processing `Foo::B::{{initializer}}`, completing the cycle
note: cycle used when const-evaluating `Foo::B::{{initializer}}`
= note: ...which again requires processing `Foo::B::{{constant}}`, completing the cycle
note: cycle used when const-evaluating `Foo::B::{{constant}}`
--> $DIR/issue-36163.rs:14:9
|
LL | B = A, //~ ERROR E0391