@@ -48,7 +48,6 @@ use context::{is_pie_binary, get_reloc_model};
4848use common;
4949use jobserver:: { Client , Acquired } ;
5050use rustc_demangle;
51- use std:: marker:: PhantomData ;
5251
5352use std:: any:: Any ;
5453use std:: ffi:: { CString , CStr } ;
@@ -345,7 +344,7 @@ struct AssemblerCommand {
345344
346345/// Additional resources used by optimize_and_codegen (not module specific)
347346#[ derive( Clone ) ]
348- pub struct CodegenContext < ' ll > {
347+ pub struct CodegenContext {
349348 // Resources needed when running LTO
350349 pub time_passes : bool ,
351350 pub lto : Lto ,
@@ -384,13 +383,10 @@ pub struct CodegenContext<'ll> {
384383 // measuring is disabled.
385384 time_graph : Option < TimeGraph > ,
386385 // The assembler command if no_integrated_as option is enabled, None otherwise
387- assembler_cmd : Option < Arc < AssemblerCommand > > ,
388- // This field is used to give a lifetime parameter to the struct so that it can implement
389- // the Backend trait.
390- phantom : PhantomData < & ' ll ( ) >
386+ assembler_cmd : Option < Arc < AssemblerCommand > >
391387}
392388
393- impl CodegenContext < ' ll > {
389+ impl CodegenContext {
394390 pub fn create_diag_handler ( & self ) -> Handler {
395391 Handler :: with_emitter ( true , false , Box :: new ( self . diag_emitter . clone ( ) ) )
396392 }
@@ -419,12 +415,12 @@ impl CodegenContext<'ll> {
419415}
420416
421417pub struct DiagnosticHandlers < ' a > {
422- data : * mut ( & ' a CodegenContext < ' a > , & ' a Handler ) ,
418+ data : * mut ( & ' a CodegenContext , & ' a Handler ) ,
423419 llcx : & ' a llvm:: Context ,
424420}
425421
426422impl < ' a > DiagnosticHandlers < ' a > {
427- pub fn new ( cgcx : & ' a CodegenContext < ' a > ,
423+ pub fn new ( cgcx : & ' a CodegenContext ,
428424 handler : & ' a Handler ,
429425 llcx : & ' a llvm:: Context ) -> Self {
430426 let data = Box :: into_raw ( Box :: new ( ( cgcx, handler) ) ) ;
@@ -1625,7 +1621,6 @@ fn start_executing_work(tcx: TyCtxt,
16251621 target_pointer_width : tcx. sess . target . target . target_pointer_width . clone ( ) ,
16261622 debuginfo : tcx. sess . opts . debuginfo ,
16271623 assembler_cmd,
1628- phantom : PhantomData
16291624 } ;
16301625
16311626 // This is the "main loop" of parallel work happening for parallel codegen.
@@ -2096,7 +2091,7 @@ pub const CODEGEN_WORK_PACKAGE_KIND: time_graph::WorkPackageKind =
20962091const LLVM_WORK_PACKAGE_KIND : time_graph:: WorkPackageKind =
20972092 time_graph:: WorkPackageKind ( & [ "#7DB67A" , "#C6EEC4" , "#ACDAAA" , "#579354" , "#3E6F3C" ] ) ;
20982093
2099- fn spawn_work ( cgcx : CodegenContext < ' static > , work : WorkItem ) {
2094+ fn spawn_work ( cgcx : CodegenContext , work : WorkItem ) {
21002095 let depth = time_depth ( ) ;
21012096
21022097 thread:: spawn ( move || {
0 commit comments