Fix #3373
Basically, we need to allow variables in the caller self type to unify with the impl's declared self type. That requires some more contortions in the variable handling. I'm looking forward to (hopefully) handling this in a cleaner way when we switch to Chalk's types and unification code.
This commit is contained in:
@@ -355,6 +355,10 @@ impl Substs {
|
||||
Substs(self.0[..std::cmp::min(self.0.len(), n)].into())
|
||||
}
|
||||
|
||||
pub fn suffix(&self, n: usize) -> Substs {
|
||||
Substs(self.0[self.0.len() - std::cmp::min(self.0.len(), n)..].into())
|
||||
}
|
||||
|
||||
pub fn as_single(&self) -> &Ty {
|
||||
if self.0.len() != 1 {
|
||||
panic!("expected substs of len 1, got {:?}", self);
|
||||
|
||||
Reference in New Issue
Block a user