Skip to content

Commit 864efcf

Browse files
authored
Rollup merge of #72234 - dtolnay:default, r=petrochenkov
Implement Default for proc_macro::TokenStream Hopefully this is uncontroversial. The only reason we've made it this far without is that proc-macro2 snuck this in for their TokenStream.
2 parents 27d523d + d5ea925 commit 864efcf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libproc_macro/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ impl fmt::Debug for TokenStream {
158158
}
159159
}
160160

161+
#[stable(feature = "proc_macro_token_stream_default", since = "1.45.0")]
162+
impl Default for TokenStream {
163+
fn default() -> Self {
164+
TokenStream::new()
165+
}
166+
}
167+
161168
#[unstable(feature = "proc_macro_quote", issue = "54722")]
162169
pub use quote::{quote, quote_span};
163170

0 commit comments

Comments
 (0)