about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-10-18 05:36:23 +0000
committerbors <bors@rust-lang.org>2020-10-18 05:36:23 +0000
commit94332bbe100103fefafd9609ced01e0712dd71dd (patch)
tree24c4d3733ba5a9240d974d19474fa7d838327bd1
parentc38ddb8040edce1b05bc09a0e8439472e9f67623 (diff)
parent3d484481c7413a97117f059e10a53dff29d74498 (diff)
downloadrust-94332bbe100103fefafd9609ced01e0712dd71dd.tar.gz
rust-94332bbe100103fefafd9609ced01e0712dd71dd.zip
Auto merge of #78047 - khyperia:set_span_mut, r=bjorn3
Make set_span take mut self

This was a mistake in https://github.com/rust-lang/rust/pull/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`
-rw-r--r--compiler/rustc_codegen_llvm/src/builder.rs2
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/builder.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
index 174620ea2fa..491191d058c 100644
--- a/compiler/rustc_codegen_llvm/src/builder.rs
+++ b/compiler/rustc_codegen_llvm/src/builder.rs
@@ -139,7 +139,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
         unsafe { llvm::LLVMGetInsertBlock(self.llbuilder) }
     }
 
-    fn set_span(&self, _span: Span) {}
+    fn set_span(&mut self, _span: Span) {}
 
     fn position_at_end(&mut self, llbb: &'ll BasicBlock) {
         unsafe {
diff --git a/compiler/rustc_codegen_ssa/src/traits/builder.rs b/compiler/rustc_codegen_ssa/src/traits/builder.rs
index 0b8289a8dd9..d5bd2780388 100644
--- a/compiler/rustc_codegen_ssa/src/traits/builder.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/builder.rs
@@ -45,7 +45,7 @@ pub trait BuilderMethods<'a, 'tcx>:
     fn build_sibling_block(&self, name: &str) -> Self;
     fn cx(&self) -> &Self::CodegenCx;
     fn llbb(&self) -> Self::BasicBlock;
-    fn set_span(&self, span: Span);
+    fn set_span(&mut self, span: Span);
 
     fn position_at_end(&mut self, llbb: Self::BasicBlock);
     fn ret_void(&mut self);