We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a72560 commit e261665Copy full SHA for e261665
compiler/rustc_middle/src/ty/context.rs
@@ -1800,11 +1800,11 @@ impl<'tcx> TyCtxt<'tcx> {
1800
1801
#[inline]
1802
pub fn intern_tup(self, ts: &[Ty<'tcx>]) -> Ty<'tcx> {
1803
- self.mk_ty(Tuple(self.intern_type_list(&ts)))
+ if ts.is_empty() { self.types.unit } else { self.mk_ty(Tuple(self.intern_type_list(&ts))) }
1804
}
1805
1806
pub fn mk_tup<I: InternAs<Ty<'tcx>, Ty<'tcx>>>(self, iter: I) -> I::Output {
1807
- iter.intern_with(|ts| self.mk_ty(Tuple(self.intern_type_list(&ts))))
+ iter.intern_with(|ts| self.intern_tup(ts))
1808
1809
1810
0 commit comments