Skip to content

Commit

Permalink
librustdoc: 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 c5a8bad commit 322aedd
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
16 changes: 8 additions & 8 deletions src/librustdoc/clean/mod.rs
Expand Up @@ -1251,7 +1251,7 @@ impl Clean<Type> for ast::Ty {
TyBareFn(ref barefn) => BareFunction(box barefn.clean(cx)),
TyParen(ref ty) => ty.clean(cx),
TyBot => Bottom,
ref x => fail!("Unimplemented type {:?}", x),
ref x => fail!("Unimplemented type {}", x),
}
}
}
Expand Down Expand Up @@ -1575,7 +1575,7 @@ impl Clean<VariantKind> for ast::VariantKind {
}
}

#[deriving(Clone, Encodable, Decodable)]
#[deriving(Clone, Encodable, Decodable, Show)]
pub struct Span {
pub filename: String,
pub loline: uint,
Expand Down Expand Up @@ -1714,7 +1714,7 @@ impl Clean<BareFunctionDecl> for ast::BareFnTy {
}
}

#[deriving(Clone, Encodable, Decodable)]
#[deriving(Clone, Encodable, Decodable, Show)]
pub struct Static {
pub type_: Type,
pub mutability: Mutability,
Expand All @@ -1726,7 +1726,7 @@ pub struct Static {

impl Clean<Item> for doctree::Static {
fn clean(&self, cx: &DocContext) -> Item {
debug!("claning static {}: {:?}", self.name.clean(cx), self);
debug!("claning static {}: {}", self.name.clean(cx), self);
Item {
name: Some(self.name.clean(cx)),
attrs: self.attrs.clean(cx),
Expand Down Expand Up @@ -2004,7 +2004,7 @@ trait ToSource {

impl ToSource for syntax::codemap::Span {
fn to_src(&self, cx: &DocContext) -> String {
debug!("converting span {:?} to snippet", self.clean(cx));
debug!("converting span {} to snippet", self.clean(cx));
let sn = match cx.sess().codemap().span_to_snippet(*self) {
Some(x) => x.to_string(),
None => "".to_string()
Expand All @@ -2017,7 +2017,7 @@ impl ToSource for syntax::codemap::Span {
fn lit_to_string(lit: &ast::Lit) -> String {
match lit.node {
ast::LitStr(ref st, _) => st.get().to_string(),
ast::LitBinary(ref data) => format!("{:?}", data.as_slice()),
ast::LitBinary(ref data) => format!("{}", data),
ast::LitByte(b) => {
let mut res = String::from_str("b'");
(b as char).escape_default(|c| {
Expand All @@ -2037,7 +2037,7 @@ fn lit_to_string(lit: &ast::Lit) -> String {

fn name_from_pat(p: &ast::Pat) -> String {
use syntax::ast::*;
debug!("Trying to get a name from pattern: {:?}", p);
debug!("Trying to get a name from pattern: {}", p);

match p.node {
PatWild(PatWildSingle) => "_".to_string(),
Expand Down Expand Up @@ -2082,7 +2082,7 @@ fn resolve_type(cx: &DocContext, path: Path,
// If we're extracting tests, this return value doesn't matter.
None => return Primitive(Bool),
};
debug!("searching for {:?} in defmap", id);
debug!("searching for {} in defmap", id);
let def = match tcx.def_map.borrow().find(&id) {
Some(&k) => k,
None => fail!("unresolved id not in defmap")
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/core.rs
Expand Up @@ -135,7 +135,7 @@ pub fn run_core(libs: Vec<Path>, cfgs: Vec<String>, externs: Externs,
inlined: RefCell::new(Some(HashSet::new())),
populated_crate_impls: RefCell::new(HashSet::new()),
};
debug!("crate: {:?}", ctxt.krate);
debug!("crate: {}", ctxt.krate);

let analysis = CrateAnalysis {
exported_items: exported_items,
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/doctree.rs
Expand Up @@ -141,6 +141,7 @@ pub struct Typedef {
pub stab: Option<attr::Stability>,
}

#[deriving(Show)]
pub struct Static {
pub type_: P<ast::Ty>,
pub mutability: ast::Mutability,
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/html/render.rs
Expand Up @@ -1042,7 +1042,7 @@ impl Context {
/// sure it always points to the top (relatively)
fn recurse<T>(&mut self, s: String, f: |&mut Context| -> T) -> T {
if s.len() == 0 {
fail!("what {:?}", self);
fail!("Unexpected empty destination: {}", self.current);
}
let prev = self.dst.clone();
self.dst.push(s.as_slice());
Expand Down Expand Up @@ -1491,7 +1491,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,

indices.sort_by(|&i1, &i2| cmp(&items[i1], &items[i2], i1, i2));

debug!("{:?}", indices);
debug!("{}", indices);
let mut curty = None;
for &idx in indices.iter() {
let myitem = &items[idx];
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/lib.rs
Expand Up @@ -333,7 +333,7 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche
let (mut krate, analysis) = std::task::try(proc() {
let cr = cr;
core::run_core(libs, cfgs, externs, &cr, triple)
}).map_err(|boxed_any|format!("{:?}", boxed_any)).unwrap();
}).map_err(|_| "rustc failed").unwrap();
info!("finished with rustc");
analysiskey.replace(Some(analysis));

Expand Down Expand Up @@ -480,7 +480,7 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
};
let crate_json = match json::from_str(crate_json_str.as_slice()) {
Ok(j) => j,
Err(e) => fail!("Rust generated JSON is invalid: {:?}", e)
Err(e) => fail!("Rust generated JSON is invalid: {}", e)
};

json.insert("crate".to_string(), crate_json);
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/visit_ast.rs
Expand Up @@ -264,7 +264,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {

pub fn visit_item(&mut self, item: &ast::Item,
renamed: Option<ast::Ident>, om: &mut Module) {
debug!("Visiting item {:?}", item);
debug!("Visiting item {}", item);
let name = renamed.unwrap_or(item.ident);
match item.node {
ast::ItemMod(ref m) => {
Expand Down

0 comments on commit 322aedd

Please sign in to comment.