diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-08 22:17:46 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-13 06:58:51 +0200 |
| commit | 742ec4b9bf7ae7d693da7fe75e5f974e0fafb9d0 (patch) | |
| tree | 279b7b118176d564d71813e9ba0ed2caa5fd5a37 /src/libsyntax/parse/diagnostics.rs | |
| parent | d131abefc3aa53fc6376593729e6931326270503 (diff) | |
| download | rust-742ec4b9bf7ae7d693da7fe75e5f974e0fafb9d0.tar.gz rust-742ec4b9bf7ae7d693da7fe75e5f974e0fafb9d0.zip | |
ast: remove implicit pprust dependency via Display.
Instead just use `pprust::path_to_string(..)` where needed. This has two benefits: a) The AST definition is now independent of printing it. (Therefore we get closer to extracting a data-crate.) b) Debugging should be easier as program flow is clearer.
Diffstat (limited to 'src/libsyntax/parse/diagnostics.rs')
| -rw-r--r-- | src/libsyntax/parse/diagnostics.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/diagnostics.rs b/src/libsyntax/parse/diagnostics.rs index f376c19a66c..df744e403d8 100644 --- a/src/libsyntax/parse/diagnostics.rs +++ b/src/libsyntax/parse/diagnostics.rs @@ -854,7 +854,7 @@ impl<'a> Parser<'a> { // This is a best-effort recovery. path.span, "try", - format!("<{}>::{}", ty_str, path), + format!("<{}>::{}", ty_str, pprust::path_to_string(&path)), Applicability::MaybeIncorrect, ) .emit(); |
