fix fallout

looks like some mix of #18653 and `projection_must_outlive`, but
that needs to be investigated further (crater run?)
This commit is contained in:
Ariel Ben-Yehuda 2015-09-26 02:52:46 +03:00 committed by Ariel Ben-Yehuda
parent 603a75c8ea
commit ce70207250
5 changed files with 8 additions and 2 deletions

View File

@ -417,7 +417,9 @@ fn lift_to_tcx(&self, tcx: &ty::ctxt<'tcx>) -> Option<Self::Lifted> {
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for [T] {
type Lifted = Vec<T::Lifted>;
fn lift_to_tcx(&self, tcx: &ty::ctxt<'tcx>) -> Option<Self::Lifted> {
let mut result = Vec::with_capacity(self.len());
// type annotation needed to inform `projection_must_outlive`
let mut result : Vec<<T as Lift<'tcx>>::Lifted>
= Vec::with_capacity(self.len());
for x in self {
if let Some(value) = tcx.lift(x) {
result.push(value);

View File

@ -266,7 +266,8 @@ unsafe fn spawn_inner<'a, T: Send>(self, f: Box<FnBox() -> 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<UnsafeCell<Option<Result<T>>>>
= Arc::new(UnsafeCell::new(None));
let their_packet = my_packet.clone();
let main = move || {

View File

@ -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() {

View File

@ -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);

View File

@ -21,4 +21,5 @@ fn main() {
//~^ ERROR E0038
//~| ERROR E0038
//~| ERROR E0277
//~| WARNING E0038
}