1
Fork 0

Drive-by-cleanup: Don't emit thir::ExprKind::NeverToAny for ! -> !

This commit is contained in:
Maybe Waffle 2023-05-09 12:42:39 +00:00
parent f542778533
commit 140cdcbc9d
16 changed files with 77 additions and 135 deletions

View file

@ -130,6 +130,7 @@ impl<'tcx> Cx<'tcx> {
ExprKind::Pointer { cast: PointerCast::Unsize, source: self.thir.exprs.push(expr) }
}
Adjust::Pointer(cast) => ExprKind::Pointer { cast, source: self.thir.exprs.push(expr) },
Adjust::NeverToAny if adjustment.target.is_never() => return expr,
Adjust::NeverToAny => ExprKind::NeverToAny { source: self.thir.exprs.push(expr) },
Adjust::Deref(None) => {
adjust_span(&mut expr);