From ce70207250cf4397211939153826d6959f1133fa Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Sat, 26 Sep 2015 02:52:46 +0300 Subject: [PATCH] fix fallout looks like some mix of #18653 and `projection_must_outlive`, but that needs to be investigated further (crater run?) --- src/librustc/middle/ty/structural_impls.rs | 4 +++- src/libstd/thread/mod.rs | 3 ++- src/test/compile-fail/issue-18959.rs | 1 + src/test/compile-fail/object-safety-issue-22040.rs | 1 + src/test/compile-fail/trait-test-2.rs | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/librustc/middle/ty/structural_impls.rs b/src/librustc/middle/ty/structural_impls.rs index 4ed87e673d9..176dc5a743d 100644 --- a/src/librustc/middle/ty/structural_impls.rs +++ b/src/librustc/middle/ty/structural_impls.rs @@ -417,7 +417,9 @@ fn lift_to_tcx(&self, tcx: &ty::ctxt<'tcx>) -> Option { impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for [T] { type Lifted = Vec; fn lift_to_tcx(&self, tcx: &ty::ctxt<'tcx>) -> Option { - let mut result = Vec::with_capacity(self.len()); + // type annotation needed to inform `projection_must_outlive` + let mut result : Vec<>::Lifted> + = Vec::with_capacity(self.len()); for x in self { if let Some(value) = tcx.lift(x) { result.push(value); diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 43c23ec8a47..134b1ce16e2 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -266,7 +266,8 @@ unsafe fn spawn_inner<'a, T: Send>(self, f: Box T + Send + 'a>) let my_thread = Thread::new(name); let their_thread = my_thread.clone(); - let my_packet = Arc::new(UnsafeCell::new(None)); + let my_packet : Arc>>> + = Arc::new(UnsafeCell::new(None)); let their_packet = my_packet.clone(); let main = move || { diff --git a/src/test/compile-fail/issue-18959.rs b/src/test/compile-fail/issue-18959.rs index 95176da9020..5f6216a898a 100644 --- a/src/test/compile-fail/issue-18959.rs +++ b/src/test/compile-fail/issue-18959.rs @@ -22,6 +22,7 @@ fn foo(b: &Bar) { b.foo(&0) //~^ ERROR the trait `Foo` is not implemented for the type `Bar` //~| ERROR E0038 + //~| WARNING E0038 } fn main() { diff --git a/src/test/compile-fail/object-safety-issue-22040.rs b/src/test/compile-fail/object-safety-issue-22040.rs index 12407f06ca0..06d2441d3c0 100644 --- a/src/test/compile-fail/object-safety-issue-22040.rs +++ b/src/test/compile-fail/object-safety-issue-22040.rs @@ -26,6 +26,7 @@ struct SExpr<'x> { impl<'x> PartialEq for SExpr<'x> { fn eq(&self, other:&SExpr<'x>) -> bool { println!("L1: {} L2: {}", self.elements.len(), other.elements.len()); + let result = self.elements.len() == other.elements.len(); println!("Got compare {}", result); diff --git a/src/test/compile-fail/trait-test-2.rs b/src/test/compile-fail/trait-test-2.rs index b11cbde2929..13fe314fbcd 100644 --- a/src/test/compile-fail/trait-test-2.rs +++ b/src/test/compile-fail/trait-test-2.rs @@ -21,4 +21,5 @@ fn main() { //~^ ERROR E0038 //~| ERROR E0038 //~| ERROR E0277 + //~| WARNING E0038 }