Skip to content

Commit b8ed136

Browse files
committed
Address review
1 parent 7febdb7 commit b8ed136

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/librustc/middle/trans/base.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ fn get_extern_rust_fn(ccx: &CrateContext, inputs: &[ty::t], output: ty::t,
246246
pub fn decl_rust_fn(ccx: &CrateContext, has_env: bool,
247247
inputs: &[ty::t], output: ty::t,
248248
name: &str) -> ValueRef {
249-
use middle::ty::{FreeRegion, BrAnon, ReFree, ReLateBound};
249+
use middle::ty::{BrAnon, ReLateBound};
250+
250251
let llfty = type_of_rust_fn(ccx, has_env, inputs, output);
251252
let llfn = decl_cdecl_fn(ccx.llmod, name, llfty, output);
252253

@@ -270,8 +271,7 @@ pub fn decl_rust_fn(ccx: &CrateContext, has_env: bool,
270271
// When a reference in an argument has no named lifetime, it's
271272
// impossible for that reference to escape this function(ie, be
272273
// returned).
273-
ty::ty_rptr(ReFree(FreeRegion { scope_id: _, bound_region: BrAnon(_) }), _) |
274-
ty::ty_rptr(ReLateBound(_, BrAnon(_)), _) => {
274+
ty::ty_rptr(ReLateBound(_, BrAnon(_)), _) => {
275275
debug!("marking argument of {} as nocapture because of anonymous lifetime", name);
276276
unsafe {
277277
llvm::LLVMAddAttribute(llarg, lib::llvm::NoCaptureAttribute as c_uint);

src/librustc/middle/trans/callee.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,9 @@ pub fn trans_call_inner<'a>(
708708

709709
debug!("trans_callee_inner: first_arg_offset={}", first_arg_offset);
710710

711-
for (idx, &t) in ty::ty_fn_args(callee_ty).iter().enumerate().map(|(i, v)| (i+first_arg_offset, v)) {
712-
use middle::ty::{FreeRegion, BrAnon, ReFree, ReLateBound};
711+
for (idx, &t) in ty::ty_fn_args(callee_ty).iter().enumerate()
712+
.map(|(i, v)| (i+first_arg_offset, v)) {
713+
use middle::ty::{BrAnon, ReLateBound};
713714
if !type_is_immediate(ccx, t) {
714715
// if it's not immediate, we have a program-invisible pointer,
715716
// which it can't possibly capture
@@ -720,10 +721,9 @@ pub fn trans_call_inner<'a>(
720721

721722
let t_ = ty::get(t);
722723
match t_.sty {
723-
ty::ty_rptr(ReFree(FreeRegion { scope_id: _, bound_region: BrAnon(_) }), _) |
724-
ty::ty_rptr(ReLateBound(_, BrAnon(_)), _) => {
725-
726-
debug!("trans_callee_inner: argument {} nocapture because of anonymous lifetime", idx);
724+
ty::ty_rptr(ReLateBound(_, BrAnon(_)), _) => {
725+
debug!("trans_callee_inner: argument {} nocapture because \
726+
of anonymous lifetime", idx);
727727
attrs.push((idx, NoCaptureAttribute));
728728
},
729729
_ => { }

0 commit comments

Comments
 (0)