From a8dd52ed3649d2dba3474a80254d1cc5180797f3 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Wed, 23 Nov 2011 10:30:07 +0100 Subject: [PATCH] Remove last traces of auth keyword The reference now has an empty hole where the auth keyword used to be. Changing the keyword table seems to require manually sorting the keywords and putting them back into some kind of arcane interleaved order. I'll open an issue to actually fix this. Closes #1211 --- doc/rust.texi | 2 +- src/comp/rustc.rc | 4 ---- src/comp/syntax/ast.rs | 3 --- src/comp/syntax/fold.rs | 1 - src/comp/syntax/parse/eval.rs | 1 - src/comp/syntax/parse/parser.rs | 13 ------------- src/comp/syntax/visit.rs | 1 - src/lib/std.rc | 19 ------------------- 8 files changed, 1 insertion(+), 43 deletions(-) diff --git a/doc/rust.texi b/doc/rust.texi index df9f85a9f813..050b76eb15fa 100644 --- a/doc/rust.texi +++ b/doc/rust.texi @@ -636,7 +636,7 @@ The keywords are: @tab @code{if} @tab @code{pure} @tab @code{uint} -@item @code{auth} +@item @code{} @tab @code{export} @tab @code{import} @tab @code{resource} diff --git a/src/comp/rustc.rc b/src/comp/rustc.rc index 8f8a14145139..238030621fe5 100644 --- a/src/comp/rustc.rc +++ b/src/comp/rustc.rc @@ -127,10 +127,6 @@ mod util { mod filesearch; } -auth middle::metadata = unsafe; -auth middle::trans = unsafe; -auth lib::llvm = unsafe; - mod lib { mod llvm; } diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs index 24bb3e8d68b3..dfebf9135fdf 100644 --- a/src/comp/syntax/ast.rs +++ b/src/comp/syntax/ast.rs @@ -62,7 +62,6 @@ tag crate_directive_ { cdir_dir_mod(ident, option::t, [@crate_directive], [attribute]); cdir_view_item(@view_item); cdir_syntax(path); - cdir_auth(path, _auth); } type crate_directive = spanned; @@ -101,8 +100,6 @@ tag mutability { mut; imm; maybe_mut; } tag kind { kind_sendable; kind_copyable; kind_noncopyable; } -tag _auth { auth_unsafe; } - tag proto_sugar { sugar_normal; sugar_sexy; diff --git a/src/comp/syntax/fold.rs b/src/comp/syntax/fold.rs index 0eab97481bc3..956f9e538f06 100644 --- a/src/comp/syntax/fold.rs +++ b/src/comp/syntax/fold.rs @@ -168,7 +168,6 @@ fn noop_fold_crate_directive(cd: crate_directive_, fld: ast_fold) -> } cdir_view_item(vi) { cdir_view_item(fld.fold_view_item(vi)) } cdir_syntax(_) { cd } - cdir_auth(_, _) { cd } } } diff --git a/src/comp/syntax/parse/eval.rs b/src/comp/syntax/parse/eval.rs index 7e1e93d5b70a..2c1c0155cf05 100644 --- a/src/comp/syntax/parse/eval.rs +++ b/src/comp/syntax/parse/eval.rs @@ -133,7 +133,6 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: str, } ast::cdir_view_item(vi) { view_items += [vi]; } ast::cdir_syntax(pth) { } - ast::cdir_auth(pth, eff) { } } } // diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 02d907aba8c8..35c1e1190d3e 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -2112,12 +2112,6 @@ fn parse_item_tag(p: parser, attrs: [ast::attribute]) -> @ast::item { ret mk_item(p, lo, hi, id, ast::item_tag(variants, ty_params), attrs); } -fn parse_auth(p: parser) -> ast::_auth { - if eat_word(p, "unsafe") { - ret ast::auth_unsafe; - } else { unexpected(p, p.peek()); } -} - fn parse_fn_item_proto(_p: parser) -> ast::proto { ast::proto_bare } @@ -2529,13 +2523,6 @@ fn parse_crate_directive(p: parser, first_outer_attr: [ast::attribute]) -> } t { unexpected(p, t); } } - } else if eat_word(p, "auth") { - let n = parse_path(p); - expect(p, token::EQ); - let a = parse_auth(p); - let hi = p.get_hi_pos(); - expect(p, token::SEMI); - ret spanned(lo, hi, ast::cdir_auth(n, a)); } else if is_view_item(p) { let vi = parse_view_item(p); ret spanned(lo, vi.span.hi, ast::cdir_view_item(vi)); diff --git a/src/comp/syntax/visit.rs b/src/comp/syntax/visit.rs index 48f5bd1329ff..7430c28b749f 100644 --- a/src/comp/syntax/visit.rs +++ b/src/comp/syntax/visit.rs @@ -64,7 +64,6 @@ fn visit_crate_directive(cd: @crate_directive, e: E, v: vt) { } cdir_view_item(vi) { v.visit_view_item(vi, e, v); } cdir_syntax(_) { } - cdir_auth(_, _) { } } } diff --git a/src/lib/std.rc b/src/lib/std.rc index ac15964c6fa8..1d1c69e7be4e 100644 --- a/src/lib/std.rc +++ b/src/lib/std.rc @@ -114,25 +114,6 @@ mod os = "linux_os.rs"; #[cfg(target_os = "linux")] mod os_fs = "posix_fs.rs"; - -// FIXME: This doesn't do anything. -// Authorize various rule-bendings. - -auth io = unsafe; -auth fs = unsafe; -auth os_fs = unsafe; -auth run = unsafe; -auth str = unsafe; -auth vec = unsafe; -auth task = unsafe; - -auth dbg = unsafe; - -auth uint::next_power_of_two = unsafe; -auth map::mk_hashmap = unsafe; -auth rand::mk_rng = unsafe; - - // Local Variables: // mode: rust; // fill-column: 78;