Skip to content

Commit 8ec3a83

Browse files
committed
Auto merge of #21617 - alexcrichton:less-quotes, r=nikomatsakis
This ends up propagating all the way out to the output of dep-info which then makes Cargo think that files are not existent (it thinks the files have quotes in their name) when they in fact do.
2 parents 16286f5 + 0dac568 commit 8ec3a83

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/libsyntax/codemap.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,10 @@ impl CodeMap {
364364
};
365365

366366
// Append '\n' in case it's not already there.
367-
// This is a workaround to prevent CodeMap.lookup_filemap_idx from accidentally
368-
// overflowing into the next filemap in case the last byte of span is also the last
369-
// byte of filemap, which leads to incorrect results from CodeMap.span_to_*.
367+
// This is a workaround to prevent CodeMap.lookup_filemap_idx from
368+
// accidentally overflowing into the next filemap in case the last byte
369+
// of span is also the last byte of filemap, which leads to incorrect
370+
// results from CodeMap.span_to_*.
370371
if src.len() > 0 && !src.ends_with("\n") {
371372
src.push('\n');
372373
}

src/libsyntax/ext/source_util.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub fn expand_include_str(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
135135
let bytes = match File::open(&file).read_to_end() {
136136
Err(e) => {
137137
cx.span_err(sp,
138-
&format!("couldn't read {:?}: {}",
138+
&format!("couldn't read {}: {}",
139139
file.display(),
140140
e)[]);
141141
return DummyResult::expr(sp);
@@ -146,15 +146,15 @@ pub fn expand_include_str(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
146146
Ok(src) => {
147147
// Add this input file to the code map to make it available as
148148
// dependency information
149-
let filename = format!("{:?}", file.display());
149+
let filename = format!("{}", file.display());
150150
let interned = token::intern_and_get_ident(&src[]);
151151
cx.codemap().new_filemap(filename, src);
152152

153153
base::MacExpr::new(cx.expr_str(sp, interned))
154154
}
155155
Err(_) => {
156156
cx.span_err(sp,
157-
&format!("{:?} wasn't a utf-8 file",
157+
&format!("{} wasn't a utf-8 file",
158158
file.display())[]);
159159
return DummyResult::expr(sp);
160160
}
@@ -171,7 +171,7 @@ pub fn expand_include_bytes(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
171171
match File::open(&file).read_to_end() {
172172
Err(e) => {
173173
cx.span_err(sp,
174-
&format!("couldn't read {:?}: {}", file.display(), e)[]);
174+
&format!("couldn't read {}: {}", file.display(), e)[]);
175175
return DummyResult::expr(sp);
176176
}
177177
Ok(bytes) => {

0 commit comments

Comments
 (0)