@@ -49,7 +49,6 @@ use context::{is_pie_binary, get_reloc_model};
49
49
use common;
50
50
use jobserver:: { Client , Acquired } ;
51
51
use rustc_demangle;
52
- use std:: marker:: PhantomData ;
53
52
54
53
use std:: any:: Any ;
55
54
use std:: ffi:: { CString , CStr } ;
@@ -348,7 +347,7 @@ struct AssemblerCommand {
348
347
349
348
/// Additional resources used by optimize_and_codegen (not module specific)
350
349
#[ derive( Clone ) ]
351
- pub struct CodegenContext < ' ll > {
350
+ pub struct CodegenContext {
352
351
// Resources needed when running LTO
353
352
pub time_passes : bool ,
354
353
pub lto : Lto ,
@@ -389,13 +388,10 @@ pub struct CodegenContext<'ll> {
389
388
// measuring is disabled.
390
389
time_graph : Option < TimeGraph > ,
391
390
// The assembler command if no_integrated_as option is enabled, None otherwise
392
- assembler_cmd : Option < Arc < AssemblerCommand > > ,
393
- // This field is used to give a lifetime parameter to the struct so that it can implement
394
- // the Backend trait.
395
- phantom : PhantomData < & ' ll ( ) >
391
+ assembler_cmd : Option < Arc < AssemblerCommand > >
396
392
}
397
393
398
- impl CodegenContext < ' ll > {
394
+ impl CodegenContext {
399
395
pub fn create_diag_handler ( & self ) -> Handler {
400
396
Handler :: with_emitter ( true , false , Box :: new ( self . diag_emitter . clone ( ) ) )
401
397
}
@@ -424,12 +420,12 @@ impl CodegenContext<'ll> {
424
420
}
425
421
426
422
pub struct DiagnosticHandlers < ' a > {
427
- data : * mut ( & ' a CodegenContext < ' a > , & ' a Handler ) ,
423
+ data : * mut ( & ' a CodegenContext , & ' a Handler ) ,
428
424
llcx : & ' a llvm:: Context ,
429
425
}
430
426
431
427
impl < ' a > DiagnosticHandlers < ' a > {
432
- pub fn new ( cgcx : & ' a CodegenContext < ' a > ,
428
+ pub fn new ( cgcx : & ' a CodegenContext ,
433
429
handler : & ' a Handler ,
434
430
llcx : & ' a llvm:: Context ) -> Self {
435
431
let data = Box :: into_raw ( Box :: new ( ( cgcx, handler) ) ) ;
@@ -1620,7 +1616,6 @@ fn start_executing_work(tcx: TyCtxt,
1620
1616
target_pointer_width : tcx. sess . target . target . target_pointer_width . clone ( ) ,
1621
1617
debuginfo : tcx. sess . opts . debuginfo ,
1622
1618
assembler_cmd,
1623
- phantom : PhantomData
1624
1619
} ;
1625
1620
1626
1621
// This is the "main loop" of parallel work happening for parallel codegen.
@@ -2115,7 +2110,7 @@ pub const CODEGEN_WORK_PACKAGE_KIND: time_graph::WorkPackageKind =
2115
2110
const LLVM_WORK_PACKAGE_KIND : time_graph:: WorkPackageKind =
2116
2111
time_graph:: WorkPackageKind ( & [ "#7DB67A" , "#C6EEC4" , "#ACDAAA" , "#579354" , "#3E6F3C" ] ) ;
2117
2112
2118
- fn spawn_work ( cgcx : CodegenContext < ' static > , work : WorkItem ) {
2113
+ fn spawn_work ( cgcx : CodegenContext , work : WorkItem ) {
2119
2114
let depth = time_depth ( ) ;
2120
2115
2121
2116
thread:: spawn ( move || {
0 commit comments