• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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::RangeBounds;
10 use proc_macro::{Literal, Span};
11 
join(this: &Span, other: Span) -> Option<Span>12 pub fn join(this: &Span, other: Span) -> Option<Span> {
13     this.join(other)
14 }
15 
subspan<R: RangeBounds<usize>>(this: &Literal, range: R) -> Option<Span>16 pub fn subspan<R: RangeBounds<usize>>(this: &Literal, range: R) -> Option<Span> {
17     this.subspan(range)
18 }
19 
20 // Include in sccache cache key.
21 const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP");
22