-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Solver is overzealous with fundamental impls in the standard library #157498
Copy link
Copy link
Open
Labels
A-coherenceArea: CoherenceArea: CoherenceC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-coherenceArea: CoherenceArea: CoherenceC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
More details in this zulip thread detailing the requirements to get
ToOwnedintocore: #t-libs > core::borrow::Cow (cowcore)Essentially, the impl in question is
impl From<Cow<'_, str>> for Box<dyn Error>, whereCowandErrorare both defined incore, butallocdefinesBox, which is marked fundamental.It allows this for
From<&str>interestingly enough, but notCow, presumably because it's not a primitive type.This definitely is totally fine under the orphan rule because
coreis a dependency ofalloc, and thus there would never be any scenario where a impl could be defined incore, even thoughBoxis fundamental.My guess is that this is a very low-priority bug to fix since this just blocks a change that needs larger stuff to be done first, but this feels like it could potentially show up in other ways if we're not careful, and is worth documenting.