rust/compiler/rustc_expand/src
Stuart Cook bc4e7ad248
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.)
2025-04-15 15:47:27 +10:00
..
mbe Auto merge of #124141 - nnethercote:rm-Nonterminal-and-TokenKind-Interpolated, r=petrochenkov 2025-04-14 03:56:55 +00:00
base.rs Rename some name variables as ident. 2025-04-10 09:30:55 +10:00
build.rs Implement super let. 2025-04-04 09:44:19 +02:00
config.rs Remove TokenStream::flattened and InvisibleOrigin::FlattenToken. 2025-04-02 16:16:51 +11:00
errors.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
expand.rs Address review comments. 2025-04-10 09:39:21 +10:00
lib.rs Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
mbe.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
module.rs Reject macro calls inside of #![crate_name] 2025-02-15 16:47:30 +01:00
placeholders.rs Move ast::Item::ident into ast::ItemKind. 2025-04-01 14:08:57 +11:00
proc_macro.rs Remove NtItem and NtStmt. 2025-03-07 14:51:07 +11:00
proc_macro_server.rs Rollup merge of #139671 - m-ou-se:proc-macro-span, r=dtolnay 2025-04-15 15:47:27 +10:00