@@ -9,7 +9,7 @@ use rustc_data_structures::stable_hasher::HashingControls;
9
9
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
10
10
use rustc_errors:: ErrorGuaranteed ;
11
11
use rustc_hir:: def:: { CtorKind , DefKind , Res } ;
12
- use rustc_hir:: def_id:: DefId ;
12
+ use rustc_hir:: def_id:: { DefId , LocalDefId } ;
13
13
use rustc_hir:: { self as hir, LangItem } ;
14
14
use rustc_index:: { IndexSlice , IndexVec } ;
15
15
use rustc_macros:: { HashStable , TyDecodable , TyEncodable } ;
@@ -249,15 +249,25 @@ impl Into<DataTypeKind> for AdtKind {
249
249
}
250
250
251
251
impl AdtDefData {
252
+ pub ( super ) fn new_from_flags (
253
+ did : DefId ,
254
+ variants : IndexVec < VariantIdx , VariantDef > ,
255
+ flags : AdtFlags ,
256
+ repr : ReprOptions ,
257
+ ) -> Self {
258
+ AdtDefData { did, variants, flags, repr }
259
+ }
260
+
252
261
/// Creates a new `AdtDefData`.
253
262
pub ( super ) fn new (
254
263
tcx : TyCtxt < ' _ > ,
255
- did : DefId ,
264
+ did : LocalDefId ,
256
265
kind : AdtKind ,
257
266
variants : IndexVec < VariantIdx , VariantDef > ,
258
267
repr : ReprOptions ,
259
268
is_anonymous : bool ,
260
269
) -> Self {
270
+ let did = did. to_def_id ( ) ;
261
271
debug ! (
262
272
"AdtDef::new({:?}, {:?}, {:?}, {:?}, {:?})" ,
263
273
did, kind, variants, repr, is_anonymous
0 commit comments