Skip to content

Commit

Permalink
Implement ToTokens for syn::parse::Nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 16, 2024
1 parent 3f37543 commit 4f6c052
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ use crate::lookahead;
use crate::punctuated::Punctuated;
use crate::token::Token;
use proc_macro2::{Delimiter, Group, Literal, Punct, Span, TokenStream, TokenTree};
#[cfg(feature = "printing")]
use quote::ToTokens;
use std::cell::Cell;
use std::fmt::{self, Debug, Display};
#[cfg(feature = "extra-traits")]
Expand Down Expand Up @@ -1354,6 +1356,14 @@ impl Parse for Nothing {
}
}

#[cfg(feature = "printing")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
impl ToTokens for Nothing {
fn to_tokens(&self, tokens: &mut TokenStream) {
let _ = tokens;
}
}

#[cfg(feature = "clone-impls")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
impl Clone for Nothing {
Expand Down

0 comments on commit 4f6c052

Please sign in to comment.