Emit proper error when casting to Ddyn-star
This commit is contained in:
parent
5237c4d83d
commit
c4420135fe
5 changed files with 65 additions and 1 deletions
|
@ -866,7 +866,13 @@ impl<'a, 'tcx> CastCheck<'tcx> {
|
|||
|
||||
(Int(_) | Float, Int(_) | Float) => Ok(CastKind::NumericCast),
|
||||
|
||||
(_, DynStar) | (DynStar, _) => bug!("should be handled by `try_coerce`"),
|
||||
(_, DynStar) | (DynStar, _) => {
|
||||
if fcx.tcx.features().dyn_star {
|
||||
bug!("should be handled by `try_coerce`")
|
||||
} else {
|
||||
Err(CastError::IllegalCast)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue