diff options
author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2017-10-05 01:02:25 +0300 |
---|---|---|
committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2017-10-05 01:06:14 +0300 |
commit | ac25a4ac329a083a9693fe5d9d1600024db9b35c (patch) | |
tree | 45e099cfc20e8a71118eaef4ebb9aef004bbed43 | |
parent | 417ffc98dfc770c27f7f2d7430f0edf975576591 (diff) | |
download | rust-ac25a4ac329a083a9693fe5d9d1600024db9b35c.tar.gz |
rustc_trans: do not set NoCapture for anonymous lifetime &T arguments.
-rw-r--r-- | src/librustc_trans/abi.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/librustc_trans/abi.rs b/src/librustc_trans/abi.rs index 2aecc016a5c..1f72ae849e6 100644 --- a/src/librustc_trans/abi.rs +++ b/src/librustc_trans/abi.rs @@ -750,9 +750,7 @@ impl<'a, 'tcx> FnType<'tcx> { Some(ty.boxed_ty()) } - ty::TyRef(b, mt) => { - use rustc::ty::{BrAnon, ReLateBound}; - + ty::TyRef(_, mt) => { // `&mut` pointer parameters never alias other parameters, or mutable global data // // `&T` where `T` contains no `UnsafeCell<U>` is immutable, and can be marked as @@ -768,13 +766,6 @@ impl<'a, 'tcx> FnType<'tcx> { arg.attrs.set(ArgAttribute::ReadOnly); } - // When a reference in an argument has no named lifetime, it's - // impossible for that reference to escape this function - // (returned or stored beyond the call by a closure). - if let ReLateBound(_, BrAnon(_)) = *b { - arg.attrs.set(ArgAttribute::NoCapture); - } - Some(mt.ty) } _ => None |