From bc4810d907deef00ea5bd0124272cfcab3975e3c Mon Sep 17 00:00:00 2001 From: Taylor Cramer Date: Sun, 15 Oct 2017 13:43:06 -0700 Subject: Fix impl Trait Lifetime Handling After this change, impl Trait existentials are desugared to a new `abstract type` definition paired with a set of lifetimes to apply. In-scope generics are included as parents of the `abstract type` generics. Parent regions are replaced with static, and parent regions referenced in the `impl Trait` type are duplicated at the end of the `abstract type`'s generics. --- src/test/ui/span/loan-extend.rs | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 src/test/ui/span/loan-extend.rs (limited to 'src/test/ui/span') diff --git a/src/test/ui/span/loan-extend.rs b/src/test/ui/span/loan-extend.rs deleted file mode 100644 index a4b951daab4..00000000000 --- a/src/test/ui/span/loan-extend.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(conservative_impl_trait)] - -// Helper creating a fake borrow, captured by the impl Trait. -fn borrow<'a, T>(_: &'a mut T) -> impl Copy { () } - -fn main() { - let long; - let mut short = 0; - long = borrow(&mut short); - //~^ NOTE borrow occurs here -} -//~^ ERROR `short` does not live long enough -//~| NOTE `short` dropped here while still borrowed -//~| NOTE values in a scope are dropped in the opposite order they are created -- cgit 1.4.1-3-g733a5