Add make_tuple tactic

This commit is contained in:
Tavo Annus 2024-02-25 17:24:07 +02:00
parent 8bd30e9b3f
commit be6f8e2648
4 changed files with 82 additions and 1 deletions

View file

@ -4321,8 +4321,10 @@ impl Type {
self.ty
.strip_references()
.as_adt()
.map(|(_, substs)| substs)
.or_else(|| self.ty.strip_references().as_tuple())
.into_iter()
.flat_map(|(_, substs)| substs.iter(Interner))
.flat_map(|substs| substs.iter(Interner))
.filter_map(|arg| arg.ty(Interner).cloned())
.map(move |ty| self.derived(ty))
}