support non-null pointer niches in CTFE
This commit is contained in:
parent
3c05276866
commit
76c49aead6
8 changed files with 100 additions and 65 deletions
|
@ -333,7 +333,7 @@ impl<'mir, 'tcx: 'mir> CompileTimeEvalContext<'mir, 'tcx> {
|
|||
// Inequality with integers other than null can never be known for sure.
|
||||
(Scalar::Int(int), ptr @ Scalar::Ptr(..))
|
||||
| (ptr @ Scalar::Ptr(..), Scalar::Int(int))
|
||||
if int.is_null() && !self.scalar_may_be_null(ptr)? =>
|
||||
if int.is_null() && !self.ptr_scalar_range(ptr)?.contains(&0) =>
|
||||
{
|
||||
0
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue