rollup merge of #20481: seanmonstar/fmt-show-string

Conflicts:
	src/compiletest/runtest.rs
	src/libcore/fmt/mod.rs
	src/libfmt_macros/lib.rs
	src/libregex/parse.rs
	src/librustc/middle/cfg/construct.rs
	src/librustc/middle/dataflow.rs
	src/librustc/middle/infer/higher_ranked/mod.rs
	src/librustc/middle/ty.rs
	src/librustc_back/archive.rs
	src/librustc_borrowck/borrowck/fragments.rs
	src/librustc_borrowck/borrowck/gather_loans/mod.rs
	src/librustc_resolve/lib.rs
	src/librustc_trans/back/link.rs
	src/librustc_trans/save/mod.rs
	src/librustc_trans/trans/base.rs
	src/librustc_trans/trans/callee.rs
	src/librustc_trans/trans/common.rs
	src/librustc_trans/trans/consts.rs
	src/librustc_trans/trans/controlflow.rs
	src/librustc_trans/trans/debuginfo.rs
	src/librustc_trans/trans/expr.rs
	src/librustc_trans/trans/monomorphize.rs
	src/librustc_typeck/astconv.rs
	src/librustc_typeck/check/method/mod.rs
	src/librustc_typeck/check/mod.rs
	src/librustc_typeck/check/regionck.rs
	src/librustc_typeck/collect.rs
	src/libsyntax/ext/format.rs
	src/libsyntax/ext/source_util.rs
	src/libsyntax/ext/tt/transcribe.rs
	src/libsyntax/parse/mod.rs
	src/libsyntax/parse/token.rs
	src/test/run-pass/issue-8898.rs
This commit is contained in:
Alex Crichton 2015-01-06 15:22:24 -08:00
commit 5c3ddcb15d
252 changed files with 2703 additions and 2072 deletions

View file

@ -90,7 +90,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span,
for (i, field) in fields.iter().enumerate() {
if i != 0 { format_string.push_str(", "); }
format_string.push_str("{}");
format_string.push_str("{:?}");
exprs.push(field.self_.clone());
}
@ -107,7 +107,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span,
let name = token::get_ident(field.name.unwrap());
format_string.push_str(" ");
format_string.push_str(name.get());
format_string.push_str(": {}");
format_string.push_str(": {:?}");
exprs.push(field.self_.clone());
}

View file

@ -36,7 +36,7 @@ pub fn expand_type(t: P<ast::Ty>,
fld: &mut MacroExpander,
impl_ty: Option<P<ast::Ty>>)
-> P<ast::Ty> {
debug!("expanding type {} with impl_ty {}", t, impl_ty);
debug!("expanding type {:?} with impl_ty {:?}", t, impl_ty);
let t = match (t.node.clone(), impl_ty) {
// Expand uses of `Self` in impls to the concrete type.
(ast::Ty_::TyPath(ref path, _), Some(ref impl_ty)) => {

View file

@ -607,7 +607,7 @@ impl<'a, 'b> Context<'a, 'b> {
let trait_ = match *ty {
Known(ref tyname) => {
match tyname.index(&FullRange) {
"" => "Show",
"" => "String",
"?" => "Show",
"e" => "LowerExp",
"E" => "UpperExp",

View file

@ -121,7 +121,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!("{:4} : {}",idx,val);
error!("{:4} : {:?}",idx,val);
}
}

View file

@ -135,7 +135,7 @@ pub fn expand_include_str(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
let bytes = match File::open(&file).read_to_end() {
Err(e) => {
cx.span_err(sp,
format!("couldn't read {}: {}",
format!("couldn't read {:?}: {}",
file.display(),
e).index(&FullRange));
return DummyResult::expr(sp);
@ -146,7 +146,7 @@ pub fn expand_include_str(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
Ok(src) => {
// Add this input file to the code map to make it available as
// dependency information
let filename = file.display().to_string();
let filename = format!("{:?}", file.display());
let interned = token::intern_and_get_ident(src.index(&FullRange));
cx.codemap().new_filemap(filename, src);
@ -154,7 +154,7 @@ pub fn expand_include_str(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
}
Err(_) => {
cx.span_err(sp,
format!("{} wasn't a utf-8 file",
format!("{:?} wasn't a utf-8 file",
file.display()).index(&FullRange));
return DummyResult::expr(sp);
}
@ -177,7 +177,7 @@ pub fn expand_include_bytes(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
match File::open(&file).read_to_end() {
Err(e) => {
cx.span_err(sp,
format!("couldn't read {}: {}", file.display(), e).index(&FullRange));
format!("couldn't read {:?}: {}", file.display(), e).index(&FullRange));
return DummyResult::expr(sp);
}
Ok(bytes) => {

View file

@ -128,7 +128,7 @@ impl Add for LockstepIterSize {
let l_n = token::get_ident(l_id.clone());
let r_n = token::get_ident(r_id);
LisContradiction(format!("inconsistent lockstep iteration: \
'{}' has {} items, but '{}' has {}",
'{:?}' has {} items, but '{:?}' has {}",
l_n, l_len, r_n, r_len).to_string())
}
},
@ -296,7 +296,7 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan {
MatchedSeq(..) => {
r.sp_diag.span_fatal(
r.cur_span, /* blame the macro writer */
format!("variable '{}' is still repeating at this depth",
format!("variable '{:?}' is still repeating at this depth",
token::get_ident(ident)).index(&FullRange));
}
}