chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

View File

@@ -0,0 +1,55 @@
// This code exercises the surface area that we expect of Span's unstable API.
// If the current toolchain is able to compile it, then proc-macro2 is able to
// offer these APIs too.
#![cfg_attr(procmacro2_build_probe, no_std)]
#![cfg_attr(procmacro2_build_probe, feature(proc_macro_span))]
extern crate alloc;
extern crate proc_macro;
extern crate std;
use alloc::string::String;
use core::ops::{Range, RangeBounds};
use proc_macro::{Literal, Span};
use std::path::PathBuf;
pub fn byte_range(this: &Span) -> Range<usize> {
this.byte_range()
}
pub fn start(this: &Span) -> Span {
this.start()
}
pub fn end(this: &Span) -> Span {
this.end()
}
pub fn line(this: &Span) -> usize {
this.line()
}
pub fn column(this: &Span) -> usize {
this.column()
}
pub fn file(this: &Span) -> String {
this.file()
}
pub fn local_file(this: &Span) -> Option<PathBuf> {
this.local_file()
}
pub fn join(this: &Span, other: Span) -> Option<Span> {
this.join(other)
}
pub fn subspan<R: RangeBounds<usize>>(this: &Literal, range: R) -> Option<Span> {
this.subspan(range)
}
// Include in sccache cache key.
#[cfg(procmacro2_build_probe)]
const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP");

View File

@@ -0,0 +1,19 @@
// The subset of Span's API stabilized in Rust 1.88.
#![cfg_attr(procmacro2_build_probe, no_std)]
extern crate alloc;
extern crate proc_macro;
extern crate std;
use alloc::string::String;
use proc_macro::Span;
use std::path::PathBuf;
pub fn file(this: &Span) -> String {
this.file()
}
pub fn local_file(this: &Span) -> Option<PathBuf> {
this.local_file()
}

View File

@@ -0,0 +1,25 @@
// The subset of Span's API stabilized in Rust 1.88.
#![cfg_attr(procmacro2_build_probe, no_std)]
extern crate alloc;
extern crate proc_macro;
extern crate std;
use proc_macro::Span;
pub fn start(this: &Span) -> Span {
this.start()
}
pub fn end(this: &Span) -> Span {
this.end()
}
pub fn line(this: &Span) -> usize {
this.line()
}
pub fn column(this: &Span) -> usize {
this.column()
}