diff options
| author | dianne <diannes.gm@gmail.com> | 2024-12-20 17:08:27 -0800 |
|---|---|---|
| committer | dianne <diannes.gm@gmail.com> | 2025-01-06 16:12:11 -0800 |
| commit | 10061b3a4fea7e6268a2d4618504c4bee3ca61fb (patch) | |
| tree | 2d18c2180d5eb82475c57b6a9711719991436459 /compiler/rustc_middle/src | |
| parent | 6421d4cf801491bb4bf3f796ec45a3f65c1a0364 (diff) | |
| download | rust-10061b3a4fea7e6268a2d4618504c4bee3ca61fb.tar.gz rust-10061b3a4fea7e6268a2d4618504c4bee3ca61fb.zip | |
make outlives constraints from generic arguments less boring
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/mir/query.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/mir/query.rs b/compiler/rustc_middle/src/mir/query.rs index 8ab994a2dad..f2fbc63ee41 100644 --- a/compiler/rustc_middle/src/mir/query.rs +++ b/compiler/rustc_middle/src/mir/query.rs @@ -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)] |
