@@ -73,8 +73,8 @@ pub(crate) fn const_alloc_to_llvm<'ll>(
73
73
74
74
// Generating partially-uninit consts is limited to small numbers of chunks,
75
75
// to avoid the cost of generating large complex const expressions.
76
- // For example, `[(u32, u8); 1024 * 1024]` contains uninit padding in each element,
77
- // and would result in `{ [5 x i8] zeroinitializer, [3 x i8] undef, ...repeat 1M times... }`.
76
+ // For example, `[(u32, u8); 1024 * 1024]` contains uninit padding in each element, and
77
+ // would result in `{ [5 x i8] zeroinitializer, [3 x i8] undef, ...repeat 1M times... }`.
78
78
let max = cx. sess ( ) . opts . unstable_opts . uninit_const_chunk_threshold ;
79
79
let allow_uninit_chunks = chunks. clone ( ) . take ( max. saturating_add ( 1 ) ) . count ( ) <= max;
80
80
@@ -249,8 +249,8 @@ impl<'ll> CodegenCx<'ll, '_> {
249
249
trace ! ( ?instance) ;
250
250
251
251
let DefKind :: Static { nested, .. } = self . tcx . def_kind ( def_id) else { bug ! ( ) } ;
252
- // Nested statics do not have a type, so pick a dummy type and let `codegen_static` figure out
253
- // the llvm type from the actual evaluated initializer.
252
+ // Nested statics do not have a type, so pick a dummy type and let `codegen_static` figure
253
+ // out the llvm type from the actual evaluated initializer.
254
254
let llty = if nested {
255
255
self . type_i8 ( )
256
256
} else {
@@ -320,15 +320,16 @@ impl<'ll> CodegenCx<'ll, '_> {
320
320
}
321
321
322
322
if !def_id. is_local ( ) {
323
- let needs_dll_storage_attr = self . use_dll_storage_attrs && !self . tcx . is_foreign_item ( def_id) &&
323
+ let needs_dll_storage_attr = self . use_dll_storage_attrs
324
+ && !self . tcx . is_foreign_item ( def_id)
324
325
// Local definitions can never be imported, so we must not apply
325
326
// the DLLImport annotation.
326
- !dso_local &&
327
+ && !dso_local
327
328
// ThinLTO can't handle this workaround in all cases, so we don't
328
329
// emit the attrs. Instead we make them unnecessary by disallowing
329
330
// dynamic linking when linker plugin based LTO is enabled.
330
- !self . tcx . sess . opts . cg . linker_plugin_lto . enabled ( ) &&
331
- self . tcx . sess . lto ( ) != Lto :: Thin ;
331
+ && !self . tcx . sess . opts . cg . linker_plugin_lto . enabled ( )
332
+ && self . tcx . sess . lto ( ) != Lto :: Thin ;
332
333
333
334
// If this assertion triggers, there's something wrong with commandline
334
335
// argument validation.
@@ -551,8 +552,8 @@ impl<'ll> CodegenCx<'ll, '_> {
551
552
// `#[used(compiler)]` is explicitly requested. This is to avoid similar breakage
552
553
// on other targets, in particular MachO targets have *their* static constructor
553
554
// lists broken if `llvm.compiler.used` is emitted rather than `llvm.used`. However,
554
- // that check happens when assigning the `CodegenFnAttrFlags` in `rustc_hir_analysis`,
555
- // so we don't need to take care of it here.
555
+ // that check happens when assigning the `CodegenFnAttrFlags` in
556
+ // `rustc_hir_analysis`, so we don't need to take care of it here.
556
557
self . add_compiler_used_global ( g) ;
557
558
}
558
559
if attrs. flags . contains ( CodegenFnAttrFlags :: USED_LINKER ) {
0 commit comments