Open
Description
Given
#![feature(associated_const_equality)]
use std::marker::Unpin; // or any other auto trait
pub struct Outer<T>(Inner<T>);
pub struct Inner<T>(T);
// (A)
impl<const F: bool, T: Trait<FLAG = {F}>> Unpin for Inner<T> {}
// (B)
//impl<T: Trait<FLAG = true>> Unpin for Inner<T> {}
pub trait Trait {
const FLAG: bool;
}
the impl of Unpin
(or any other auto trait chosen) synthesized for the generic type Outer
looks like
impl<T> !Unpin for Outer<T> // for either case, (A) or (B)
// ^ note the `!`
while I expected the impls to be
// for case (A):
impl<T> Unpin for Outer<T> where T: Trait
// for case (B):
impl<T> Unpin for Outer<T> where T: Trait<FLAG = true>
For comparison, the analog involving type equality constraints
use std::marker::Unpin; // or any other auto trait
pub struct Outer<T>(Inner<T>);
pub struct Inner<T>(T);
// (A)
impl<F: Bool, T: Trait<Flag = F>> Unpin for Inner<T> {}
// ---> synthetic impl:
// impl<T> Unpin for Outer<T> where T: Trait
// (B)
// impl<T: Trait<Flag = True>> Unpin for Inner<T> {}
// ---> synthetic impl:
// impl<T> Unpin for Outer<T> where T: Trait<Flag = True>
pub trait Trait {
type Flag: Bool;
}
pub trait Bool {}
impl Bool for True {}
pub enum True {}
(adding T-compiler next to T-rustdoc since AutoTraitFinder
lives in rustc
)
@rustbot label C-bug T-rustdoc T-compiler A-auto-traits A-synthetic-impls F-associated_const_equality
Metadata
Metadata
Assignees
Labels
Area: auto traits (e.g., `auto trait Send {}`)Area: Synthetic impls, used by rustdoc to document auto traits and traits with blanket implsCategory: This is a bug.`#![feature(associated_const_equality)]`Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Projects
Status
Can Do