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

@ -265,9 +265,9 @@ impl<'tcx> InferCtxt<'tcx> {
kind: UnderspecifiedArgKind::Type {
prefix: "type parameter".into(),
},
parent: def_id.and_then(|def_id| {
InferenceDiagnosticsParentData::for_def_id(self.tcx, def_id)
}),
parent: InferenceDiagnosticsParentData::for_def_id(
self.tcx, def_id,
),
};
}
}

View file

@ -1110,7 +1110,7 @@ impl<'tcx> InferCtxt<'tcx> {
TypeVariableOrigin {
kind: TypeVariableOriginKind::TypeParameterDefinition(
param.name,
Some(param.def_id),
param.def_id,
),
span,
},

View file

@ -123,7 +123,7 @@ pub enum TypeVariableOriginKind {
NormalizeProjectionType,
TypeInference,
OpaqueTypeInference(DefId),
TypeParameterDefinition(Symbol, Option<DefId>),
TypeParameterDefinition(Symbol, DefId),
/// One of the upvars or closure kind parameters in a `ClosureSubsts`
/// (before it has been determined).