Skip to content

Commit 1974b6b

Browse files
committed
Introduce GeneratorWitnessMIR.
1 parent 03618d6 commit 1974b6b

File tree

52 files changed

+265
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+265
-72
lines changed

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ fn push_debuginfo_type_name<'tcx>(
414414
| ty::Placeholder(..)
415415
| ty::Alias(..)
416416
| ty::Bound(..)
417+
| ty::GeneratorWitnessMIR(..)
417418
| ty::GeneratorWitness(..) => {
418419
bug!(
419420
"debuginfo: Trying to create type name for \

compiler/rustc_const_eval/src/const_eval/valtrees.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pub(crate) fn const_to_valtree_inner<'tcx>(
151151
// FIXME(oli-obk): we can probably encode closures just like structs
152152
| ty::Closure(..)
153153
| ty::Generator(..)
154-
| ty::GeneratorWitness(..) => Err(ValTreeCreationError::NonSupportedType),
154+
| ty::GeneratorWitness(..) |ty::GeneratorWitnessMIR(..)=> Err(ValTreeCreationError::NonSupportedType),
155155
}
156156
}
157157

@@ -314,6 +314,7 @@ pub fn valtree_to_const_value<'tcx>(
314314
| ty::Closure(..)
315315
| ty::Generator(..)
316316
| ty::GeneratorWitness(..)
317+
| ty::GeneratorWitnessMIR(..)
317318
| ty::FnPtr(_)
318319
| ty::RawPtr(_)
319320
| ty::Str

compiler/rustc_const_eval/src/interpret/intrinsics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ pub(crate) fn eval_nullary_intrinsic<'tcx>(
101101
| ty::Closure(_, _)
102102
| ty::Generator(_, _, _)
103103
| ty::GeneratorWitness(_)
104+
| ty::GeneratorWitnessMIR(_, _)
104105
| ty::Never
105106
| ty::Tuple(_)
106107
| ty::Error(_) => ConstValue::from_machine_usize(0u64, &tcx),

compiler/rustc_const_eval/src/interpret/validity.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
602602
| ty::Bound(..)
603603
| ty::Param(..)
604604
| ty::Alias(..)
605+
| ty::GeneratorWitnessMIR(..)
605606
| ty::GeneratorWitness(..) => bug!("Encountered invalid type {:?}", ty),
606607
}
607608
}

compiler/rustc_const_eval/src/util/type_name.rs

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

6666
ty::GeneratorWitness(_) => bug!("type_name: unexpected `GeneratorWitness`"),
67+
ty::GeneratorWitnessMIR(..) => bug!("type_name: unexpected `GeneratorWitnessMIR`"),
6768
}
6869
}
6970

compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ impl<'tcx> InherentCollect<'tcx> {
240240
| ty::Closure(..)
241241
| ty::Generator(..)
242242
| ty::GeneratorWitness(..)
243+
| ty::GeneratorWitnessMIR(..)
243244
| ty::Bound(..)
244245
| ty::Placeholder(_)
245246
| ty::Infer(_) => {

compiler/rustc_hir_analysis/src/variance/constraints.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,12 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
295295
// types, where we use Error as the Self type
296296
}
297297

298-
ty::Placeholder(..) | ty::GeneratorWitness(..) | ty::Bound(..) | ty::Infer(..) => {
299-
bug!(
300-
"unexpected type encountered in \
301-
variance inference: {}",
302-
ty
303-
);
298+
ty::Placeholder(..)
299+
| ty::GeneratorWitness(..)
300+
| ty::GeneratorWitnessMIR(..)
301+
| ty::Bound(..)
302+
| ty::Infer(..) => {
303+
bug!("unexpected type encountered in variance inference: {}", ty);
304304
}
305305
}
306306
}

compiler/rustc_hir_typeck/src/cast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
130130
| ty::Float(_)
131131
| ty::Array(..)
132132
| ty::GeneratorWitness(..)
133+
| ty::GeneratorWitnessMIR(..)
133134
| ty::RawPtr(_)
134135
| ty::Ref(..)
135136
| ty::FnDef(..)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
435435
ty::Closure(..)
436436
| ty::Generator(..)
437437
| ty::GeneratorWitness(..)
438+
| ty::GeneratorWitnessMIR(..)
438439
| ty::Bool
439440
| ty::Char
440441
| ty::Int(..)

compiler/rustc_infer/src/infer/freshen.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
209209
| ty::Foreign(..)
210210
| ty::Param(..)
211211
| ty::Closure(..)
212+
| ty::GeneratorWitnessMIR(..)
212213
| ty::GeneratorWitness(..) => t.super_fold_with(self),
213214

214215
ty::Placeholder(..) | ty::Bound(..) => bug!("unexpected type {:?}", t),

0 commit comments

Comments
 (0)