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

Rollup of 8 pull requests #42032

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
df188b8
Add lint for unused macros
est31 May 11, 2017
db82c57
Extend the libsyntax visitor to work over macro defs
est31 May 12, 2017
d14d194
Support #[allow] etc logic on a per macro level
est31 May 12, 2017
ba0601d
libcore: #[allow] some unused macros
est31 May 12, 2017
b36d23c
Add test, and fix the other tests
est31 May 12, 2017
0d0cb27
librustc_incremental: remove unused macro in test case
est31 May 14, 2017
a9cb094
Explain why `thread::yield_now` could be used.
May 13, 2017
a51777e
Improve `thread::Builder` documentation.
May 14, 2017
93f78bc
rustdoc: Display `extern "C" fn` instead of `extern fn`
ollie27 May 14, 2017
173f693
Rewrite make-win-dist.py in Rust
wesleywiser May 6, 2017
c0d5aa8
Make unsatisfied trait bounds note multiline
estebank Apr 24, 2017
25b7f10
Address review comments
est31 May 15, 2017
f92bd3d
Add links to the `thread::LocalKey` doc.
May 14, 2017
9f4e1e1
Fix regression in `macro_rules!` name matching.
jseyfried May 15, 2017
6dbd706
put option_try macro def under #[cfg(unix)]
est31 May 16, 2017
a49d6c1
Rollup merge of #41489 - estebank:trait-bounds-diagnosstic, r=arielb1
Mark-Simulacrum May 16, 2017
38bdfdc
Rollup merge of #41907 - est31:macro_unused, r=jseyfried
Mark-Simulacrum May 16, 2017
0dc1d45
Rollup merge of #41932 - wesleywiser:py-to-rust, r=alexcrichton
Mark-Simulacrum May 16, 2017
e4a4f53
Rollup merge of #41982 - gamazeps:thread-yield-now, r=GuillaumeGomez
Mark-Simulacrum May 16, 2017
b5a24d4
Rollup merge of #41994 - gamazeps:thread-builder, r=GuillaumeGomez
Mark-Simulacrum May 16, 2017
4e48bfb
Rollup merge of #41995 - gamazeps:thread-localkey, r=frewsxcv
Mark-Simulacrum May 16, 2017
bf3abe0
Rollup merge of #42001 - ollie27:rustdoc_extern_fn, r=GuillaumeGomez
Mark-Simulacrum May 16, 2017
747f7d2
Rollup merge of #42005 - jseyfried:fix_macro_regression, r=nrc
Mark-Simulacrum May 16, 2017
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
Prev Previous commit
Next Next commit
Extend the libsyntax visitor to work over macro defs
  • Loading branch information
est31 committed May 13, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit db82c57cb7ff7f4f629ceeaefdbc693d2886fda7
6 changes: 5 additions & 1 deletion src/libsyntax/visit.rs
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ use abi::Abi;
use ast::*;
use syntax_pos::Span;
use codemap::Spanned;
use tokenstream::ThinTokenStream;

#[derive(Copy, Clone, PartialEq, Eq)]
pub enum FnKind<'a> {
@@ -110,6 +111,9 @@ pub trait Visitor<'ast>: Sized {
// definition in your trait impl:
// visit::walk_mac(self, _mac)
}
fn visit_mac_def(&mut self, _mac: &'ast ThinTokenStream, _id: NodeId) {
// Nothing to do
}
fn visit_path(&mut self, path: &'ast Path, _id: NodeId) {
walk_path(self, path)
}
@@ -288,7 +292,7 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
walk_list!(visitor, visit_trait_item, methods);
}
ItemKind::Mac(ref mac) => visitor.visit_mac(mac),
ItemKind::MacroDef(..) => {},
ItemKind::MacroDef(ref ts) => visitor.visit_mac_def(ts, item.id),
}
walk_list!(visitor, visit_attribute, &item.attrs);
}