You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spurious attempt to load a crate resulting in "multiple rlib candidates for debug_unreachable found". #56590
Producing (on playground, in Rust 2018 mode, only on nightly):
error[E0465]: multiple rlib candidates for `debug_unreachable` found
|
note: candidate #1: /playground/target/debug/deps/libdebug_unreachable-dc2ba43f474707f3.rlib
note: candidate #2: /playground/target/debug/deps/libdebug_unreachable-fedb7fe62f71c3f0.rlib
The names in the testcase appear to not matter, but I can't figure out why both a lifetime and a type parameter need to be present, or any of the other details.
My guess this is from the rustc_resolve speculative loading of crates, to give better suggestions, which I must've not made foolproof (I thought I made all the errors lazy, but maybe this from a different spot that I missed).
Crate loading is certainly not fully speculative, at leas with regards to non-existent paths (#55103), so it's possible that some other errors are also reported eagerly.
use std::rc::Rc;structWat(Rc<Derp>);fnmain(){letmut b:[i32;10] = Default::default();}
Compiling repro v0.1.0 (/private/tmp/r)
error[E0465]: multiple rlib candidates for `debug_unreachable` found
|
note: candidate #1: /private/tmp/r/target/debug/deps/libdebug_unreachable-9846113be7cd0a2b.rlib
note: candidate #2: /private/tmp/r/target/debug/deps/libdebug_unreachable-843675cb387b3fdc.rlib
error[E0412]: cannot find type `Derp` in this scope
--> src/main.rs:3:15
|
3 | struct Wat(Rc<Derp>);
| ^^^^ not found in this scope
Of interest is that edition = "2018" is required to trigger the error
The code example in #56590 (comment) still fails on nightly as well, but in Release mode only, while some examples from other comments fail in Debug only, and finally there are also examples (such as Shep's) failing in both Debug and Release.
Activity
petrochenkov commentedon Dec 7, 2018
Crate loading is certainly not fully speculative, at leas with regards to non-existent paths (#55103), so it's possible that some other errors are also reported eagerly.
Arnavion commentedon Dec 30, 2018
This appears to be fixed in nightly, but the original issue is now in beta.
Edit: Actually, using the non-existent import does still trigger the bug on nightly.
playground
shepmaster commentedon Dec 30, 2018
And stable 1.31.1
shepmaster commentedon Mar 16, 2019
Stable (1.33.0), Beta (1.34.0-beta1), and Nightly (1.35.0-nightly 2019-03-14 bc44841) all continue to experience this problem.
Here's an example that reproduces the problem:
Of interest is that
edition = "2018"is required to trigger the errorjethrogb commentedon Mar 28, 2019
This is now on stable, but it appears fixed on nightly
shepmaster commentedon Mar 28, 2019
My code example continues to have the error in nightly on the playground.
lqd commentedon Mar 29, 2019
The code example in #56590 (comment) still fails on nightly as well, but in Release mode only, while some examples from other comments fail in Debug only, and finally there are also examples (such as Shep's) failing in both Debug and Release.
geraldarthurdavis commentedon Mar 20, 2020
Is there a known workaround for this? I am still seeing this issue with 1.44.0-nightly.
petrochenkov commentedon Jul 5, 2020
Fixed in #74071.
Rollup merge of rust-lang#74071 - petrochenkov:cload3, r=matthewjasper
rust-timer simulated merge of 43ba840