Skip to content

Commit bd26db4

Browse files
committed
make no-variant types a dedicated Variants variant
1 parent 4d1e772 commit bd26db4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/type_of.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ fn uncached_gcc_type<'gcc, 'tcx>(
9999
if !cx.sess().fewer_names() =>
100100
{
101101
let mut name = with_no_trimmed_paths!(layout.ty.to_string());
102-
if let (&ty::Adt(def, _), &Variants::Single { index: Some(index) }) =
102+
if let (&ty::Adt(def, _), &Variants::Single { index }) =
103103
(layout.ty.kind(), &layout.variants)
104104
{
105105
if def.is_enum() && !def.variants().is_empty() {
106106
write!(&mut name, "::{}", def.variant(index).name).unwrap();
107107
}
108108
}
109-
if let (&ty::Coroutine(_, _), &Variants::Single { index: Some(index) }) =
109+
if let (&ty::Coroutine(_, _), &Variants::Single { index }) =
110110
(layout.ty.kind(), &layout.variants)
111111
{
112112
write!(&mut name, "::{}", ty::CoroutineArgs::variant_name(index)).unwrap();
@@ -230,7 +230,7 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
230230

231231
// Check the cache.
232232
let variant_index = match self.variants {
233-
Variants::Single { index } => index,
233+
Variants::Single { index } => Some(index),
234234
_ => None,
235235
};
236236
let cached_type = cx.types.borrow().get(&(self.ty, variant_index)).cloned();

0 commit comments

Comments
 (0)