From cef348595b8a5e5eafeae32207d539af861310c2 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Thu, 27 Jun 2019 16:18:46 +0300 Subject: [PATCH 1/2] [HACK] rustc: temporarily disable non-syntactic elision. --- src/librustc/middle/resolve_lifetime.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 412346bab257e..bb296a3cb4d7f 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -2136,7 +2136,8 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { | Res::Def(DefKind::Union, _) | Res::Def(DefKind::Enum, _) | Res::PrimTy(_) => { - return res == path.res + // HACK(eddyb) temporarily disable non-syntactic elision. + return res == path.res && false; } _ => {} } From 4d81f33f893c873d0ef2a045dd07555c7ffe5e52 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Thu, 27 Jun 2019 16:19:16 +0300 Subject: [PATCH 2/2] core: use `self`, `&self` and `&mut self` instead of `self: ...` forms. --- src/libcore/pin.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libcore/pin.rs b/src/libcore/pin.rs index c5247e134c86a..a4fe34cb9f27b 100644 --- a/src/libcore/pin.rs +++ b/src/libcore/pin.rs @@ -444,7 +444,7 @@ impl Pin

{ /// ruled out by the contract of `Pin::new_unchecked`. #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] - pub fn as_ref(self: &Pin

) -> Pin<&P::Target> { + pub fn as_ref(&self) -> Pin<&P::Target> { unsafe { Pin::new_unchecked(&*self.pointer) } } @@ -481,7 +481,7 @@ impl Pin

{ /// ruled out by the contract of `Pin::new_unchecked`. #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] - pub fn as_mut(self: &mut Pin

) -> Pin<&mut P::Target> { + pub fn as_mut(&mut self) -> Pin<&mut P::Target> { unsafe { Pin::new_unchecked(&mut *self.pointer) } } @@ -491,7 +491,7 @@ impl Pin

{ /// run before being overwritten, so no pinning guarantee is violated. #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] - pub fn set(self: &mut Pin

, value: P::Target) + pub fn set(&mut self, value: P::Target) where P::Target: Sized, { @@ -516,7 +516,7 @@ impl<'a, T: ?Sized> Pin<&'a T> { /// /// [`pin` module]: ../../std/pin/index.html#projections-and-structural-pinning #[stable(feature = "pin", since = "1.33.0")] - pub unsafe fn map_unchecked(self: Pin<&'a T>, func: F) -> Pin<&'a U> where + pub unsafe fn map_unchecked(self, func: F) -> Pin<&'a U> where F: FnOnce(&T) -> &U, { let pointer = &*self.pointer; @@ -543,7 +543,7 @@ impl<'a, T: ?Sized> Pin<&'a T> { /// ["pinning projections"]: ../../std/pin/index.html#projections-and-structural-pinning #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] - pub fn get_ref(self: Pin<&'a T>) -> &'a T { + pub fn get_ref(self) -> &'a T { self.pointer } } @@ -552,7 +552,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> { /// Converts this `Pin<&mut T>` into a `Pin<&T>` with the same lifetime. #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] - pub fn into_ref(self: Pin<&'a mut T>) -> Pin<&'a T> { + pub fn into_ref(self) -> Pin<&'a T> { Pin { pointer: self.pointer } } @@ -567,7 +567,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> { /// with the same lifetime as the original `Pin`. #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] - pub fn get_mut(self: Pin<&'a mut T>) -> &'a mut T + pub fn get_mut(self) -> &'a mut T where T: Unpin, { self.pointer @@ -585,7 +585,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> { /// instead. #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] - pub unsafe fn get_unchecked_mut(self: Pin<&'a mut T>) -> &'a mut T { + pub unsafe fn get_unchecked_mut(self) -> &'a mut T { self.pointer } @@ -605,7 +605,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> { /// /// [`pin` module]: ../../std/pin/index.html#projections-and-structural-pinning #[stable(feature = "pin", since = "1.33.0")] - pub unsafe fn map_unchecked_mut(self: Pin<&'a mut T>, func: F) -> Pin<&'a mut U> where + pub unsafe fn map_unchecked_mut(self, func: F) -> Pin<&'a mut U> where F: FnOnce(&mut T) -> &mut U, { let pointer = Pin::get_unchecked_mut(self);