-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"constant evaluation error" points to nothing when crossing the crate boundary #38875
Comments
Same as #23898? |
@kennytm that looks like the underlying issue (non-constness) thanks! But this particular issue was meant to focus on the silly error message specifically. I assume that is easier to fix than the constness ;-) |
@nikomatsakis @jonathandturner So how do we get sources cross-crate? I'd love to just have the snippet to print instead of hiding it somehow. |
@eddyb so it does seem plausible to store where the sources were, I guess, and re-load them...but how do we know if they've changed in the interim? |
We could hash each file, perhaps? |
@eddyb yeah I suppose so. seems like a non-trivial PR in any case. |
Storing the place where the sources are won't help, since with |
My point is that they should be. Most linux distros have a notion of "debuginfo" packages and "debugsource" ones, with the former using paths installed by the latter. In NixOS you can just install the source of a package which is how the racer support works (in that case there is a hash in the path so it can only ever refer to one exact version of the files, so if we did hashing ourselves it'd always match). |
related only for examples. see: rust-lang/rust#38875
So, this example compiles successfully today. I'm failing at coming up with an example that doesn't... could someone comment with one? |
It has a non-blank error message, I assume you mean? With
It seems like it shouldn't have 11 The error is still misleading as-is. It points at the client's use of a It seems this issue is still valid. |
Now I'm very confused. I had it compiling fine... I thought. |
A bug has been discovered and fixed in the process.
Implement lazy loading of external crates' sources. Fixes #38875 Fixes #38875. This is a follow-up to #42507. When a (now correctly translated) span from an external crate is referenced in a error, warning or info message, we still don't have the source code being referenced. Since stuffing the source in the serialized metadata of an rlib is extremely wasteful, the following scheme has been implemented: * File maps now contain a source hash that gets serialized as well. * When a span is rendered in a message, the source hash in the corresponding file map(s) is used to try and load the source from the corresponding file on disk. If the file is not found or the hashes don't match, the failed attempt is recorded (and not retried). * The machinery fetching source lines from file maps is augmented to use the lazily loaded external source as a secondary fallback for file maps belonging to external crates. This required a small change to the expected stderr of one UI test (it now renders a span, where previously was none). Further work can be done based on this - some of the machinery previously used to hide external spans is possibly obsolete and the hashing code can be reused in different places as well. r? @eddyb
These error markers point to nothing, which is less than ideal. The
note
does at least help somewhat.src/lib.rs
examples/main.rs
Execute via
cargo build --example=main
rustc 1.14.0 (e8a012324 2016-12-16)
The text was updated successfully, but these errors were encountered: