-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Doc tests fail when a library is built with LTO #8660
Labels
C-bug
Category: bug
Comments
Ah, thank you! I should have searched closed issues first. I'll see if I can grab that fix for our distro toolchain. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
When a library is built with LTO enabled, doctests fail with linker errors, "file format not recognized".
This worked with Rust/Cargo 1.45.2, but fails with 1.46 through nightly. This might be a rustdoc issue instead, but I'm starting here because of the Cargo 1.46 changes in #8349.
In the example below, I turned on LTO in
profile.dev
, which I know is unusual. In practice, we saw this in a Fedora crate build that had LTO inprofile.release
. We alwaysbuild --release
for the distro, and then wetest --release
too so we don't build everything twice.Steps
Cargo.toml
:src/lib.rs
:Possible Solution(s)
Notes
Output of
cargo version
:The text was updated successfully, but these errors were encountered: