Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand nested items within a backtrace. #12671

Merged
merged 1 commit into from
Mar 5, 2014
Merged

Expand nested items within a backtrace. #12671

merged 1 commit into from
Mar 5, 2014

Conversation

nrc
Copy link
Member

@nrc nrc commented Mar 3, 2014

Fixes a regression from #4913 which causes items to be exanded with spans lacking expn_info from the context's current backtrace.

|item| items.push(item));
decorator_items.push_all(items.move_iter()
.flat_map(|item| expand_item(item, fld).move_iter())
.collect());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we avoid collect() here? I don't know if there's a vec method that takes an Iterator<T>, but if not, there probably should be.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's called .extend

@huonw
Copy link
Member

huonw commented Mar 3, 2014

r=me with .extend. (What a subtle thing to track down! Nice work.)

@huonw
Copy link
Member

huonw commented Mar 3, 2014

(Oh, it seems Vec doesn't implement Extendable...)

@huonw
Copy link
Member

huonw commented Mar 3, 2014

It will be implemented when #12673 lands.

@nrc
Copy link
Member Author

nrc commented Mar 3, 2014

We're using SmallVec anyway, so I will implement extend for that.

Yeah, this was a total pain to track down. Sadly I couldn't think of a nice way to test it either.

Fixes a regression from rust-lang#4913 which causes items to be exanded with spans lacking expn_info from the context's current backtrace.
@nrc
Copy link
Member Author

nrc commented Mar 5, 2014

@huon - ready for re-review - implemented using SmallVector::extend

bors added a commit that referenced this pull request Mar 5, 2014
Fixes a regression from #4913 which causes items to be exanded with spans lacking expn_info from the context's current backtrace.
@bors bors closed this Mar 5, 2014
@bors bors merged commit 4a891fe into rust-lang:master Mar 5, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants