Rollup merge of #142352 - workingjubilee:c-int-width-is-an-integer, r=wesleywiser

compiler: Make `c_int_width` an integer

Because it is.

That's all I got.
This commit is contained in:
Matthias Krüger
2025-06-12 03:14:54 +02:00
committed by GitHub
10 changed files with 24 additions and 26 deletions

View File

@@ -44,10 +44,10 @@ pub trait DerivedTypeCodegenMethods<'tcx>:
BaseTypeCodegenMethods + MiscCodegenMethods<'tcx> + HasTyCtxt<'tcx> + HasTypingEnv<'tcx>
{
fn type_int(&self) -> Self::Type {
match &self.sess().target.c_int_width[..] {
"16" => self.type_i16(),
"32" => self.type_i32(),
"64" => self.type_i64(),
match &self.sess().target.c_int_width {
16 => self.type_i16(),
32 => self.type_i32(),
64 => self.type_i64(),
width => bug!("Unsupported c_int_width: {}", width),
}
}