diff options
| author | Moulins <arthur.heuillard@orange.fr> | 2023-06-25 19:32:40 +0200 |
|---|---|---|
| committer | Moulins <arthur.heuillard@orange.fr> | 2023-07-21 03:31:45 +0200 |
| commit | 76c49aead6d49a993c4b2e59cceaf7d8d3324944 (patch) | |
| tree | 0061384d8ed50ca481236be892a9982ebd8463e6 /compiler/rustc_const_eval/src/const_eval | |
| parent | 3c0527686644cb30291a03bdecdcfddb396765ab (diff) | |
| download | rust-76c49aead6d49a993c4b2e59cceaf7d8d3324944.tar.gz rust-76c49aead6d49a993c4b2e59cceaf7d8d3324944.zip | |
support non-null pointer niches in CTFE
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/machine.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index 267795a6cb4..51012da6b90 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -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 } |
