Skip to content

Commit

Permalink
Auto merge of #62181 - eddyb:syn-only-elision, r=<try>
Browse files Browse the repository at this point in the history
[WIP] rustc: temporarily disable non-syntactic elision.

This is only exists so we can do a quick crater check-only run, which we should've probably done a long time ago, but this behavior persisted undisturbed and unquestioned (possible for a good reason).

r? @nikomatsakis
  • Loading branch information
bors committed Jul 1, 2019
2 parents 6ea4036 + 4d81f33 commit 003a7b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/libcore/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ impl<P: Deref> Pin<P> {
/// ruled out by the contract of `Pin::new_unchecked`.
#[stable(feature = "pin", since = "1.33.0")]
#[inline(always)]
pub fn as_ref(self: &Pin<P>) -> Pin<&P::Target> {
pub fn as_ref(&self) -> Pin<&P::Target> {
unsafe { Pin::new_unchecked(&*self.pointer) }
}

Expand Down Expand Up @@ -570,7 +570,7 @@ impl<P: DerefMut> Pin<P> {
/// 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<P>) -> Pin<&mut P::Target> {
pub fn as_mut(&mut self) -> Pin<&mut P::Target> {
unsafe { Pin::new_unchecked(&mut *self.pointer) }
}

Expand All @@ -580,7 +580,7 @@ impl<P: DerefMut> Pin<P> {
/// 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<P>, value: P::Target)
pub fn set(&mut self, value: P::Target)
where
P::Target: Sized,
{
Expand All @@ -605,7 +605,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<U, F>(self: Pin<&'a T>, func: F) -> Pin<&'a U> where
pub unsafe fn map_unchecked<U, F>(self, func: F) -> Pin<&'a U> where
F: FnOnce(&T) -> &U,
{
let pointer = &*self.pointer;
Expand All @@ -632,7 +632,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
}
}
Expand All @@ -641,7 +641,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 }
}

Expand All @@ -656,7 +656,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
Expand All @@ -674,7 +674,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
}

Expand All @@ -694,7 +694,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<U, F>(self: Pin<&'a mut T>, func: F) -> Pin<&'a mut U> where
pub unsafe fn map_unchecked_mut<U, F>(self, func: F) -> Pin<&'a mut U> where
F: FnOnce(&mut T) -> &mut U,
{
let pointer = Pin::get_unchecked_mut(self);
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/middle/resolve_lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
_ => {}
}
Expand Down

0 comments on commit 003a7b6

Please sign in to comment.