Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/proc-macro2/src/probe/proc_macro_span.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / proc-macro2 / src / probe / proc_macro_span.rs` 55 lines ยท 1217 bytes Raw Blame History 1 // This code exercises the surface area that we expect of Span's unstable API. 2 // If the current toolchain is able to compile it, then proc-macro2 is able to 3 // offer these APIs too. 4 5 #![cfg_attr(procmacro2_build_probe, no_std)] 6 #![cfg_attr(procmacro2_build_probe, feature(proc_macro_span))] 7 8 extern crate alloc; 9 extern crate proc_macro; 10 extern crate std; 11 12 use alloc::string::String; 13 use core::ops::{Range, RangeBounds}; 14 use proc_macro::{Literal, Span}; 15 use std::path::PathBuf; 16 17 pub fn byte_range(this: &Span) -> Range { 18 this.byte_range() 19 } 20 21 pub fn start(this: &Span) -> Span { 22 this.start() 23 } 24 25 pub fn end(this: &Span) -> Span { 26 this.end() 27 } 28 29 pub fn line(this: &Span) -> usize { 30 this.line() 31 } 32 33 pub fn column(this: &Span) -> usize { 34 this.column() 35 } 36 37 pub fn file(this: &Span) -> String { 38 this.file() 39 } 40 41 pub fn local_file(this: &Span) -> Option { 42 this.local_file() 43 } 44 45 pub fn join(this: &Span, other: Span) -> Option { 46 this.join(other) 47 } 48 49 pub fn subspan>(this: &Literal, range: R) -> Option { 50 this.subspan(range) 51 } 52 53 // Include in sccache cache key. 54 #[cfg(procmacro2_build_probe)] 55 const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP");