Skip to content

Spurious attempt to load a crate resulting in "multiple rlib candidates for debug_unreachable found". #56590

Closed
@eddyb

Description

@eddyb

I've reduced a triggering example to this:

use a::A;
type B<'a, T> = C<&'a T>;

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).

cc @petrochenkov

Metadata

Metadata

Assignees

Labels

A-metadataArea: Crate metadataC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions