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

Perform cfg attribute processing on decorator-generated items #34295

Merged
merged 2 commits into from
Jun 19, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/libsyntax/ext/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,6 @@ fn decorate(a: Annotatable, fld: &mut MacroExpander) -> SmallVector<Annotatable>
let mut decorator_items = SmallVector::zero();
let mut new_attrs = Vec::new();
expand_decorators(a.clone(), fld, &mut decorator_items, &mut new_attrs);
let decorator_items =
decorator_items.into_iter().flat_map(|a| expand_annotatable(a, fld)).collect();

let mut new_items = SmallVector::one(a.fold_attrs(new_attrs));
Copy link
Contributor Author

@jseyfried jseyfried Jun 16, 2016

Choose a reason for hiding this comment

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

decorator_items are already expanded in expand_decorators().
I mistakenly added this in #34010. Since expansion is idempotent, it didn't cause bugs, just regressed expansion performance.

new_items.push_all(decorator_items);
Expand Down