+1, would be particularly handy now that we have impl header lifetime elision.
EDIT
To elaborate, IHLE allowed us to do this:
- impl<'a> Add<u32> for &'a u32 {
+ impl Add<u32> for &u32 {
type Output = u32;
fn add(self, rhs: u32) -> u32 { *self + rhs }
}
With parameter aliases, we’d be able to do
- impl<'a> Add<&'a u32> for u32 {
+ impl Add<RHS @ &u32> for u32 {
type Output = u32;
- fn add(self, rhs: &'a u32) -> u32 { self + *rhs }
+ fn add(self, rhs: RHS) -> u32 { self + *rhs }
}
Which is in some ways even nicer, since it removes more uses of the lifetime than the first change did.