mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Fix return type of Substitution::interned
This commit is contained in:
parent
be0084a0bc
commit
dc116f7ce2
3 changed files with 3 additions and 3 deletions
|
@ -745,7 +745,7 @@ fn write_bounds_like_dyn_trait(
|
||||||
// existential) here, which is the only thing that's
|
// existential) here, which is the only thing that's
|
||||||
// possible in actual Rust, and hence don't print it
|
// possible in actual Rust, and hence don't print it
|
||||||
write!(f, "{}", f.db.trait_data(trait_).name)?;
|
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 is_fn_trait {
|
||||||
if let Some(args) =
|
if let Some(args) =
|
||||||
params.first().and_then(|it| it.assert_ty_ref(&Interner).as_tuple())
|
params.first().and_then(|it| it.assert_ty_ref(&Interner).as_tuple())
|
||||||
|
|
|
@ -122,7 +122,7 @@ impl<'a> InferenceContext<'a> {
|
||||||
let ty = match &body[pat] {
|
let ty = match &body[pat] {
|
||||||
&Pat::Tuple { ref args, ellipsis } => {
|
&Pat::Tuple { ref args, ellipsis } => {
|
||||||
let expectations = match expected.as_tuple() {
|
let expectations = match expected.as_tuple() {
|
||||||
Some(parameters) => &*parameters.interned(),
|
Some(parameters) => &*parameters.interned().as_slice(),
|
||||||
_ => &[],
|
_ => &[],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -282,7 +282,7 @@ impl GenericArg {
|
||||||
pub struct Substitution(SmallVec<[GenericArg; 2]>);
|
pub struct Substitution(SmallVec<[GenericArg; 2]>);
|
||||||
|
|
||||||
impl Substitution {
|
impl Substitution {
|
||||||
pub fn interned(&self) -> &[GenericArg] {
|
pub fn interned(&self) -> &SmallVec<[GenericArg; 2]> {
|
||||||
&self.0
|
&self.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue