fix the check for which expressions read never type
...wrt `type_ascribe`/unsafe binders -- the check was infinitely recursive before.
This commit is contained in:
parent
784b283b29
commit
c5f15bd607
2 changed files with 2 additions and 2 deletions
|
|
@ -251,7 +251,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
// Place-preserving expressions only constitute reads if their
|
||||
// parent expression constitutes a read.
|
||||
ExprKind::Type(..) | ExprKind::UnsafeBinderCast(..) => {
|
||||
self.expr_guaranteed_to_constitute_read_for_never(expr)
|
||||
self.expr_guaranteed_to_constitute_read_for_never(parent_expr)
|
||||
}
|
||||
|
||||
ExprKind::Assign(lhs, _, _) => {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// This checks that a nested type ascription doesn't cause a crash when the
|
||||
// compiler checks if it constitutes a read of the never type.
|
||||
//
|
||||
//@ known-bug: #149542
|
||||
//@ check-pass
|
||||
|
||||
#![feature(never_type)]
|
||||
#![feature(type_ascription)]
|
||||
Loading…
Add table
Add a link
Reference in a new issue