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`
This commit is contained in:
bors 2020-10-18 05:36:23 +00:00
commit 94332bbe10
2 changed files with 2 additions and 2 deletions

View File

@ -139,7 +139,7 @@ fn llbb(&self) -> &'ll BasicBlock {
unsafe { llvm::LLVMGetInsertBlock(self.llbuilder) } 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) { fn position_at_end(&mut self, llbb: &'ll BasicBlock) {
unsafe { unsafe {

View File

@ -45,7 +45,7 @@ pub trait BuilderMethods<'a, 'tcx>:
fn build_sibling_block(&self, name: &str) -> Self; fn build_sibling_block(&self, name: &str) -> Self;
fn cx(&self) -> &Self::CodegenCx; fn cx(&self) -> &Self::CodegenCx;
fn llbb(&self) -> Self::BasicBlock; 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 position_at_end(&mut self, llbb: Self::BasicBlock);
fn ret_void(&mut self); fn ret_void(&mut self);