Exchange this cursor for one with a set source location. This is intended to be used as a builder method: ``` # use cranelift_codegen::ir::{Function, Block, SourceLoc}; # use cranelift_codegen::cursor::{Cursor, FuncCursor}; fn edit_func(func: &mut Function, srcloc: SourceLoc) { let mut pos = FuncCursor::new(func).with_srcloc(srcloc); // Use `pos`... } ```
(mut self, srcloc: ir::SourceLoc)
| 54 | /// } |
| 55 | /// ``` |
| 56 | fn with_srcloc(mut self, srcloc: ir::SourceLoc) -> Self |
| 57 | where |
| 58 | Self: Sized, |
| 59 | { |
| 60 | self.set_srcloc(srcloc); |
| 61 | self |
| 62 | } |
| 63 | |
| 64 | /// Rebuild this cursor positioned at `pos`. |
| 65 | fn at_position(mut self, pos: CursorPosition) -> Self |