Skip to content

Commit 94332bb

Browse files
committed
Auto merge of #78047 - khyperia:set_span_mut, r=bjorn3
Make set_span take mut self This was a mistake in #77614 It's not a _huge_ deal, because backends can always implement this with interior mutability, but it's nice to avoid interior mutability when possible. For context, the `set_source_location` method, called alongside `set_span`, also takes `&mut self`. r? `@eddyb`
2 parents c38ddb8 + 3d48448 commit 94332bb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_codegen_llvm/src/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
139139
unsafe { llvm::LLVMGetInsertBlock(self.llbuilder) }
140140
}
141141

142-
fn set_span(&self, _span: Span) {}
142+
fn set_span(&mut self, _span: Span) {}
143143

144144
fn position_at_end(&mut self, llbb: &'ll BasicBlock) {
145145
unsafe {

compiler/rustc_codegen_ssa/src/traits/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub trait BuilderMethods<'a, 'tcx>:
4545
fn build_sibling_block(&self, name: &str) -> Self;
4646
fn cx(&self) -> &Self::CodegenCx;
4747
fn llbb(&self) -> Self::BasicBlock;
48-
fn set_span(&self, span: Span);
48+
fn set_span(&mut self, span: Span);
4949

5050
fn position_at_end(&mut self, llbb: Self::BasicBlock);
5151
fn ret_void(&mut self);

0 commit comments

Comments
 (0)