Skip to content

Commit 718b147

Browse files
committed
use is_unit() and remove redundant From<Ty<I>> on definition of type Term
1 parent e834a94 commit 718b147

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
@@ -1521,7 +1521,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
15211521
write!(self, "...")?;
15221522
}
15231523
write!(self, ")")?;
1524-
if !matches!(output.kind(), ty::Tuple(tys) if tys.is_empty()) {
1524+
if !output.is_unit() {
15251525
write!(self, " -> ")?;
15261526
output.print(self)?;
15271527
}
@@ -2030,7 +2030,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
20302030
}
20312031
write!(p, ")")?;
20322032

2033-
if !matches!(sig.output().kind(), ty::Tuple(tys) if tys.is_empty()) {
2033+
if !sig.output().is_unit() {
20342034
write!(p, " -> ")?;
20352035
sig.output().print(p)?;
20362036
}

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)