mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 18:43:01 +00:00
Shrink WherePredicate by 8 bytes
This commit is contained in:
parent
4a2eaddc77
commit
99a7e423e2
2 changed files with 3 additions and 2 deletions
|
|
@ -227,7 +227,7 @@ impl GenericParamsCollector {
|
|||
(_, TypeBound::Error | TypeBound::Use(_)) => return,
|
||||
(Either::Left(type_ref), bound) => match hrtb_lifetimes {
|
||||
Some(hrtb_lifetimes) => WherePredicate::ForLifetime {
|
||||
lifetimes: hrtb_lifetimes.to_vec().into_boxed_slice(),
|
||||
lifetimes: ThinVec::from_iter(hrtb_lifetimes.iter().cloned()),
|
||||
target: type_ref,
|
||||
bound,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ use std::{ops, sync::LazyLock};
|
|||
use hir_expand::name::Name;
|
||||
use la_arena::{Arena, Idx, RawIdx};
|
||||
use stdx::impl_from;
|
||||
use thin_vec::ThinVec;
|
||||
use triomphe::Arc;
|
||||
|
||||
use crate::{
|
||||
|
|
@ -171,7 +172,7 @@ impl ops::Index<LocalLifetimeParamId> for GenericParams {
|
|||
pub enum WherePredicate {
|
||||
TypeBound { target: TypeRefId, bound: TypeBound },
|
||||
Lifetime { target: LifetimeRef, bound: LifetimeRef },
|
||||
ForLifetime { lifetimes: Box<[Name]>, target: TypeRefId, bound: TypeBound },
|
||||
ForLifetime { lifetimes: ThinVec<Name>, target: TypeRefId, bound: TypeBound },
|
||||
}
|
||||
|
||||
static EMPTY: LazyLock<Arc<GenericParams>> = LazyLock::new(|| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue