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:
@@ -111,7 +111,7 @@ impl<'a> Reader for TtReader<'a> {
|
||||
}
|
||||
fn next_token(&mut self) -> TokenAndSpan {
|
||||
let r = tt_next_token(self);
|
||||
debug!("TtReader: r={}", r);
|
||||
debug!("TtReader: r={:?}", r);
|
||||
r
|
||||
}
|
||||
fn fatal(&self, m: &str) -> ! {
|
||||
@@ -256,13 +256,13 @@ impl<'a> StringReader<'a> {
|
||||
/// adjusted 1 towards each other (assumes that on either side there is a
|
||||
/// single-byte delimiter).
|
||||
pub fn name_from(&self, start: BytePos) -> ast::Name {
|
||||
debug!("taking an ident from {} to {}", start, self.last_pos);
|
||||
debug!("taking an ident from {:?} to {:?}", start, self.last_pos);
|
||||
self.with_str_from(start, token::intern)
|
||||
}
|
||||
|
||||
/// As name_from, with an explicit endpoint.
|
||||
pub fn name_from_to(&self, start: BytePos, end: BytePos) -> ast::Name {
|
||||
debug!("taking an ident from {} to {}", start, end);
|
||||
debug!("taking an ident from {:?} to {:?}", start, end);
|
||||
self.with_str_from_to(start, end, token::intern)
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ impl<'a> StringReader<'a> {
|
||||
// for skipping over all "junk"
|
||||
'/' | '#' => {
|
||||
let c = self.scan_comment();
|
||||
debug!("scanning a comment {}", c);
|
||||
debug!("scanning a comment {:?}", c);
|
||||
c
|
||||
},
|
||||
c if is_whitespace(Some(c)) => {
|
||||
@@ -506,7 +506,7 @@ impl<'a> StringReader<'a> {
|
||||
tok: token::Whitespace,
|
||||
sp: codemap::mk_sp(start_bpos, self.last_pos)
|
||||
});
|
||||
debug!("scanning whitespace: {}", c);
|
||||
debug!("scanning whitespace: {:?}", c);
|
||||
c
|
||||
},
|
||||
_ => None
|
||||
@@ -592,8 +592,8 @@ impl<'a> StringReader<'a> {
|
||||
whence: &str) {
|
||||
match r.curr {
|
||||
Some(r_c) if r_c == c => r.bump(),
|
||||
Some(r_c) => panic!("expected {}, hit {}, {}", described_c, r_c, whence),
|
||||
None => panic!("expected {}, hit EOF, {}", described_c, whence),
|
||||
Some(r_c) => panic!("expected {:?}, hit {:?}, {}", described_c, r_c, whence),
|
||||
None => panic!("expected {:?}, hit EOF, {}", described_c, whence),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -614,7 +614,7 @@ impl<'a> StringReader<'a> {
|
||||
self.scan_digits(base);
|
||||
let encoded_name : u32 = self.with_str_from(start_bpos, |s| {
|
||||
num::from_str_radix(s, 10).unwrap_or_else(|| {
|
||||
panic!("expected digits representing a name, got `{}`, {}, range [{},{}]",
|
||||
panic!("expected digits representing a name, got {:?}, {}, range [{:?},{:?}]",
|
||||
s, whence, start_bpos, self.last_pos);
|
||||
})
|
||||
});
|
||||
@@ -632,7 +632,7 @@ impl<'a> StringReader<'a> {
|
||||
self.scan_digits(base);
|
||||
let encoded_ctxt : ast::SyntaxContext = self.with_str_from(start_bpos, |s| {
|
||||
num::from_str_radix(s, 10).unwrap_or_else(|| {
|
||||
panic!("expected digits representing a ctxt, got `{}`, {}", s, whence);
|
||||
panic!("expected digits representing a ctxt, got {:?}, {}", s, whence);
|
||||
})
|
||||
});
|
||||
|
||||
@@ -652,7 +652,7 @@ impl<'a> StringReader<'a> {
|
||||
if c == Some('_') { debug!("skipping a _"); self.bump(); continue; }
|
||||
match c.and_then(|cc| cc.to_digit(radix)) {
|
||||
Some(_) => {
|
||||
debug!("{} in scan_digits", c);
|
||||
debug!("{:?} in scan_digits", c);
|
||||
len += 1;
|
||||
self.bump();
|
||||
}
|
||||
@@ -728,7 +728,7 @@ impl<'a> StringReader<'a> {
|
||||
delim: char,
|
||||
below_0x7f_only: bool)
|
||||
-> bool {
|
||||
debug!("scanning {} digits until {}", n_digits, delim);
|
||||
debug!("scanning {} digits until {:?}", n_digits, delim);
|
||||
let start_bpos = self.last_pos;
|
||||
let mut accum_int = 0;
|
||||
|
||||
@@ -990,7 +990,7 @@ impl<'a> StringReader<'a> {
|
||||
if is_dec_digit(c) {
|
||||
let num = self.scan_number(c.unwrap());
|
||||
let suffix = self.scan_optional_raw_name();
|
||||
debug!("next_token_inner: scanned number {}, {}", num, suffix);
|
||||
debug!("next_token_inner: scanned number {:?}, {:?}", num, suffix);
|
||||
return token::Literal(num, suffix)
|
||||
}
|
||||
|
||||
@@ -1444,14 +1444,14 @@ fn is_dec_digit(c: Option<char>) -> bool { return in_range(c, '0', '9'); }
|
||||
pub fn is_doc_comment(s: &str) -> bool {
|
||||
let res = (s.starts_with("///") && *s.as_bytes().get(3).unwrap_or(&b' ') != b'/')
|
||||
|| s.starts_with("//!");
|
||||
debug!("is `{}` a doc comment? {}", s, res);
|
||||
debug!("is {:?} a doc comment? {}", s, res);
|
||||
res
|
||||
}
|
||||
|
||||
pub fn is_block_doc_comment(s: &str) -> bool {
|
||||
let res = (s.starts_with("/**") && *s.as_bytes().get(3).unwrap_or(&b' ') != b'*')
|
||||
|| s.starts_with("/*!");
|
||||
debug!("is `{}` a doc comment? {}", s, res);
|
||||
debug!("is {:?} a doc comment? {}", s, res);
|
||||
res
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user