Skip to content

Commit 9095cf9

Browse files
committed
rename is_valid_for to is_valid
1 parent dd34e0c commit 9095cf9

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

compiler/rustc_codegen_llvm/src/abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ impl<'tcx> FnAbiLlvmExt<'tcx> for FnAbi<'tcx, Ty<'tcx>> {
541541
// become 0..0 when the type becomes i1, which would be rejected
542542
// by the LLVM verifier.
543543
if let Int(..) = scalar.value {
544-
if !scalar.is_bool() && !scalar.is_always_valid_for(bx) {
544+
if !scalar.is_bool() && !scalar.is_always_valid(bx) {
545545
bx.range_metadata(callsite, scalar.valid_range);
546546
}
547547
}

compiler/rustc_codegen_llvm/src/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
464464
) {
465465
match scalar.value {
466466
abi::Int(..) => {
467-
if !scalar.is_always_valid_for(bx) {
467+
if !scalar.is_always_valid(bx) {
468468
bx.range_metadata(load, scalar.valid_range);
469469
}
470470
}

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
308308
// then `i1 1` (i.e., E::B) is effectively `i8 -1`.
309309
signed = !scalar.is_bool() && s;
310310

311-
if !scalar.is_always_valid_for(bx.cx())
311+
if !scalar.is_always_valid(bx.cx())
312312
&& scalar.valid_range.end >= scalar.valid_range.start
313313
{
314314
// We want `table[e as usize ± k]` to not

compiler/rustc_target/src/abi/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ impl Scalar {
830830

831831
/// Returns `true` if all possible numbers are valid, i.e `valid_range` covers the whole layout
832832
#[inline]
833-
pub fn is_always_valid_for<C: HasDataLayout>(&self, cx: &C) -> bool {
833+
pub fn is_always_valid<C: HasDataLayout>(&self, cx: &C) -> bool {
834834
self.valid_range.is_full_for(self.value.size(cx))
835835
}
836836
}
@@ -1280,7 +1280,7 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
12801280
s.valid_range.contains(0)
12811281
} else {
12821282
// The range must include all values.
1283-
s.is_always_valid_for(cx)
1283+
s.is_always_valid(cx)
12841284
}
12851285
};
12861286

0 commit comments

Comments
 (0)