-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
neondatabase/neon
#8142Labels
A-coherenceArea: CoherenceArea: CoherenceC-bugCategory: This is a bug.Category: This is a bug.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.disposition-closeThis PR / issue is in PFCP or FCP with a disposition to close it.This PR / issue is in PFCP or FCP with a disposition to close it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
Code
I tried this code:
https://github.com/conradludgate/measured/tree/b2978b32e2065cb6257244829b5fd6ae1dba4576
pub trait LabelGroupSet {
type Group<'a>: LabelGroup;
}
impl<T: LabelSet> LabelGroupSet for T
where
for<'a> T::Value<'a>: LabelGroup,
{
type Group<'a> = T::Value<'a>;
}
pub trait LabelSet {
type Value<'a>;
}
impl<T: LabelGroupSet + ?Sized> LabelGroupSet for &'static T {
type Group<'a> = T::Group<'a>;
}
pub trait LabelGroup {}
I expected to see this happen: compiles successfully
Instead, this happened:
error[E0119]: conflicting implementations of trait `LabelGroupSet` for type `&'static _`
--> core/src/label/value.rs:45:1
|
45 | / impl<T: LabelSet> LabelGroupSet for T
46 | | where
47 | | for<'a> T::Value<'a>: LabelGroup,
| |_____________________________________^ conflicting implementation for `&'static _`
|
::: core/src/label/group.rs:133:1
|
133 | impl<T: LabelGroupSet + ?Sized> LabelGroupSet for &'static T {
| ------------------------------------------------------------ first implementation here
|
= note: downstream crates may implement trait `label::value::LabelSet` for type `&'static _`
= note: downstream crates may implement trait `label::group::LabelGroup` for type `<&'static _ as label::value::LabelSet>::Value<'a>`
Version it worked on
It most recently worked on: nightly-2024-04-30
Version with regression
according to cargo-bisect-rustc, the regression started with nightly-2024-05-01
in #117164
Metadata
Metadata
Assignees
Labels
A-coherenceArea: CoherenceArea: CoherenceC-bugCategory: This is a bug.Category: This is a bug.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.disposition-closeThis PR / issue is in PFCP or FCP with a disposition to close it.This PR / issue is in PFCP or FCP with a disposition to close it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.