Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit b8751c1

Browse files
committed
No need for a zst constructor method when we can have a constant
1 parent 3ef9dfd commit b8751c1

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

compiler/rustc_middle/src/mir/interpret/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl<'tcx, Tag> Scalar<Tag> {
180180

181181
#[inline]
182182
pub fn zst() -> Self {
183-
Scalar::Int(ScalarInt::zst())
183+
Scalar::Int(ScalarInt::ZST)
184184
}
185185

186186
#[inline(always)]

compiler/rustc_middle/src/ty/consts/int.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,6 @@ impl ScalarInt {
183183
);
184184
}
185185

186-
#[inline]
187-
pub fn zst() -> Self {
188-
Self::null(Size::ZERO)
189-
}
190-
191186
#[inline]
192187
pub fn null(size: Size) -> Self {
193188
Self { data: 0, size: size.bytes() as u8 }

0 commit comments

Comments
 (0)