From 2db4259b3531e0cfa1f6df2ff95e30a4c871a105 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 30 Apr 2012 10:37:58 -0700 Subject: Stop inferring bot/static when types/regions are unconstrained. Also, some other changes that came up along the way: - add a 'blk' region for the current block. - detect unused type/region variables. --- src/librustsyntax/ast.rs | 6 +----- src/librustsyntax/parse/parser.rs | 11 +---------- src/librustsyntax/print/pprust.rs | 1 - 3 files changed, 2 insertions(+), 16 deletions(-) (limited to 'src/librustsyntax') diff --git a/src/librustsyntax/ast.rs b/src/librustsyntax/ast.rs index 48e8866d3f5..4a4b5ea4d38 100644 --- a/src/librustsyntax/ast.rs +++ b/src/librustsyntax/ast.rs @@ -452,11 +452,7 @@ enum prim_ty { type region = {id: node_id, node: region_}; #[auto_serialize] -enum region_ { - re_anon, - re_named(ident), - re_static -} +enum region_ { re_anon, re_named(ident) } #[auto_serialize] enum ty_ { diff --git a/src/librustsyntax/parse/parser.rs b/src/librustsyntax/parse/parser.rs index 890e59cbb14..0c681900dd5 100644 --- a/src/librustsyntax/parse/parser.rs +++ b/src/librustsyntax/parse/parser.rs @@ -250,16 +250,7 @@ fn parse_ret_ty(p: parser) -> (ast::ret_style, @ast::ty) { fn region_from_name(p: parser, s: option) -> @ast::region { let r = alt s { - some (string) { - // FIXME: To be consistent with our type resolution, the - // static region should probably be resolved during type - // checking, not in the parser. (Issue #2256) - if string == "static" { - ast::re_static - } else { - ast::re_named(string) - } - } + some (string) { ast::re_named(string) } none { ast::re_anon } }; diff --git a/src/librustsyntax/print/pprust.rs b/src/librustsyntax/print/pprust.rs index 6310a8b08a3..d67a2c822d0 100644 --- a/src/librustsyntax/print/pprust.rs +++ b/src/librustsyntax/print/pprust.rs @@ -329,7 +329,6 @@ fn print_native_mod(s: ps, nmod: ast::native_mod, attrs: [ast::attribute]) { fn print_region(s: ps, region: @ast::region) { alt region.node { ast::re_anon { word_space(s, "&"); } - ast::re_static { word_space(s, "&static"); } ast::re_named(name) { word(s.s, "&"); word_space(s, name); -- cgit 1.4.1-3-g733a5