From 439afaa329751b3dfd6735862cd2645705598909 Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Tue, 31 Jul 2012 10:27:51 -0700 Subject: Change remaining "iface" occurrences to "trait"; deprecate "iface" --- src/libsyntax/diagnostic.rs | 4 ++-- src/libsyntax/ext/base.rs | 2 +- src/libsyntax/ext/pipes/pipec.rs | 2 +- src/libsyntax/ext/qquote.rs | 2 +- src/libsyntax/fold.rs | 2 +- src/libsyntax/parse/lexer.rs | 2 +- src/libsyntax/parse/parser.rs | 1 + src/libsyntax/print/pprust.rs | 2 +- src/libsyntax/util/interner.rs | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 4a6935f7fc8..d9292afc96a 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -13,7 +13,7 @@ type emitter = fn@(cmsp: option<(codemap::codemap, span)>, msg: ~str, lvl: level); -iface span_handler { +trait span_handler { fn span_fatal(sp: span, msg: ~str) -> !; fn span_err(sp: span, msg: ~str); fn span_warn(sp: span, msg: ~str); @@ -23,7 +23,7 @@ iface span_handler { fn handler() -> handler; } -iface handler { +trait handler { fn fatal(msg: ~str) -> !; fn err(msg: ~str); fn bump_err_count(); diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index c6889eb9c1d..a51bc8a994c 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -114,7 +114,7 @@ fn syntax_expander_table() -> hashmap<~str, syntax_extension> { // One of these is made during expansion and incrementally updated as we go; // when a macro expansion occurs, the resulting nodes have the backtrace() // -> expn_info of their expansion context stored into their span. -iface ext_ctxt { +trait ext_ctxt { fn codemap() -> codemap; fn parse_sess() -> parse::parse_sess; fn cfg() -> ast::crate_cfg; diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index 32df5ed472a..00fd5d41f93 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -383,7 +383,7 @@ impl compile of gen_init for protocol { } } -iface to_source { +trait to_source { // Takes a thing and generates a string containing rust code for it. fn to_source() -> ~str; } diff --git a/src/libsyntax/ext/qquote.rs b/src/libsyntax/ext/qquote.rs index c027963cefa..9dcb4da14fa 100644 --- a/src/libsyntax/ext/qquote.rs +++ b/src/libsyntax/ext/qquote.rs @@ -22,7 +22,7 @@ enum fragment { from_ty(@ast::ty) } -iface qq_helper { +trait qq_helper { fn span() -> span; fn visit(aq_ctxt, vt); fn extract_mac() -> option; diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index d1fea34513b..dd051564cf4 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -18,7 +18,7 @@ export fold_ty_params; export fold_fn_decl; export extensions; -iface ast_fold { +trait ast_fold { fn fold_crate(crate) -> crate; fn fold_crate_directive(&&@crate_directive) -> @crate_directive; fn fold_view_item(&&@view_item) -> @view_item; diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index f14dd7df9d2..5a343f370f3 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -9,7 +9,7 @@ export tt_reader, new_tt_reader; export nextch, is_eof, bump, get_str_from, new_low_level_string_reader; export string_reader_as_reader, tt_reader_as_reader; -iface reader { +trait reader { fn is_eof() -> bool; fn next_token() -> {tok: token::token, sp: span}; fn fatal(~str) -> !; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 594ec844bd3..17370628db9 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2702,6 +2702,7 @@ class parser { } else if self.eat_keyword(~"enum") { self.parse_item_enum(vis) } else if self.eat_keyword(~"iface") { + self.warn(~"`iface` is deprecated; use `trait`"); self.parse_item_trait() } else if self.eat_keyword(~"trait") { self.parse_item_trait() diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index cf97bd7c692..a169c4e7256 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -588,7 +588,7 @@ fn print_item(s: ps, &&item: @ast::item) { bclose(s, item.span); } ast::item_trait(tps, methods) { - head(s, ~"iface"); + head(s, ~"trait"); word(s.s, *item.ident); print_type_params(s, tps); word(s.s, ~" "); diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index b6320b4f9cb..4886b903d73 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -19,7 +19,7 @@ fn mk(hasher: hashfn, eqer: eqfn) -> interner { } /* when traits can extend traits, we should extend index to get [] */ -iface interner { +trait interner { fn intern(T) -> uint; pure fn get(uint) -> T; fn len() -> uint; -- cgit 1.4.1-3-g733a5