Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1882,7 +1882,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
| ty::Closure(_, _)
| ty::CoroutineClosure(_, _)
| ty::Coroutine(_, _)
| ty::CoroutineWitness(..)
| ty::Never
| ty::Tuple(_)
| ty::UnsafeBinder(_)
Expand Down Expand Up @@ -1925,7 +1924,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
| ty::FnDef(_, _)
| ty::FnPtr(..)
| ty::Dynamic(_, _)
| ty::CoroutineWitness(..)
| ty::Never
| ty::UnsafeBinder(_)
| ty::Alias(_, _)
Expand Down
13 changes: 0 additions & 13 deletions compiler/rustc_codegen_cranelift/src/value_and_place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,19 +973,6 @@ pub(crate) fn assert_assignable<'tcx>(
}
}
}
(&ty::CoroutineWitness(def_id_a, args_a), &ty::CoroutineWitness(def_id_b, args_b))
if def_id_a == def_id_b =>
{
let mut types_a = args_a.types();
let mut types_b = args_b.types();
loop {
match (types_a.next(), types_b.next()) {
(Some(a), Some(b)) => assert_assignable(fx, a, b, limit - 1),
(None, None) => return,
(Some(_), None) | (None, Some(_)) => panic!("{:#?}/{:#?}", from_ty, to_ty),
}
}
}
_ => {
assert_eq!(
from_ty,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/symbol_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ fn exported_generic_symbols_provider_local<'tcx>(
ty::FnDef(def_id, _) => *def_id,
ty::Coroutine(def_id, _) => *def_id,
ty::CoroutineClosure(def_id, _) => *def_id,
ty::CoroutineWitness(def_id, _) => *def_id,
_ => return false,
};
let Some(root_def_id) = root_def_id.as_local() else {
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,7 @@ fn push_debuginfo_type_name<'tcx>(
| ty::Infer(_)
| ty::Placeholder(..)
| ty::Alias(..)
| ty::Bound(..)
| ty::CoroutineWitness(..) => {
| ty::Bound(..) => {
bug!(
"debuginfo: Trying to create type name for \
unexpected type: {:?}",
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_const_eval/src/const_eval/type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> {
| ty::Closure(..)
| ty::CoroutineClosure(..)
| ty::Coroutine(..)
| ty::CoroutineWitness(..)
| ty::Never
| ty::Alias(..)
| ty::Param(_)
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_const_eval/src/const_eval/valtrees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ fn const_to_valtree_inner<'tcx>(
| ty::Closure(..)
| ty::CoroutineClosure(..)
| ty::Coroutine(..)
| ty::CoroutineWitness(..)
| ty::UnsafeBinder(_) => Err(ValTreeCreationError::NonSupportedType(ty)),
}
}
Expand Down Expand Up @@ -343,7 +342,6 @@ pub fn valtree_to_const_value<'tcx>(
| ty::Closure(..)
| ty::CoroutineClosure(..)
| ty::Coroutine(..)
| ty::CoroutineWitness(..)
| ty::FnPtr(..)
| ty::Str
| ty::Slice(_)
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_const_eval/src/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
| ty::Closure(_, _)
| ty::CoroutineClosure(_, _)
| ty::Coroutine(_, _)
| ty::CoroutineWitness(..)
| ty::UnsafeBinder(_)
| ty::Never
| ty::Tuple(_)
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_const_eval/src/interpret/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
| ty::Char
| ty::Ref(..)
| ty::Coroutine(..)
| ty::CoroutineWitness(..)
| ty::Array(..)
| ty::Closure(..)
| ty::CoroutineClosure(..)
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_const_eval/src/interpret/validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,7 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> {
| ty::Placeholder(..)
| ty::Bound(..)
| ty::Param(..)
| ty::Alias(..)
| ty::CoroutineWitness(..) => bug!("Encountered invalid type {:?}", ty),
| ty::Alias(..) => bug!("Encountered invalid type {:?}", ty),
}
}

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_const_eval/src/util/type_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ impl<'tcx> Printer<'tcx> for TypeNamePrinter<'tcx> {

ty::Alias(ty::Free, _) => bug!("type_name: unexpected free alias"),
ty::Alias(ty::Inherent, _) => bug!("type_name: unexpected inherent projection"),
ty::CoroutineWitness(..) => bug!("type_name: unexpected `CoroutineWitness`"),
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ impl<'tcx> InherentCollect<'tcx> {
| ty::Closure(..)
| ty::CoroutineClosure(..)
| ty::Coroutine(..)
| ty::CoroutineWitness(..)
| ty::Alias(ty::Free, _)
| ty::Bound(..)
| ty::Placeholder(_)
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir_analysis/src/coherence/orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ pub(crate) fn orphan_check_impl(
| ty::Closure(..)
| ty::CoroutineClosure(..)
| ty::Coroutine(..)
| ty::CoroutineWitness(..)
| ty::Bound(..)
| ty::Placeholder(..)
| ty::Infer(..) => {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/variance/constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
// types, where we use Error as the Self type
}

ty::Placeholder(..) | ty::CoroutineWitness(..) | ty::Bound(..) | ty::Infer(..) => {
ty::Placeholder(..) | ty::Bound(..) | ty::Infer(..) => {
bug!("unexpected type encountered in variance inference: {}", ty);
}
}
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir_typeck/src/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
| ty::Uint(..)
| ty::Float(_)
| ty::Array(..)
| ty::CoroutineWitness(..)
| ty::RawPtr(_, _)
| ty::Ref(..)
| ty::Pat(..)
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir_typeck/src/coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
| ty::Closure(_, _)
| ty::CoroutineClosure(_, _)
| ty::Coroutine(_, _)
| ty::CoroutineWitness(_, _)
| ty::Never
| ty::Tuple(_) => return Err(TypeError::Mismatch),
_ => {}
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_infer/src/infer/canonical/canonicalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'cx, 'tcx> {
ty::Closure(..)
| ty::CoroutineClosure(..)
| ty::Coroutine(..)
| ty::CoroutineWitness(..)
| ty::Bool
| ty::Char
| ty::Int(..)
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_lint/src/foreign_modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ fn structurally_same_type_impl<'tcx>(
| (ty::Error(..), ty::Error(..))
| (ty::Closure(..), ty::Closure(..))
| (ty::Coroutine(..), ty::Coroutine(..))
| (ty::CoroutineWitness(..), ty::CoroutineWitness(..))
| (ty::Alias(ty::Projection, ..), ty::Alias(ty::Projection, ..))
| (ty::Alias(ty::Inherent, ..), ty::Alias(ty::Inherent, ..))
| (ty::Alias(ty::Opaque, ..), ty::Alias(ty::Opaque, ..)) => false,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_lint/src/gpukernel_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for CheckGpuKernelTypes<'tcx> {
| ty::Closure(_, _)
| ty::Coroutine(_, _)
| ty::CoroutineClosure(_, _)
| ty::CoroutineWitness(..)
| ty::Dynamic(_, _)
| ty::FnDef(_, _)
| ty::FnPtr(..)
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_lint/src/types/improper_ctypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,6 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
| ty::Closure(..)
| ty::CoroutineClosure(..)
| ty::Coroutine(..)
| ty::CoroutineWitness(..)
| ty::Placeholder(..)
| ty::FnDef(..) => bug!("unexpected type in foreign function: {:?}", ty),
}
Expand Down
6 changes: 0 additions & 6 deletions compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,11 +649,6 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
// `assemble_candidates_after_normalizing_self_ty`.
ty::Alias(_, _) | ty::Placeholder(..) | ty::Error(_) => (),

// FIXME: These should ideally not exist as a self type. It would be nice for
// the builtin auto trait impls of coroutines to instead directly recurse
// into the witness.
ty::CoroutineWitness(..) => (),

// These variants should not exist as a self type.
ty::Infer(ty::TyVar(_) | ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_))
| ty::Param(_)
Expand Down Expand Up @@ -2632,7 +2627,6 @@ impl<'tcx> TyCtxt<'tcx> {
UnsafeBinder,
Placeholder,
Coroutine,
CoroutineWitness,
Dynamic,
Closure,
CoroutineClosure,
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_middle/src/ty/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,6 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for IsSuggestableVisitor<'tcx> {
| Closure(..)
| Infer(..)
| Coroutine(..)
| CoroutineWitness(..)
| Bound(_, _)
| Placeholder(_)
| Error(_) => {
Expand Down Expand Up @@ -702,7 +701,6 @@ impl<'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for MakeSuggestableFolder<'tcx> {
| FnDef(..)
| Infer(..)
| Coroutine(..)
| CoroutineWitness(..)
| Bound(_, _)
| Placeholder(_)
| Error(_) => {
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_middle/src/ty/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ impl<'tcx> Ty<'tcx> {
ty::Coroutine(def_id, ..) => {
format!("{:#}", tcx.coroutine_kind(def_id).unwrap()).into()
}
ty::CoroutineWitness(..) => "coroutine witness".into(),
ty::Infer(ty::TyVar(_)) => "inferred type".into(),
ty::Infer(ty::IntVar(_)) => "integer".into(),
ty::Infer(ty::FloatVar(_)) => "floating-point number".into(),
Expand Down Expand Up @@ -205,7 +204,6 @@ impl<'tcx> Ty<'tcx> {
ty::Coroutine(def_id, ..) => {
format!("{:#}", tcx.coroutine_kind(def_id).unwrap()).into()
}
ty::CoroutineWitness(..) => "coroutine witness".into(),
ty::Tuple(..) => "tuple".into(),
ty::Placeholder(..) => "higher-ranked type".into(),
ty::Bound(..) => "bound type variable".into(),
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,6 @@ where
| ty::FnPtr(..)
| ty::Never
| ty::FnDef(..)
| ty::CoroutineWitness(..)
| ty::Foreign(..)
| ty::Dynamic(_, _) => {
bug!("TyAndLayout::field({:?}): not applicable", this)
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/ty/offload_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ impl MappingFlags {
| ty::Closure(_, _)
| ty::CoroutineClosure(_, _)
| ty::Coroutine(_, _)
| ty::CoroutineWitness(_, _)
| ty::Never
| ty::Bound(_, _)
| ty::Placeholder(_)
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_middle/src/ty/opaque_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReverseMapper<'tcx> {
Ty::new_coroutine(self.tcx, def_id, args)
}

ty::CoroutineWitness(def_id, args) => {
let args = self.fold_closure_args(def_id, args);
Ty::new_coroutine_witness(self.tcx, def_id, args)
}

ty::Param(param) => {
// Look it up in the generic parameters list.
match self.map.get(&ty.into()).map(|arg| arg.kind()) {
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/ty/print/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ fn characteristic_def_id_of_type_cached<'a>(
| ty::Closure(def_id, _)
| ty::CoroutineClosure(def_id, _)
| ty::Coroutine(def_id, _)
| ty::CoroutineWitness(def_id, _)
| ty::Foreign(def_id) => Some(def_id),

ty::Bool
Expand Down
24 changes: 0 additions & 24 deletions compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -910,29 +910,6 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {

write!(self, "}}")?
}
ty::CoroutineWitness(did, args) => {
write!(self, "{{")?;
if !self.tcx().sess.verbose_internals() {
write!(self, "coroutine witness")?;
if let Some(did) = did.as_local() {
let span = self.tcx().def_span(did);
write!(
self,
"@{}",
// This may end up in stderr diagnostics but it may also be emitted
// into MIR. Hence we use the remapped path if available
self.tcx().sess.source_map().span_to_diagnostic_string(span)
)?;
} else {
write!(self, "@")?;
self.print_def_path(did, args)?;
}
} else {
self.print_def_path(did, args)?;
}

write!(self, "}}")?
}
ty::Closure(did, args) => {
write!(self, "{{")?;
if !self.should_print_verbose() {
Expand Down Expand Up @@ -2293,7 +2270,6 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
| ty::Closure(..)
| ty::CoroutineClosure(..)
| ty::Coroutine(..)
| ty::CoroutineWitness(..)
| ty::Tuple(_)
| ty::Alias(..)
| ty::Param(_)
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/ty/significant_drop_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ pub fn ty_dtor_span<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<Span> {
}
}
ty::Coroutine(did, _)
| ty::CoroutineWitness(did, _)
| ty::CoroutineClosure(did, _)
| ty::Closure(did, _)
| ty::FnDef(did, _)
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_middle/src/ty/structural_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,6 @@ impl<'tcx> TypeSuperFoldable<TyCtxt<'tcx>> for Ty<'tcx> {
ty::Ref(r.try_fold_with(folder)?, ty.try_fold_with(folder)?, mutbl)
}
ty::Coroutine(did, args) => ty::Coroutine(did, args.try_fold_with(folder)?),
ty::CoroutineWitness(did, args) => {
ty::CoroutineWitness(did, args.try_fold_with(folder)?)
}
ty::Closure(did, args) => ty::Closure(did, args.try_fold_with(folder)?),
ty::CoroutineClosure(did, args) => {
ty::CoroutineClosure(did, args.try_fold_with(folder)?)
Expand Down Expand Up @@ -434,7 +431,6 @@ impl<'tcx> TypeSuperFoldable<TyCtxt<'tcx>> for Ty<'tcx> {
ty::UnsafeBinder(f) => ty::UnsafeBinder(f.fold_with(folder)),
ty::Ref(r, ty, mutbl) => ty::Ref(r.fold_with(folder), ty.fold_with(folder), mutbl),
ty::Coroutine(did, args) => ty::Coroutine(did, args.fold_with(folder)),
ty::CoroutineWitness(did, args) => ty::CoroutineWitness(did, args.fold_with(folder)),
ty::Closure(did, args) => ty::Closure(did, args.fold_with(folder)),
ty::CoroutineClosure(did, args) => ty::CoroutineClosure(did, args.fold_with(folder)),
ty::Alias(kind, data) => ty::Alias(kind, data.fold_with(folder)),
Expand Down Expand Up @@ -482,7 +478,6 @@ impl<'tcx> TypeSuperVisitable<TyCtxt<'tcx>> for Ty<'tcx> {
ty.visit_with(visitor)
}
ty::Coroutine(_did, args) => args.visit_with(visitor),
ty::CoroutineWitness(_did, args) => args.visit_with(visitor),
ty::Closure(_did, args) => args.visit_with(visitor),
ty::CoroutineClosure(_did, args) => args.visit_with(visitor),
ty::Alias(_, data) => data.visit_with(visitor),
Expand Down
Loading
Loading