change region inference to not consider & that appears in a fn
type as indicating region parameterization
This commit is contained in:
parent
2407373fa4
commit
638491712e
@ -485,7 +485,16 @@ fn determine_rp_in_ty(ty: @ast::ty,
|
||||
_ {}
|
||||
}
|
||||
|
||||
visit::visit_ty(ty, cx, visitor);
|
||||
alt ty.node {
|
||||
ast::ty_fn(*) => {
|
||||
do cx.with(cx.item_id, false) {
|
||||
visit::visit_ty(ty, cx, visitor);
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
visit::visit_ty(ty, cx, visitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn determine_rp_in_crate(sess: session,
|
||||
|
@ -0,0 +1,9 @@
|
||||
|
||||
// check that the &int here does not cause us to think that `foo`
|
||||
// contains region pointers
|
||||
enum foo = fn~(x: &int);
|
||||
|
||||
fn take_foo(x: foo/&) {} //~ ERROR no region bound is allowed on `foo`
|
||||
|
||||
fn main() {
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user