@@ -463,6 +463,14 @@ pub struct CReaderCacheKey {
463463#[ rustc_pass_by_value]
464464pub struct Ty < ' tcx > ( Interned < ' tcx , WithCachedTypeInfo < TyKind < ' tcx > > > ) ;
465465
466+ impl < ' tcx > IntoKind for Ty < ' tcx > {
467+ type Kind = TyKind < ' tcx > ;
468+
469+ fn kind ( & self ) -> TyKind < ' tcx > {
470+ ( * self ) . kind ( ) . clone ( )
471+ }
472+ }
473+
466474impl ty:: EarlyBoundRegion {
467475 /// Does this early bound region have a name? Early bound regions normally
468476 /// always have names except when using anonymous lifetimes (`'_`).
@@ -1518,7 +1526,7 @@ pub struct Placeholder<T> {
15181526
15191527pub type PlaceholderRegion = Placeholder < BoundRegion > ;
15201528
1521- impl rustc_type_ir:: Placeholder for PlaceholderRegion {
1529+ impl < ' tcx > rustc_type_ir:: Placeholder < TyCtxt < ' tcx > > for PlaceholderRegion {
15221530 fn universe ( & self ) -> UniverseIndex {
15231531 self . universe
15241532 }
@@ -1527,14 +1535,18 @@ impl rustc_type_ir::Placeholder for PlaceholderRegion {
15271535 self . bound . var
15281536 }
15291537
1530- fn with_updated_universe ( self , ui : UniverseIndex ) -> Self {
1531- Placeholder { universe : ui, ..self }
1538+ fn with_updated_universe ( & self , ui : UniverseIndex ) -> Self {
1539+ Placeholder { universe : ui, ..* self }
1540+ }
1541+
1542+ fn new ( ui : UniverseIndex , var : BoundVar ) -> Self {
1543+ Placeholder { universe : ui, bound : BoundRegion { var, kind : BoundRegionKind :: BrAnon } }
15321544 }
15331545}
15341546
15351547pub type PlaceholderType = Placeholder < BoundTy > ;
15361548
1537- impl rustc_type_ir:: Placeholder for PlaceholderType {
1549+ impl < ' tcx > rustc_type_ir:: Placeholder < TyCtxt < ' tcx > > for PlaceholderType {
15381550 fn universe ( & self ) -> UniverseIndex {
15391551 self . universe
15401552 }
@@ -1543,8 +1555,12 @@ impl rustc_type_ir::Placeholder for PlaceholderType {
15431555 self . bound . var
15441556 }
15451557
1546- fn with_updated_universe ( self , ui : UniverseIndex ) -> Self {
1547- Placeholder { universe : ui, ..self }
1558+ fn with_updated_universe ( & self , ui : UniverseIndex ) -> Self {
1559+ Placeholder { universe : ui, ..* self }
1560+ }
1561+
1562+ fn new ( ui : UniverseIndex , var : BoundVar ) -> Self {
1563+ Placeholder { universe : ui, bound : BoundTy { var, kind : BoundTyKind :: Anon } }
15481564 }
15491565}
15501566
@@ -1557,7 +1573,7 @@ pub struct BoundConst<'tcx> {
15571573
15581574pub type PlaceholderConst = Placeholder < BoundVar > ;
15591575
1560- impl rustc_type_ir:: Placeholder for PlaceholderConst {
1576+ impl < ' tcx > rustc_type_ir:: Placeholder < TyCtxt < ' tcx > > for PlaceholderConst {
15611577 fn universe ( & self ) -> UniverseIndex {
15621578 self . universe
15631579 }
@@ -1566,8 +1582,12 @@ impl rustc_type_ir::Placeholder for PlaceholderConst {
15661582 self . bound
15671583 }
15681584
1569- fn with_updated_universe ( self , ui : UniverseIndex ) -> Self {
1570- Placeholder { universe : ui, ..self }
1585+ fn with_updated_universe ( & self , ui : UniverseIndex ) -> Self {
1586+ Placeholder { universe : ui, ..* self }
1587+ }
1588+
1589+ fn new ( ui : UniverseIndex , var : BoundVar ) -> Self {
1590+ Placeholder { universe : ui, bound : var }
15711591 }
15721592}
15731593
0 commit comments