diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-04-26 07:13:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-26 07:13:06 +0200 |
| commit | 096c4958bf3c0ed777e851b220fc75e24e5ce742 (patch) | |
| tree | 5611cded7a73bdbf468086d8c843a926dac8b915 /compiler/rustc_llvm/llvm-wrapper/Linker.cpp | |
| parent | 555e1d0386f024a8359645c3217f4b3eae9be042 (diff) | |
| parent | c5c93626a08f191549fa08c52f1617ac5d2b62b5 (diff) | |
| download | rust-096c4958bf3c0ed777e851b220fc75e24e5ce742.tar.gz rust-096c4958bf3c0ed777e851b220fc75e24e5ce742.zip | |
Rollup merge of #139865 - m-ou-se:stabilize-proc-macro-span-location, r=tgross35
Stabilize proc_macro::Span::{start,end,line,column}.
This stabilizes part of https://github.com/rust-lang/rust/issues/54725
Specifically, the part related to getting the location of a span:
```rust
impl Span {
pub fn start(&self) -> Span; // Empty span at the start of this span
pub fn end(&self) -> Span; // Empty span at the end of this span
pub fn line(&self) -> usize; // Line where the span starts
pub fn column(&self) -> usize; // Column where the span starts
}
```
History of this part of the API:
Originally, `start` and `end` returned a `LineColumn` struct (containing the line and column).
This has been simplified/changed:
- No more `LineColumn`: `Span` now directly has `.line()` and `.column()` methods. This means we can easily add `.byte_offset()` or `.byte_range()` in the future if we want to.
- `Span::start()` and `Span::end()` are now the equivalent of rustc's internal `shrink_to_lo()` and `shrink_to_hi()`. This means you can do e.g. `span.end().column()`, removing the need for a `span.end_column()` or similar.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/Linker.cpp')
0 files changed, 0 insertions, 0 deletions
