1
Fork 0

Rollup merge of #113319 - lcnr:type-param-def-def-id, r=compiler-errors

`TypeParameterDefinition` always require a `DefId`

the `None` case never actually reaches diagnostics so it feels better for diagnostics to be able to rely on the `DefId` being there, cc #113310
This commit is contained in:
Michael Goulet 2023-07-05 08:45:43 -07:00 committed by GitHub
commit 5c7a7d9ed4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View file

@ -2646,11 +2646,11 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
}
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
if let ty::Param(ty::ParamTy { name, .. }) = *ty.kind() {
if let ty::Param(_) = *ty.kind() {
let infcx = self.infcx;
*self.var_map.entry(ty).or_insert_with(|| {
infcx.next_ty_var(TypeVariableOrigin {
kind: TypeVariableOriginKind::TypeParameterDefinition(name, None),
kind: TypeVariableOriginKind::MiscVariable,
span: DUMMY_SP,
})
})