Skip to content

Commit ecfe3cb

Browse files
committed
add ty::Variant type
1 parent e269e6b commit ecfe3cb

File tree

35 files changed

+76
-0
lines changed

35 files changed

+76
-0
lines changed

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ fn push_debuginfo_type_name<'tcx>(
373373
t
374374
);
375375
}
376+
377+
ty::Variant(..) => unimplemented!("TODO(zhamlin)"),
376378
}
377379

378380
/// MSVC names enums differently than other platforms so that the debugging visualization

compiler/rustc_const_eval/src/const_eval/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ fn const_to_valtree_inner<'tcx>(
129129
| ty::Closure(..)
130130
| ty::Generator(..)
131131
| ty::GeneratorWitness(..) => None,
132+
ty::Variant(..) => unimplemented!("TODO(zhamlin)"),
132133
}
133134
}
134135

compiler/rustc_const_eval/src/interpret/intrinsics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ crate fn eval_nullary_intrinsic<'tcx>(
100100
| ty::Never
101101
| ty::Tuple(_)
102102
| ty::Error(_) => ConstValue::from_machine_usize(0u64, &tcx),
103+
ty::Variant(..) => unimplemented!("TODO(zhamlin)"),
103104
},
104105
other => bug!("`{}` is not a zero arg intrinsic", other),
105106
})

compiler/rustc_const_eval/src/interpret/intrinsics/type_name.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
6565
ty::Foreign(def_id) => self.print_def_path(def_id, &[]),
6666

6767
ty::GeneratorWitness(_) => bug!("type_name: unexpected `GeneratorWitness`"),
68+
ty::Variant(..) => unimplemented!("TODO(zhamlin)"),
6869
}
6970
}
7071

compiler/rustc_const_eval/src/interpret/validity.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
612612
| ty::Opaque(..)
613613
| ty::Projection(..)
614614
| ty::GeneratorWitness(..) => bug!("Encountered invalid type {:?}", ty),
615+
ty::Variant(..) => unimplemented!("TODO(zhamlin)"),
615616
}
616617
}
617618

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
406406
t
407407
}
408408
}
409+
ty::Variant(..) => unimplemented!("TODO(zhamlin)"),
409410
}
410411
}
411412

compiler/rustc_infer/src/infer/freshen.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
218218
| ty::Opaque(..) => t.super_fold_with(self),
219219

220220
ty::Placeholder(..) | ty::Bound(..) => bug!("unexpected type {:?}", t),
221+
222+
ty::Variant(..) => unimplemented!("TODO(zhamlin)"),
221223
}
222224
}
223225

compiler/rustc_infer/src/infer/outlives/components.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ fn compute_components(
187187
// themselves can be readily identified.
188188
compute_components_recursive(tcx, ty.into(), out, visited);
189189
}
190+
ty::Variant(..) => unimplemented!("TODO(zhamlin)"),
190191
}
191192
}
192193

compiler/rustc_lint/src/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
11301130
| ty::GeneratorWitness(..)
11311131
| ty::Placeholder(..)
11321132
| ty::FnDef(..) => bug!("unexpected type in foreign function: {:?}", ty),
1133+
ty::Variant(..) => unimplemented!("TODO(zhamlin)"),
11331134
}
11341135
}
11351136

compiler/rustc_middle/src/ty/context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,6 +1932,7 @@ impl<'tcx> TyCtxt<'tcx> {
19321932
fmt,
19331933
self.0,
19341934
Adt,
1935+
Variant,
19351936
Array,
19361937
Slice,
19371938
RawPtr,

0 commit comments

Comments
 (0)