From 194e0a8294f8fc683202bf4028212f24a89dc557 Mon Sep 17 00:00:00 2001 From: Taylor Cramer Date: Wed, 18 Oct 2017 22:18:13 -0700 Subject: [PATCH] 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. --- src/libcore/convert.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index e815d72d36646..99e40a3628115 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -382,14 +382,6 @@ impl<'a, T: ?Sized, U: ?Sized> AsRef for &'a mut T where T: AsRef } } -// FIXME (#23442): replace the above impls for &/&mut with the following more general one: -// // As lifts over Deref -// impl AsRef for D where D::Target: AsRef { -// fn as_ref(&self) -> &U { -// self.deref().as_ref() -// } -// } - // AsMut lifts over &mut #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T: ?Sized, U: ?Sized> AsMut for &'a mut T where T: AsMut @@ -399,14 +391,6 @@ impl<'a, T: ?Sized, U: ?Sized> AsMut for &'a mut T where T: AsMut } } -// FIXME (#23442): replace the above impl for &mut with the following more general one: -// // AsMut lifts over DerefMut -// impl AsMut for D where D::Target: AsMut { -// fn as_mut(&mut self) -> &mut U { -// self.deref_mut().as_mut() -// } -// } - // From implies Into #[stable(feature = "rust1", since = "1.0.0")] impl Into for T where U: From