Skip to content

Commit ac25a4a

Browse files
committed
rustc_trans: do not set NoCapture for anonymous lifetime &T arguments.
1 parent 417ffc9 commit ac25a4a

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/librustc_trans/abi.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,7 @@ impl<'a, 'tcx> FnType<'tcx> {
750750
Some(ty.boxed_ty())
751751
}
752752

753-
ty::TyRef(b, mt) => {
754-
use rustc::ty::{BrAnon, ReLateBound};
755-
753+
ty::TyRef(_, mt) => {
756754
// `&mut` pointer parameters never alias other parameters, or mutable global data
757755
//
758756
// `&T` where `T` contains no `UnsafeCell<U>` is immutable, and can be marked as
@@ -768,13 +766,6 @@ impl<'a, 'tcx> FnType<'tcx> {
768766
arg.attrs.set(ArgAttribute::ReadOnly);
769767
}
770768

771-
// When a reference in an argument has no named lifetime, it's
772-
// impossible for that reference to escape this function
773-
// (returned or stored beyond the call by a closure).
774-
if let ReLateBound(_, BrAnon(_)) = *b {
775-
arg.attrs.set(ArgAttribute::NoCapture);
776-
}
777-
778769
Some(mt.ty)
779770
}
780771
_ => None

0 commit comments

Comments
 (0)