File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 11use super :: TokenStreamExt ;
2+ use std:: sync:: Arc ;
23use alloc:: borrow:: { Cow , ToOwned } ;
34use alloc:: boxed:: Box ;
45use alloc:: ffi:: CString ;
@@ -104,6 +105,12 @@ impl<T: ?Sized + ToTokens> ToTokens for Rc<T> {
104105 }
105106}
106107
108+ impl < T : ?Sized + ToTokens > ToTokens for Arc < T > {
109+ fn to_tokens ( & self , tokens : & mut TokenStream ) {
110+ ( * * self ) . to_tokens ( tokens) ;
111+ }
112+ }
113+
107114impl < T : ToTokens > ToTokens for Option < T > {
108115 fn to_tokens ( & self , tokens : & mut TokenStream ) {
109116 if let Some ( t) = self {
Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ error[E0277]: the trait bound `Ipv4Addr: ToTokens` is not satisfied
1010 = help: the following other types implement trait `ToTokens`:
1111 &T
1212 &mut T
13+ Arc<T>
1314 Box<T>
1415 CStr
1516 CString
1617 Cow<'a, T>
1718 Option<T>
18- Rc<T>
1919 and $N others
2020 = note: this error originates in the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)
You can’t perform that action at this time.
0 commit comments