@@ -462,6 +462,14 @@ pub struct CReaderCacheKey {
462462#[ rustc_pass_by_value]
463463pub struct Ty < ' tcx > ( Interned < ' tcx , WithCachedTypeInfo < TyKind < ' tcx > > > ) ;
464464
465+ impl < ' tcx > IntoKind for Ty < ' tcx > {
466+ type Kind = TyKind < ' tcx > ;
467+
468+ fn kind ( & self ) -> TyKind < ' tcx > {
469+ ( * self ) . kind ( ) . clone ( )
470+ }
471+ }
472+
465473impl EarlyParamRegion {
466474 /// Does this early bound region have a name? Early bound regions normally
467475 /// always have names except when using anonymous lifetimes (`'_`).
@@ -1517,7 +1525,7 @@ pub struct Placeholder<T> {
15171525
15181526pub type PlaceholderRegion = Placeholder < BoundRegion > ;
15191527
1520- impl rustc_type_ir:: Placeholder for PlaceholderRegion {
1528+ impl < ' tcx > rustc_type_ir:: Placeholder < TyCtxt < ' tcx > > for PlaceholderRegion {
15211529 fn universe ( & self ) -> UniverseIndex {
15221530 self . universe
15231531 }
@@ -1526,14 +1534,18 @@ impl rustc_type_ir::Placeholder for PlaceholderRegion {
15261534 self . bound . var
15271535 }
15281536
1529- fn with_updated_universe ( self , ui : UniverseIndex ) -> Self {
1530- Placeholder { universe : ui, ..self }
1537+ fn with_updated_universe ( & self , ui : UniverseIndex ) -> Self {
1538+ Placeholder { universe : ui, ..* self }
1539+ }
1540+
1541+ fn new ( ui : UniverseIndex , var : BoundVar ) -> Self {
1542+ Placeholder { universe : ui, bound : BoundRegion { var, kind : BoundRegionKind :: BrAnon } }
15311543 }
15321544}
15331545
15341546pub type PlaceholderType = Placeholder < BoundTy > ;
15351547
1536- impl rustc_type_ir:: Placeholder for PlaceholderType {
1548+ impl < ' tcx > rustc_type_ir:: Placeholder < TyCtxt < ' tcx > > for PlaceholderType {
15371549 fn universe ( & self ) -> UniverseIndex {
15381550 self . universe
15391551 }
@@ -1542,8 +1554,12 @@ impl rustc_type_ir::Placeholder for PlaceholderType {
15421554 self . bound . var
15431555 }
15441556
1545- fn with_updated_universe ( self , ui : UniverseIndex ) -> Self {
1546- Placeholder { universe : ui, ..self }
1557+ fn with_updated_universe ( & self , ui : UniverseIndex ) -> Self {
1558+ Placeholder { universe : ui, ..* self }
1559+ }
1560+
1561+ fn new ( ui : UniverseIndex , var : BoundVar ) -> Self {
1562+ Placeholder { universe : ui, bound : BoundTy { var, kind : BoundTyKind :: Anon } }
15471563 }
15481564}
15491565
@@ -1556,7 +1572,7 @@ pub struct BoundConst<'tcx> {
15561572
15571573pub type PlaceholderConst = Placeholder < BoundVar > ;
15581574
1559- impl rustc_type_ir:: Placeholder for PlaceholderConst {
1575+ impl < ' tcx > rustc_type_ir:: Placeholder < TyCtxt < ' tcx > > for PlaceholderConst {
15601576 fn universe ( & self ) -> UniverseIndex {
15611577 self . universe
15621578 }
@@ -1565,8 +1581,12 @@ impl rustc_type_ir::Placeholder for PlaceholderConst {
15651581 self . bound
15661582 }
15671583
1568- fn with_updated_universe ( self , ui : UniverseIndex ) -> Self {
1569- Placeholder { universe : ui, ..self }
1584+ fn with_updated_universe ( & self , ui : UniverseIndex ) -> Self {
1585+ Placeholder { universe : ui, ..* self }
1586+ }
1587+
1588+ fn new ( ui : UniverseIndex , var : BoundVar ) -> Self {
1589+ Placeholder { universe : ui, bound : var }
15701590 }
15711591}
15721592
0 commit comments