Skip to content

Commit

Permalink
Auto merge of #43280 - lfairy:token-tree-iter-clone, r=nrc
Browse files Browse the repository at this point in the history
Add #[derive(Clone)] to TokenTreeIter

I've found this useful for writing backtracking parsers.

The underlying `Cursor` implements `Clone` already, so it's just a matter of adding `#[derive(Clone)]` to the type.

r? @jseyfried
  • Loading branch information
bors committed Jul 24, 2017
2 parents 6e0dc54 + b525abb commit 9a70c3a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ impl Literal {
}

/// An iterator over `TokenTree`s.
#[derive(Clone)]
#[unstable(feature = "proc_macro", issue = "38356")]
pub struct TokenTreeIter {
cursor: tokenstream::Cursor,
Expand Down

0 comments on commit 9a70c3a

Please sign in to comment.