Fix return type of Substitution::interned

This commit is contained in:
Florian Diebold 2021-04-07 20:50:26 +02:00
parent be0084a0bc
commit dc116f7ce2
3 changed files with 3 additions and 3 deletions

View File

@ -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())

View File

@ -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(),
_ => &[],
};

View File

@ -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
}