diff options
| author | GnomedDev <david2005thomas@gmail.com> | 2024-10-10 19:56:21 +0100 |
|---|---|---|
| committer | GnomedDev <david2005thomas@gmail.com> | 2024-10-12 15:17:16 +0100 |
| commit | 8de8f46f789e5e61a0129fd9a7cf0c942a6301d8 (patch) | |
| tree | 5a260b79b05ae15f5af8d928d088b7396175406d /compiler/rustc_middle/src/traits/mod.rs | |
| parent | 7ec06b0d1d08cbcc6ed2f7e6ae87fe18056f69ef (diff) | |
| download | rust-8de8f46f789e5e61a0129fd9a7cf0c942a6301d8.tar.gz rust-8de8f46f789e5e61a0129fd9a7cf0c942a6301d8.zip | |
Swap PredicateObligation to ThinVec
Diffstat (limited to 'compiler/rustc_middle/src/traits/mod.rs')
| -rw-r--r-- | compiler/rustc_middle/src/traits/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs index caa86da8a85..8ee8b4c4823 100644 --- a/compiler/rustc_middle/src/traits/mod.rs +++ b/compiler/rustc_middle/src/traits/mod.rs @@ -25,6 +25,7 @@ use rustc_span::{DUMMY_SP, Span}; // FIXME: Remove this import and import via `solve::` pub use rustc_type_ir::solve::{BuiltinImplSource, Reveal}; use smallvec::{SmallVec, smallvec}; +use thin_vec::ThinVec; pub use self::select::{EvaluationCache, EvaluationResult, OverflowError, SelectionCache}; use crate::mir::ConstraintCategory; @@ -625,14 +626,14 @@ pub enum ImplSource<'tcx, N> { /// for some type parameter. The `Vec<N>` represents the /// obligations incurred from normalizing the where-clause (if /// any). - Param(Vec<N>), + Param(ThinVec<N>), /// Successful resolution for a builtin impl. - Builtin(BuiltinImplSource, Vec<N>), + Builtin(BuiltinImplSource, ThinVec<N>), } impl<'tcx, N> ImplSource<'tcx, N> { - pub fn nested_obligations(self) -> Vec<N> { + pub fn nested_obligations(self) -> ThinVec<N> { match self { ImplSource::UserDefined(i) => i.nested, ImplSource::Param(n) | ImplSource::Builtin(_, n) => n, @@ -686,7 +687,7 @@ impl<'tcx, N> ImplSource<'tcx, N> { pub struct ImplSourceUserDefinedData<'tcx, N> { pub impl_def_id: DefId, pub args: GenericArgsRef<'tcx>, - pub nested: Vec<N>, + pub nested: ThinVec<N>, } #[derive(Clone, Debug, PartialEq, Eq, Hash, HashStable, PartialOrd, Ord)] |
