Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 326f241

Browse files
committedNov 19, 2023
Pass TyCtxt by value
1 parent fa696af commit 326f241

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎compiler/rustc_codegen_gcc/src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'_>, cgu_name: Symbol, target_info: Lock
8888
fn module_codegen(tcx: TyCtxt<'_>, (cgu_name, target_info): (Symbol, LockedTargetInfo)) -> ModuleCodegen<GccContext> {
8989
let cgu = tcx.codegen_unit(cgu_name);
9090
// Instantiate monomorphizations without filling out definitions yet...
91-
let context = new_context(&tcx);
91+
let context = new_context(tcx);
9292

9393
if tcx.sess.panic_strategy() == PanicStrategy::Unwind {
9494
context.add_command_line_option("-fexceptions");

‎compiler/rustc_codegen_gcc/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl CodegenBackend for GccCodegenBackend {
246246
}
247247
}
248248

249-
fn new_context<'gcc, 'tcx>(tcx: &TyCtxt<'tcx>) -> Context<'gcc> {
249+
fn new_context<'gcc, 'tcx>(tcx: TyCtxt<'tcx>) -> Context<'gcc> {
250250
let context = Context::default();
251251
if tcx.sess.target.arch == "x86" || tcx.sess.target.arch == "x86_64" {
252252
context.add_command_line_option("-masm=intel");
@@ -268,7 +268,7 @@ fn new_context<'gcc, 'tcx>(tcx: &TyCtxt<'tcx>) -> Context<'gcc> {
268268
impl ExtraBackendMethods for GccCodegenBackend {
269269
fn codegen_allocator<'tcx>(&self, tcx: TyCtxt<'tcx>, module_name: &str, kind: AllocatorKind, alloc_error_handler_kind: AllocatorKind) -> Self::Module {
270270
let mut mods = GccContext {
271-
context: new_context(&tcx),
271+
context: new_context(tcx),
272272
should_combine_object_files: false,
273273
temp_dir: None,
274274
};

0 commit comments

Comments
 (0)
Failed to load comments.