-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
instrument-coverage: try our best to not ICE #77992
Conversation
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
Note: I haven’t added any regression tests because my particular reproducer relies on environment (i.e. rustup toolchain having access to the standard library source code). I'm not too keen to figure out a way to fest this in some other way. |
cc @richkadel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Needs fmt I think, but other than that, if the tests still pass, this is probably a good change. Thanks! |
instrument-coverage was ICEing for me on some code, in particular code that had devirtualized paths from standard library. Instrument coverage probably has no bussiness dictating which paths are valid and which aren't so just feed it everything and whatever and let tooling deal with other stuff. For example, with this commit we can generate coverage hitpoints for these interesting paths: * `/rustc/.../library/core/lib.rs` – non-devirtualized path for libcore * `/home/.../src/library/core/lib.rs` – devirtualized version of above * `<inline asm>`, `<anon>` and many similar synthetic paths Even if those paths somehow get to the instrumentation pass, I'd much rather get hits for these weird paths and hope some of them work (as would be the case for devirtualized path to libcore), rather than have compilation fail entirely.
922d6de
to
8436cfe
Compare
r? @wesleywiser @bors r+ rollup Thanks @nagisa! |
📌 Commit 8436cfe has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#75209 (Suggest imports of unresolved macros) - rust-lang#77547 (stabilize union with 'ManuallyDrop' fields and 'impl Drop for Union') - rust-lang#77827 (Don't link to nightly primitives on stable channel) - rust-lang#77855 (resolve: further improvements to "try using the enum's variant" diagnostic) - rust-lang#77900 (Use fdatasync for File::sync_data on more OSes) - rust-lang#77925 (Suggest minimal subset features in `incomplete_features` lint) - rust-lang#77971 (Deny broken intra-doc links in linkchecker) - rust-lang#77991 (Bump backtrace-rs) - rust-lang#77992 (instrument-coverage: try our best to not ICE) - rust-lang#78013 (Fix sidebar scroll on mobile devices) Failed merges: r? `@ghost`
instrument-coverage was ICEing for me on some code, in particular code
that had devirtualized paths from standard library. Instrument coverage
probably has no bussiness dictating which paths are valid and which
aren't so just feed it everything and whatever and let tooling deal with
other stuff.
For example, with this commit we can generate coverage hitpoints for
these interesting paths:
/rustc/.../library/core/lib.rs
– non-devirtualized path for libcore/home/.../src/library/core/lib.rs
– devirtualized version of above<inline asm>
,<anon>
and many similar synthetic pathsEven if those paths somehow get to the instrumentation pass, I'd much
rather get hits for these weird paths and hope some of them work (as
would be the case for devirtualized path to libcore), rather than have
compilation fail entirely.