diff options
| author | lcnr <rust@lcnr.de> | 2025-08-12 16:16:08 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2025-08-13 08:53:48 +0200 |
| commit | 3339fa5fcce74dd219f23988d6d9cabfd6871cb6 (patch) | |
| tree | 87ca2abfc0069a38aa641d5f531cae27042dbf1f | |
| parent | 1553adfe6884a8f6c28f5a673d3e605535ee0113 (diff) | |
| download | rust-3339fa5fcce74dd219f23988d6d9cabfd6871cb6.tar.gz rust-3339fa5fcce74dd219f23988d6d9cabfd6871cb6.zip | |
check args in new_coroutine_witness
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 72474a60566..9a2a140efd3 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -821,10 +821,13 @@ impl<'tcx> Ty<'tcx> { #[inline] pub fn new_coroutine_witness( tcx: TyCtxt<'tcx>, - id: DefId, + def_id: DefId, args: GenericArgsRef<'tcx>, ) -> Ty<'tcx> { - Ty::new(tcx, CoroutineWitness(id, args)) + if cfg!(debug_assertions) { + tcx.debug_assert_args_compatible(tcx.typeck_root_def_id(def_id), args); + } + Ty::new(tcx, CoroutineWitness(def_id, args)) } // misc |
