Skip to content

Commit 83171d0

Browse files
committed
use is_unit() and remove redundant From<Ty<I>> on definition of type Term
1 parent e8066d4 commit 83171d0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

compiler/rustc_middle/src/ty/print/pretty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
15311531
write!(self, "...")?;
15321532
}
15331533
write!(self, ")")?;
1534-
if !matches!(output.kind(), ty::Tuple(tys) if tys.is_empty()) {
1534+
if !output.is_unit() {
15351535
write!(self, " -> ")?;
15361536
output.print(self)?;
15371537
}
@@ -2040,7 +2040,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
20402040
}
20412041
write!(p, ")")?;
20422042

2043-
if !matches!(sig.output().kind(), ty::Tuple(tys) if tys.is_empty()) {
2043+
if !sig.output().is_unit() {
20442044
write!(p, " -> ")?;
20452045
sig.output().print(p)?;
20462046
}

compiler/rustc_type_ir/src/interner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub trait Interner:
6161
type GenericArgs: GenericArgs<Self>;
6262
type GenericArgsSlice: Copy + Debug + Hash + Eq + SliceLike<Item = Self::GenericArg>;
6363
type GenericArg: GenericArg<Self>;
64-
type Term: Term<Self> + From<Ty<Self>>;
64+
type Term: Term<Self>;
6565

6666
type BoundVarKinds: Copy
6767
+ Debug

0 commit comments

Comments
 (0)