@@ -3,7 +3,7 @@ use crate::syntax::instantiate::NamedImplKey;
33use crate :: syntax:: types:: ConditionalImpl ;
44use crate :: syntax:: { Lifetimes , Type , Types } ;
55use proc_macro2:: TokenStream ;
6- use quote:: { quote_spanned , ToTokens } ;
6+ use quote:: { quote , ToTokens } ;
77use syn:: { Lifetime , Token } ;
88
99pub ( crate ) struct ResolvedGenericType < ' a > {
@@ -62,13 +62,12 @@ impl<'a> ToTokens for ResolvedGenericType<'a> {
6262 }
6363 }
6464 Type :: RustBox ( ty1) => {
65- let span = ty1. name . span ( ) ;
6665 let inner = ResolvedGenericType {
6766 ty : & ty1. inner ,
6867 explicit_impl : self . explicit_impl ,
6968 types : self . types ,
7069 } ;
71- tokens. extend ( quote_spanned ! { span=>
70+ tokens. extend ( quote ! {
7271 :: cxx:: alloc:: boxed:: Box <#inner>
7372 } ) ;
7473 }
@@ -77,7 +76,7 @@ impl<'a> ToTokens for ResolvedGenericType<'a> {
7776 }
7877}
7978
80- fn get_impl_generics < ' a > ( ty : & Type , types : & ' a Types < ' a > ) -> & ' a Lifetimes {
79+ fn get_impl_generics < ' a > ( ty : & Type , types : & Types < ' a > ) -> & ' a Lifetimes {
8180 match ty {
8281 Type :: Ident ( named_type) => types. resolve ( named_type) . generics ,
8382 Type :: RustBox ( ty1) => get_impl_generics ( & ty1. inner , types) ,
@@ -88,16 +87,14 @@ fn get_impl_generics<'a>(ty: &Type, types: &'a Types<'a>) -> &'a Lifetimes {
8887pub ( crate ) fn format_for_prevent_unwind_label ( ty : & Type ) -> TokenStream {
8988 match ty {
9089 Type :: Ident ( named_type) => {
91- let span = named_type. rust . span ( ) ;
9290 let rust_name = named_type. rust . to_string ( ) ;
93- quote_spanned ! { span=>
91+ quote ! {
9492 :: cxx:: core:: concat!( :: cxx:: core:: module_path!( ) , "::" , #rust_name)
9593 }
9694 }
9795 Type :: RustBox ( ty1) => {
98- let span = ty1. name . span ( ) ;
9996 let inner = format_for_prevent_unwind_label ( & ty1. inner ) ;
100- quote_spanned ! { span=>
97+ quote ! {
10198 :: cxx:: core:: concat!( "Box<" , #inner, ">" )
10299 }
103100 }
0 commit comments