From dc116f7ce2192433c9491441a11d294e7d294fbf Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Wed, 7 Apr 2021 20:50:26 +0200 Subject: Fix return type of Substitution::interned --- crates/hir_ty/src/display.rs | 2 +- crates/hir_ty/src/infer/pat.rs | 2 +- crates/hir_ty/src/types.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates') diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs index 90801ef2d..e0ca96c6d 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs @@ -745,7 +745,7 @@ fn write_bounds_like_dyn_trait( // existential) here, which is the only thing that's // possible in actual Rust, and hence don't print it write!(f, "{}", f.db.trait_data(trait_).name)?; - if let [_, params @ ..] = &*trait_ref.substitution.interned() { + if let [_, params @ ..] = &*trait_ref.substitution.interned().as_slice() { if is_fn_trait { if let Some(args) = params.first().and_then(|it| it.assert_ty_ref(&Interner).as_tuple()) diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs index f88d5c5d3..a41e8e116 100644 --- a/crates/hir_ty/src/infer/pat.rs +++ b/crates/hir_ty/src/infer/pat.rs @@ -122,7 +122,7 @@ impl<'a> InferenceContext<'a> { let ty = match &body[pat] { &Pat::Tuple { ref args, ellipsis } => { let expectations = match expected.as_tuple() { - Some(parameters) => &*parameters.interned(), + Some(parameters) => &*parameters.interned().as_slice(), _ => &[], }; diff --git a/crates/hir_ty/src/types.rs b/crates/hir_ty/src/types.rs index e1a28f5f7..89adad108 100644 --- a/crates/hir_ty/src/types.rs +++ b/crates/hir_ty/src/types.rs @@ -282,7 +282,7 @@ impl GenericArg { pub struct Substitution(SmallVec<[GenericArg; 2]>); impl Substitution { - pub fn interned(&self) -> &[GenericArg] { + pub fn interned(&self) -> &SmallVec<[GenericArg; 2]> { &self.0 } -- cgit v1.2.3