d2235f20b5
Fix escaped backslash in windows file not found message When a module is declared, but no matching file exists, rustc gives an error like `help: name the file either foo.rs or foo/mod.rs inside the directory "src/bar"`. However, at on windows, the backslash was double-escaped when naming the directory. It did this because the string was printed in debug mode (`"{:?}"`) to surround it with quotes. However, it should just be printed like any other directory in an error message and surrounded by escaped quotes, rather than relying on the debug print to add quotes (`"\"{}\""`). I also checked the test suite to see if this output is being correctly tested. It's not - it only tests up to the word "directory". Presumably this is so that the test is not dependent on its exact position in the source tree. I don't know a better way to test this, unless the test suite supports regex? |
||
---|---|---|
.. | ||
diagnostics | ||
ext | ||
parse | ||
util | ||
abi.rs | ||
ast.rs | ||
attr.rs | ||
build.rs | ||
Cargo.toml | ||
codemap.rs | ||
config.rs | ||
diagnostic_list.rs | ||
edition.rs | ||
entry.rs | ||
feature_gate.rs | ||
fold.rs | ||
json.rs | ||
lib.rs | ||
ptr.rs | ||
README.md | ||
show_span.rs | ||
std_inject.rs | ||
str.rs | ||
test_snippet.rs | ||
test.rs | ||
tokenstream.rs | ||
visit.rs |
The syntax
crate contains those things concerned purely with syntax
– that is, the AST ("abstract syntax tree"), parser, pretty-printer,
lexer, macro expander, and utilities for traversing ASTs.
For more information about how these things work in rustc, see the rustc guide: