Skip to content

Commit 0282016

Browse files
Auto merge of #144157 - compiler-errors:no-witness, r=<try>
Remove the `CoroutineWitness` type It's no longer needed, since it just always the `Coroutine` that it's contained within. This PR reworks a bit of obligation stalling logic and dtorck constraint behavior, but otherwise it's pretty straightforward. r? `@lcnr` or reassign (e.g. to oli, who probably would also be down to review)
2 parents 8f08b3a + a25d83f commit 0282016

File tree

101 files changed

+302
-649
lines changed

Some content is hidden

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

101 files changed

+302
-649
lines changed

compiler/rustc_borrowck/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
18011801
| ty::Closure(_, _)
18021802
| ty::CoroutineClosure(_, _)
18031803
| ty::Coroutine(_, _)
1804-
| ty::CoroutineWitness(..)
18051804
| ty::Never
18061805
| ty::Tuple(_)
18071806
| ty::UnsafeBinder(_)
@@ -1844,7 +1843,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
18441843
| ty::FnDef(_, _)
18451844
| ty::FnPtr(..)
18461845
| ty::Dynamic(_, _, _)
1847-
| ty::CoroutineWitness(..)
18481846
| ty::Never
18491847
| ty::UnsafeBinder(_)
18501848
| ty::Alias(_, _)

compiler/rustc_borrowck/src/type_check/input_output.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
8686
// them with fresh ty vars.
8787
resume_ty: next_ty_var(),
8888
yield_ty: next_ty_var(),
89-
witness: next_ty_var(),
9089
},
9190
)
9291
.args,

compiler/rustc_codegen_cranelift/src/value_and_place.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -973,19 +973,6 @@ pub(crate) fn assert_assignable<'tcx>(
973973
}
974974
}
975975
}
976-
(&ty::CoroutineWitness(def_id_a, args_a), &ty::CoroutineWitness(def_id_b, args_b))
977-
if def_id_a == def_id_b =>
978-
{
979-
let mut types_a = args_a.types();
980-
let mut types_b = args_b.types();
981-
loop {
982-
match (types_a.next(), types_b.next()) {
983-
(Some(a), Some(b)) => assert_assignable(fx, a, b, limit - 1),
984-
(None, None) => return,
985-
(Some(_), None) | (None, Some(_)) => panic!("{:#?}/{:#?}", from_ty, to_ty),
986-
}
987-
}
988-
}
989976
_ => {
990977
assert_eq!(
991978
from_ty,

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ fn exported_generic_symbols_provider_local<'tcx>(
344344
ty::FnDef(def_id, _) => *def_id,
345345
ty::Coroutine(def_id, _) => *def_id,
346346
ty::CoroutineClosure(def_id, _) => *def_id,
347-
ty::CoroutineWitness(def_id, _) => *def_id,
348347
_ => return false,
349348
};
350349
let Some(root_def_id) = root_def_id.as_local() else {

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,7 @@ fn push_debuginfo_type_name<'tcx>(
437437
| ty::Infer(_)
438438
| ty::Placeholder(..)
439439
| ty::Alias(..)
440-
| ty::Bound(..)
441-
| ty::CoroutineWitness(..) => {
440+
| ty::Bound(..) => {
442441
bug!(
443442
"debuginfo: Trying to create type name for \
444443
unexpected type: {:?}",

compiler/rustc_const_eval/src/const_eval/valtrees.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ fn const_to_valtree_inner<'tcx>(
176176
| ty::Closure(..)
177177
| ty::CoroutineClosure(..)
178178
| ty::Coroutine(..)
179-
| ty::CoroutineWitness(..)
180179
| ty::UnsafeBinder(_) => Err(ValTreeCreationError::NonSupportedType(ty)),
181180
}
182181
}
@@ -336,7 +335,6 @@ pub fn valtree_to_const_value<'tcx>(
336335
| ty::Closure(..)
337336
| ty::CoroutineClosure(..)
338337
| ty::Coroutine(..)
339-
| ty::CoroutineWitness(..)
340338
| ty::FnPtr(..)
341339
| ty::Str
342340
| ty::Slice(_)

compiler/rustc_const_eval/src/interpret/intrinsics.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
184184
| ty::Closure(_, _)
185185
| ty::CoroutineClosure(_, _)
186186
| ty::Coroutine(_, _)
187-
| ty::CoroutineWitness(..)
188187
| ty::UnsafeBinder(_)
189188
| ty::Never
190189
| ty::Tuple(_)

compiler/rustc_const_eval/src/interpret/stack.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
499499
| ty::Char
500500
| ty::Ref(..)
501501
| ty::Coroutine(..)
502-
| ty::CoroutineWitness(..)
503502
| ty::Array(..)
504503
| ty::Closure(..)
505504
| ty::CoroutineClosure(..)

compiler/rustc_const_eval/src/interpret/validity.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,7 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> {
795795
| ty::Placeholder(..)
796796
| ty::Bound(..)
797797
| ty::Param(..)
798-
| ty::Alias(..)
799-
| ty::CoroutineWitness(..) => bug!("Encountered invalid type {:?}", ty),
798+
| ty::Alias(..) => bug!("Encountered invalid type {:?}", ty),
800799
}
801800
}
802801

compiler/rustc_const_eval/src/util/type_name.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
5858

5959
ty::Alias(ty::Free, _) => bug!("type_name: unexpected free alias"),
6060
ty::Alias(ty::Inherent, _) => bug!("type_name: unexpected inherent projection"),
61-
ty::CoroutineWitness(..) => bug!("type_name: unexpected `CoroutineWitness`"),
6261
}
6362
}
6463

0 commit comments

Comments
 (0)