-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delay assignment of node ids until after expansion. Ensures that each…
… AST node has a unique id. Fixes numerous bugs in macro expansion and deriving. Add two representative tests. Fixes #7971 Fixes #6304 Fixes #8367 Fixes #8754 Fixes #8852 Fixes #2543 Fixes #7654
- Loading branch information
1 parent
ed695d4
commit a5ad4c3
Showing
28 changed files
with
532 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
use driver::session::Session; | ||
|
||
use syntax::ast; | ||
use syntax::ast_util; | ||
|
||
pub fn assign_node_ids(sess: Session, crate: @ast::Crate) -> @ast::Crate { | ||
let fold = ast_util::node_id_assigner(|| sess.next_node_id()); | ||
@fold.fold_crate(crate) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
a5ad4c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from catamorphism
at nikomatsakis@a5ad4c3
a5ad4c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging nikomatsakis/rust/issue-6304-AST-tree-not-DAG = a5ad4c3 into auto
a5ad4c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nikomatsakis/rust/issue-6304-AST-tree-not-DAG = a5ad4c3 merged ok, testing candidate = 753d8c2
a5ad4c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/1369
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1372
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/478
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/478
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1388
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/479
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/479
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1388
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/479
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/479
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/560
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/1372
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/478
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/478
success: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/1157
a5ad4c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 753d8c2