Uh oh!
There was an error while loading. Please reload this page.
Fix issue #41652 - #41668
Conversation
rust-highfive
commented
May 1, 2017
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
kennytm
commented
May 1, 2017
The error happens because imported modules have no associated source code. As I mentioned in #41652, on stable this leads to a span pointing nowhere 👻 note: candidate #1 is defined in the trait `b::Tr`
--> b/src/lib.rs:11:5
|
11 | | _____^ starting here...
12 | |
| |__________________________^ ...ending here
= help: to disambiguate the method call, write `b::Tr::read(3)` insteadand causes ICE after #41245 because of In this PR, the error will be printed as note: candidate #1 is defined in the trait `b::Tr`
--> /full/path/to/b/src/lib.rs:11:5
|
= help: to disambiguate the method call, write `b::Tr::read(3)` insteadNote the line number is still printed, but without any source code following it. While this is certainly better than the current situation, I don't know if it is good enough. Alternatively we could ensure FileMap actually contains the source code when reporting error, but I don't see an easy way to do so without heavily modifying libsyntax |
5d326ab to
1edad2dComparearielb1
commented
May 1, 2017
Could you have a UI test for that? |
kennytm
commented
May 1, 2017
@arielb1 Added (ce92a54). In that case, should I just remove the compile-fail test? |
Yeah. There's no need for duplicate ui + cfail tests. Just a UI test so we can make sure the output is sane. |
arielb1
commented
May 2, 2017
@jonathandturner can you review this change? |
sophiajt
commented
May 3, 2017
This seems better than what we have, so we may want to approve just based on that. How difficult would it be to have this instead? Since starting to draw the span but not drawing anything doesn't seem to help the user much. |
Don't print the source code in emit_message_default() and render_source_line() if the source code is None.
kennytm
commented
May 3, 2017
@jonathandturner Looks like skipping the whole iteration works. The output is now error: no method named `f` found fortype `{integer}` in the current scope
--> $DIR/issue_41652.rs:19:11
|
19 | 3.f()
| ^
|
= note: found the following associated functions; to be usedasmethods, functions must have a `self` parameter
note:candidate #1 is defined in the trait `issue_41652_b::Tr`
= help: to disambiguate the method call, write `issue_41652_b::Tr::f(3)` instead
error:aborting due to previous error |
Mark-Simulacrum
commented
May 7, 2017
@jonathandturner Just checking in here, looks like this PR is ready for another review. |
sophiajt
commented
May 7, 2017
Great! @bors r+ |
bors
commented
May 7, 2017
📌 Commit 81bfdc8 has been approved by |
bors
commented
May 7, 2017
Fix issue #41652 Fix issue #41652. Don't print anything in `render_source_line()` if no source code is given. (cc @jonathandturner#34789)
bors
commented
May 7, 2017
☀️ Test successful - status-appveyor, status-travis |
Fix issue #41652. Don't print anything in
render_source_line()if no source code is given.(cc @jonathandturner#34789)