Closed
Description
Playground example: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=1ef166f9e2b31f3f4093728719de4efc
pub trait Test {
type Ref<'a> where Test: 'a;
}
impl<T, U> Test for (T,) {
type Ref<'a> = (&'a T,) where T: 'a;
}
impl<T, U> Test for (T, U) {
type Ref<'a> = (&'a T, &'a U) where T: 'a, U: 'a;
}
The above autoformats to:
pub trait Test {
type Ref<'a>
where
Test: 'a;
}
impl<T, U> Test for (T,) {
type Ref<'a> = (&'a T,) where T: 'a;
}
impl<T, U> Test for (T, U) {
type Ref<'a> = (&'a T, &'a U) where T: 'a, U: 'a;
}
You'll notice that the where
clauses for the impls aren't formatted at all, whereas I would expect:
pub trait Test {
type Ref<'a>
where
Test: 'a;
}
impl<T, U> Test for (T,) {
type Ref<'a> = (&'a T,)
where
T: 'a;
}
impl<T, U> Test for (T, U) {
type Ref<'a> = (&'a T, &'a U)
where
T: 'a,
U: 'a;
}