From 030c666cc1bc4830eac2f845b114f7c514f6e201 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 30 Apr 2013 01:15:17 -0400 Subject: Re-implement lint with less emphasis on item ids This way it's much easier to add lints throughout compilation correctly, and functions on impls can alter the way lints are emitted. --- src/libsyntax/ext/build.rs | 3 ++- src/libsyntax/ext/quote.rs | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 01b37a1196c..624e0495e59 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -196,6 +196,7 @@ pub fn mk_global_struct_e(cx: @ext_ctxt, } pub fn mk_glob_use(cx: @ext_ctxt, sp: span, + vis: ast::visibility, path: ~[ast::ident]) -> @ast::view_item { let glob = @codemap::spanned { node: ast::view_path_glob(mk_raw_path(sp, path), cx.next_id()), @@ -203,7 +204,7 @@ pub fn mk_glob_use(cx: @ext_ctxt, }; @ast::view_item { node: ast::view_item_use(~[glob]), attrs: ~[], - vis: ast::private, + vis: vis, span: sp } } pub fn mk_local(cx: @ext_ctxt, sp: span, mutbl: bool, diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index f4227cd2f2c..fc673c4422f 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -41,7 +41,6 @@ pub mod rt { pub use parse::new_parser_from_tts; pub use codemap::{BytePos, span, dummy_spanned}; - use print::pprust; use print::pprust::{item_to_str, ty_to_str}; pub trait ToTokens { @@ -678,10 +677,11 @@ fn expand_tts(cx: @ext_ctxt, // We want to emit a block expression that does a sequence of 'use's to // import the runtime module, followed by a tt-building expression. - let uses = ~[ build::mk_glob_use(cx, sp, ids_ext(cx, ~[~"syntax", - ~"ext", - ~"quote", - ~"rt"])) ]; + let uses = ~[ build::mk_glob_use(cx, sp, ast::public, + ids_ext(cx, ~[~"syntax", + ~"ext", + ~"quote", + ~"rt"])) ]; // We also bind a single value, sp, to ext_cx.call_site() // -- cgit 1.4.1-3-g733a5