Navigation Menu

Skip to content

Commit

Permalink
libsyntax: Remove all uses of {:?}.
Browse files Browse the repository at this point in the history
  • Loading branch information
luqmana committed Oct 16, 2014
1 parent 38aca17 commit 26e547a
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
9 changes: 4 additions & 5 deletions mk/crates.mk
Expand Up @@ -51,7 +51,7 @@

TARGET_CRATES := libc std green native flate arena glob term semver \
uuid serialize sync getopts collections num test time rand \
url log regex graphviz core rbml rlibc alloc debug rustrt \
url log regex graphviz core rbml rlibc alloc rustrt \
unicode
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros \
rustc_llvm rustc_back
Expand All @@ -63,20 +63,19 @@ DEPS_libc := core
DEPS_rlibc := core
DEPS_unicode := core
DEPS_alloc := core libc native:jemalloc
DEPS_debug := std
DEPS_rustrt := alloc core libc collections native:rustrt_native
DEPS_std := core libc rand alloc collections rustrt sync unicode \
native:rust_builtin native:backtrace
DEPS_graphviz := std
DEPS_green := std native:context_switch
DEPS_native := std
DEPS_syntax := std term serialize log fmt_macros debug arena libc
DEPS_syntax := std term serialize log fmt_macros arena libc
DEPS_rustc := syntax flate arena serialize getopts rbml \
time log graphviz debug rustc_llvm rustc_back
time log graphviz rustc_llvm rustc_back
DEPS_rustc_llvm := native:rustllvm libc std
DEPS_rustc_back := std syntax rustc_llvm flate log libc
DEPS_rustdoc := rustc native:hoedown serialize getopts \
test time debug
test time
DEPS_flate := std native:miniz
DEPS_arena := std
DEPS_graphviz := std
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ast.rs
Expand Up @@ -81,7 +81,7 @@ impl PartialEq for Ident {
// one example and its non-hygienic counterpart would be:
// syntax::parse::token::mtwt_token_eq
// syntax::ext::tt::macro_parser::token_name_eq
fail!("not allowed to compare these idents: {:?}, {:?}. \
fail!("not allowed to compare these idents: {}, {}. \
Probably related to issue \\#6993", self, other);
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/libsyntax/ast_map/mod.rs
Expand Up @@ -96,6 +96,7 @@ pub fn path_to_string<PI: Iterator<PathElem>>(mut path: PI) -> String {
}).to_string()
}

#[deriving(Show)]
pub enum Node<'ast> {
NodeItem(&'ast Item),
NodeForeignItem(&'ast ForeignItem),
Expand Down Expand Up @@ -387,7 +388,7 @@ impl<'ast> Map<'ast> {
PathName(ident.name)
}
MethMac(_) => {
fail!("no path elem for {:?}", node)
fail!("no path elem for {}", node)
}
}
}
Expand All @@ -401,13 +402,13 @@ impl<'ast> Map<'ast> {
MethDecl(ident, _, _, _, _, _, _, _) => {
PathName(ident.name)
}
MethMac(_) => fail!("no path elem for {:?}", node),
MethMac(_) => fail!("no path elem for {}", node),
}
}
TypeTraitItem(ref m) => PathName(m.ident.name),
},
NodeVariant(v) => PathName(v.node.name.name),
_ => fail!("no path elem for {:?}", node)
_ => fail!("no path elem for {}", node)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ast_util.rs
Expand Up @@ -308,7 +308,7 @@ pub fn empty_generics() -> Generics {
// ______________________________________________________________________
// Enumerating the IDs which appear in an AST

#[deriving(Encodable, Decodable)]
#[deriving(Encodable, Decodable, Show)]
pub struct IdRange {
pub min: NodeId,
pub max: NodeId,
Expand Down
10 changes: 5 additions & 5 deletions src/libsyntax/ext/expand.rs
Expand Up @@ -1700,11 +1700,11 @@ foo_module!()
}).enumerate() {
if mtwt::resolve(v.segments.get(0).identifier) != resolved_binding {
println!("uh oh, xx binding didn't match xx varref:");
println!("this is xx varref \\# {:?}",idx);
println!("binding: {:?}",cxbind);
println!("resolves to: {:?}",resolved_binding);
println!("varref: {:?}",v.segments.get(0).identifier);
println!("resolves to: {:?}",
println!("this is xx varref \\# {}", idx);
println!("binding: {}", cxbind);
println!("resolves to: {}", resolved_binding);
println!("varref: {}", v.segments.get(0).identifier);
println!("resolves to: {}",
mtwt::resolve(v.segments.get(0).identifier));
mtwt::with_sctable(|x| mtwt::display_sctable(x));
}
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax/ext/mtwt.rs
Expand Up @@ -38,7 +38,7 @@ pub struct SCTable {
rename_memo: RefCell<HashMap<(SyntaxContext,Ident,Name),SyntaxContext>>,
}

#[deriving(PartialEq, Encodable, Decodable, Hash)]
#[deriving(PartialEq, Encodable, Decodable, Hash, Show)]
pub enum SyntaxContext_ {
EmptyCtxt,
Mark (Mrk,SyntaxContext),
Expand Down Expand Up @@ -129,7 +129,7 @@ fn new_sctable_internal() -> SCTable {
pub fn display_sctable(table: &SCTable) {
error!("SC table:");
for (idx,val) in table.table.borrow().iter().enumerate() {
error!("{:4u} : {:?}",idx,val);
error!("{:4u} : {}",idx,val);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/fold.rs
Expand Up @@ -1389,7 +1389,7 @@ mod test {
let a_val = $a;
let b_val = $b;
if !(pred_val(a_val.as_slice(),b_val.as_slice())) {
fail!("expected args satisfying {}, got {:?} and {:?}",
fail!("expected args satisfying {}, got {} and {}",
$predname, a_val, b_val);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/parse/attr.rs
Expand Up @@ -63,7 +63,7 @@ impl<'a> ParserAttr for Parser<'a> {
/// If permit_inner is true, then a leading `!` indicates an inner
/// attribute
fn parse_attribute(&mut self, permit_inner: bool) -> ast::Attribute {
debug!("parse_attributes: permit_inner={:?} self.token={:?}",
debug!("parse_attributes: permit_inner={} self.token={}",
permit_inner, self.token);
let (span, value, mut style) = match self.token {
token::POUND => {
Expand Down
6 changes: 3 additions & 3 deletions src/libsyntax/parse/mod.rs
Expand Up @@ -823,19 +823,19 @@ mod test {
}
},
_ => {
error!("failing value 3: {:?}",first_set);
error!("failing value 3: {}",first_set);
assert_eq!("wrong 3","correct")
}
}
},
_ => {
error!("failing value 2: {:?}",delim_elts);
error!("failing value 2: {}",delim_elts);
assert_eq!("wrong","correct");
}
}
},
_ => {
error!("failing value: {:?}",tts);
error!("failing value: {}",tts);
assert_eq!("wrong 1","correct");
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/libsyntax/parse/parser.rs
Expand Up @@ -492,7 +492,7 @@ impl<'a> Parser<'a> {
/// followed by some token from the set edible + inedible. Recover
/// from anticipated input errors, discarding erroneous characters.
pub fn commit_expr(&mut self, e: &Expr, edible: &[token::Token], inedible: &[token::Token]) {
debug!("commit_expr {:?}", e);
debug!("commit_expr {}", e);
match e.node {
ExprPath(..) => {
// might be unit-struct construction; check for recoverableinput error.
Expand Down Expand Up @@ -1535,7 +1535,7 @@ impl<'a> Parser<'a> {
// TYPE TO BE INFERRED
TyInfer
} else {
let msg = format!("expected type, found token {:?}", self.token);
let msg = format!("expected type, found token {}", self.token);
self.fatal(msg.as_slice());
};

Expand Down Expand Up @@ -1591,7 +1591,7 @@ impl<'a> Parser<'a> {
/// identifier names.
pub fn parse_arg_general(&mut self, require_name: bool) -> Arg {
let pat = if require_name || self.is_named_argument() {
debug!("parse_arg_general parse_pat (require_name:{:?})",
debug!("parse_arg_general parse_pat (require_name:{})",
require_name);
let pat = self.parse_pat();

Expand Down Expand Up @@ -1882,7 +1882,7 @@ impl<'a> Parser<'a> {
token::BINOP(token::SHR) => { return res; }
_ => {
let msg = format!("expected `,` or `>` after lifetime \
name, got: {:?}",
name, got: {}",
self.token);
self.fatal(msg.as_slice());
}
Expand Down Expand Up @@ -4711,7 +4711,7 @@ impl<'a> Parser<'a> {
attrs = attrs_remaining.clone().append(attrs.as_slice());
first = false;
}
debug!("parse_mod_items: parse_item_or_view_item(attrs={:?})",
debug!("parse_mod_items: parse_item_or_view_item(attrs={})",
attrs);
match self.parse_item_or_view_item(attrs,
true /* macros allowed */) {
Expand Down

0 comments on commit 26e547a

Please sign in to comment.