diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-04-15 15:47:27 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-15 15:47:27 +1000 |
| commit | bc4e7ad24869df27279d442294a8ec90f75d6a77 (patch) | |
| tree | bfd6c4abe3c98af08e5f3f6ef72fb303036e5842 /compiler/rustc_codegen_llvm/src/errors.rs | |
| parent | 13cd5256acf1fdae1721047a4beb8aeeae360480 (diff) | |
| parent | 1f3199c89995ee7ae5cbdaa81d1df5138660d61a (diff) | |
| download | rust-bc4e7ad24869df27279d442294a8ec90f75d6a77.tar.gz rust-bc4e7ad24869df27279d442294a8ec90f75d6a77.zip | |
Rollup merge of #139671 - m-ou-se:proc-macro-span, r=dtolnay
Proc macro span API redesign: Replace proc_macro::SourceFile by Span::{file, local_file}
Simplification/redesign of the unstable proc macro span API, tracked in https://github.com/rust-lang/rust/issues/54725:
Before:
```rust
impl Span {
pub fn line(&self) -> usize;
pub fn column(&self) -> usize;
pub fn source_file(&self) -> SourceFile;
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SourceFile { .. }
impl !Send for SourceFile {}
impl !Sync for SourceFile {}
impl SourceFile {
pub fn path(&self) -> PathBuf;
pub fn is_real(&self) -> bool;
}
```
After:
```rust
impl Span {
pub fn line(&self) -> usize;
pub fn column(&self) -> usize;
pub fn file(&self) -> String; // Mapped file name, for display purposes.
pub fn local_file(&self) -> Option<PathBuf>; // Real file name as it exists on disk.
}
```
This resolves the last blocker for stabilizing these methods. (Stabilizing will be a separate PR with FCP.)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
