We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
maybe_is_aligned
1 parent aa975c6 commit 82e197bCopy full SHA for 82e197b
library/core/src/ub_checks.rs
@@ -119,14 +119,7 @@ pub(crate) const fn maybe_is_aligned_and_not_null(
119
is_zst: bool,
120
) -> bool {
121
// This is just for safety checks so we can const_eval_select.
122
- const_eval_select!(
123
- @capture { ptr: *const (), align: usize, is_zst: bool } -> bool:
124
- if const {
125
- is_zst || !ptr.is_null()
126
- } else {
127
- ptr.is_aligned_to(align) && (is_zst || !ptr.is_null())
128
- }
129
- )
+ maybe_is_aligned(ptr, align) && (is_zst || !ptr.is_null())
130
}
131
132
/// Checks whether `ptr` is properly aligned with respect to the given alignment.
0 commit comments