1
Fork 0

make outlives constraints from generic arguments less boring

This commit is contained in:
dianne 2024-12-20 17:08:27 -08:00
parent 6421d4cf80
commit 10061b3a4f
5 changed files with 35 additions and 19 deletions

View file

@ -229,7 +229,7 @@ pub enum ConstraintCategory<'tcx> {
Yield,
UseAsConst,
UseAsStatic,
TypeAnnotation,
TypeAnnotation(AnnotationSource),
Cast {
/// Whether this cast is a coercion that was automatically inserted by the compiler.
is_implicit_coercion: bool,
@ -280,6 +280,15 @@ pub enum ReturnConstraint {
ClosureUpvar(FieldIdx),
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[derive(TyEncodable, TyDecodable, HashStable, TypeVisitable, TypeFoldable)]
pub enum AnnotationSource {
Ascription,
Declaration,
OpaqueCast,
GenericArg,
}
/// The subject of a `ClosureOutlivesRequirement` -- that is, the thing
/// that must outlive some region.
#[derive(Copy, Clone, Debug, TyEncodable, TyDecodable, HashStable)]