diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-08-23 17:02:41 -0700 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-08-23 17:55:04 -0700 |
| commit | 5ccf8175a8ae5f6aaff30bb2330a5f05ec89028d (patch) | |
| tree | 6e1716b353995be25b059630cbea0d8570270887 /src/rustc | |
| parent | feca839b9bd1ca8f8dac2533e6d87c62b1c1a02d (diff) | |
| download | rust-5ccf8175a8ae5f6aaff30bb2330a5f05ec89028d.tar.gz rust-5ccf8175a8ae5f6aaff30bb2330a5f05ec89028d.zip | |
don't consider use of `@fn` to be region-param'd
Diffstat (limited to 'src/rustc')
| -rw-r--r-- | src/rustc/middle/region.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/rustc/middle/region.rs b/src/rustc/middle/region.rs index e9364e1762d..17d4eaa5984 100644 --- a/src/rustc/middle/region.rs +++ b/src/rustc/middle/region.rs @@ -655,6 +655,25 @@ fn determine_rp_in_ty(ty: @ast::ty, _ => {} } + // temporary hack: right now, fn() is short for &fn(), but @(fn()) + // is `@fn()`, so catch this and set anon_implies_rp to none in + // that case + match ty.node { + ast::ty_box(mt) | ast::ty_uniq(mt) => { + match mt.ty.node { + ast::ty_fn(ast::proto_bare, _, _) | + ast::ty_fn(ast::proto_block, _, _) => { + do cx.with(cx.item_id, false) { + visit_mt(mt, cx, visitor); + } + return; + } + _ => {} + } + } + _ => {} + } + match ty.node { ast::ty_box(mt) | ast::ty_uniq(mt) | ast::ty_vec(mt) | ast::ty_rptr(_, mt) | ast::ty_ptr(mt) => { |
