diff --git a/src/parse.rs b/src/parse.rs index a3b2f18e77..aafc1a9649 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -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")] @@ -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 {