Debian Codegraph @

third_party/rust/proc-macro2/build/probe.rs

raw
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 #![feature(proc_macro_span)]
6
7 extern crate proc_macro;
8
9 use core::ops::{Range, RangeBounds};
10 use proc_macro::{Literal, Span};
11
12 pub fn byte_range(this: &Span) -> Range<usize> {
13 this.byte_range()
14 }
15
16 pub fn join(this: &Span, other: Span) -> Option<Span> {
17 this.join(other)
18 }
19
20 pub fn subspan<R: RangeBounds<usize>>(this: &Literal, range: R) -> Option<Span> {
21 this.subspan(range)
22 }
23
24 // Include in sccache cache key.
25 const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP");