提交 322aedd4 编写于 作者: L Luqman Aden

librustdoc: Remove all uses of {:?}.

上级 c5a8bad1
......@@ -1251,7 +1251,7 @@ fn clean(&self, cx: &DocContext) -> Type {
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),
}
}
}
......@@ -1575,7 +1575,7 @@ fn clean(&self, cx: &DocContext) -> VariantKind {
}
}
#[deriving(Clone, Encodable, Decodable)]
#[deriving(Clone, Encodable, Decodable, Show)]
pub struct Span {
pub filename: String,
pub loline: uint,
......@@ -1714,7 +1714,7 @@ fn clean(&self, cx: &DocContext) -> BareFunctionDecl {
}
}
#[deriving(Clone, Encodable, Decodable)]
#[deriving(Clone, Encodable, Decodable, Show)]
pub struct Static {
pub type_: Type,
pub mutability: Mutability,
......@@ -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),
......@@ -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()
......@@ -2017,7 +2017,7 @@ fn to_src(&self, cx: &DocContext) -> String {
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| {
......@@ -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(),
......@@ -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")
......
......@@ -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,
......
......@@ -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,
......
......@@ -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());
......@@ -1491,7 +1491,7 @@ fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: uint, idx2: uint) -> Ordering {
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];
......
......@@ -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));
......@@ -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);
......
......@@ -264,7 +264,7 @@ fn resolve_id(&mut self, id: ast::NodeId, renamed: Option<ast::Ident>,
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) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册