Skip to content

Commit 194e0a8

Browse files
committed
Remove unfixable AsRef FIXMEs.
A long time ago, FIXMEs were left to implement AsRef and AsRef for all types which implemented Deref and DerefMut. This wasn't done at the time because of #23442. Unfortunately, it's not possible to add these implementations backwards-compabily, since they can cause conflicting implementation overlaps.
1 parent a457e29 commit 194e0a8

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

src/libcore/convert.rs

-16
Original file line numberDiff line numberDiff line change
@@ -382,14 +382,6 @@ impl<'a, T: ?Sized, U: ?Sized> AsRef<U> for &'a mut T where T: AsRef<U>
382382
}
383383
}
384384

385-
// FIXME (#23442): replace the above impls for &/&mut with the following more general one:
386-
// // As lifts over Deref
387-
// impl<D: ?Sized + Deref, U: ?Sized> AsRef<U> for D where D::Target: AsRef<U> {
388-
// fn as_ref(&self) -> &U {
389-
// self.deref().as_ref()
390-
// }
391-
// }
392-
393385
// AsMut lifts over &mut
394386
#[stable(feature = "rust1", since = "1.0.0")]
395387
impl<'a, T: ?Sized, U: ?Sized> AsMut<U> for &'a mut T where T: AsMut<U>
@@ -399,14 +391,6 @@ impl<'a, T: ?Sized, U: ?Sized> AsMut<U> for &'a mut T where T: AsMut<U>
399391
}
400392
}
401393

402-
// FIXME (#23442): replace the above impl for &mut with the following more general one:
403-
// // AsMut lifts over DerefMut
404-
// impl<D: ?Sized + Deref, U: ?Sized> AsMut<U> for D where D::Target: AsMut<U> {
405-
// fn as_mut(&mut self) -> &mut U {
406-
// self.deref_mut().as_mut()
407-
// }
408-
// }
409-
410394
// From implies Into
411395
#[stable(feature = "rust1", since = "1.0.0")]
412396
impl<T, U> Into<U> for T where U: From<T>

0 commit comments

Comments
 (0)