Skip to content

Commit 49d9676

Browse files
Centri3NCGThompson
authored andcommitted
use immediate type instead
1 parent ca0af9e commit 49d9676

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler/rustc_codegen_llvm/src/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'ll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'_, 'll, 'tcx> {
120120
self.call_intrinsic("llvm.expect.i1", &[args[0].immediate(), self.const_bool(true)])
121121
}
122122
sym::is_val_statically_known => self.call_intrinsic(
123-
&format!("llvm.is.constant.{:?}", args[0].layout.llvm_type(self.cx)),
123+
&format!("llvm.is.constant.{:?}", args[0].layout.immediate_llvm_type(self.cx)),
124124
&[args[0].immediate()],
125125
),
126126
sym::unlikely => self

library/core/src/intrinsics.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,8 @@ extern "rust-intrinsic" {
25542554
// and thus compiling stage0 core doesn't work.
25552555
#[rustc_const_stable(feature = "is_val_statically_known", since = "never")]
25562556
#[cfg(bootstrap)]
2557-
pub const unsafe fn is_val_statically_known<T: ~const crate::marker::Destruct>(_: T) -> bool {
2557+
pub const unsafe fn is_val_statically_known<T>(t: T) -> bool {
2558+
mem::forget(t);
25582559
false
25592560
}
25602561

0 commit comments

Comments
 (0)