Skip to content

Commit 8ff18ac

Browse files
committed
libsyntax: "import" -> "use"
1 parent 3f92cf2 commit 8ff18ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+203
-208
lines changed

src/libsyntax/ast.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The Rust abstract syntax tree.
22

3-
import codemap::{span, filename};
4-
import std::serialization::{serializer,
3+
use codemap::{span, filename};
4+
use std::serialization::{serializer,
55
deserializer,
66
serialize_Option,
77
deserialize_Option,
@@ -17,7 +17,7 @@ import std::serialization::{serializer,
1717
deserialize_str,
1818
serialize_bool,
1919
deserialize_bool};
20-
import parse::token;
20+
use parse::token;
2121

2222
/* Note #1972 -- spans are serialized but not deserialized */
2323
fn serialize_span<S>(_s: S, _v: span) {

src/libsyntax/ast_map.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import std::map;
2-
import std::map::hashmap;
3-
import ast::*;
4-
import print::pprust;
5-
import ast_util::{path_to_ident, stmt_id};
6-
import diagnostic::span_handler;
7-
import parse::token::ident_interner;
1+
use std::map;
2+
use std::map::hashmap;
3+
use ast::*;
4+
use print::pprust;
5+
use ast_util::{path_to_ident, stmt_id};
6+
use diagnostic::span_handler;
7+
use parse::token::ident_interner;
88

99
enum path_elt {
1010
path_mod(ident),

src/libsyntax/ast_util.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import codemap::span;
2-
import ast::*;
1+
use codemap::span;
2+
use ast::*;
33

44
pure fn spanned<T>(lo: uint, hi: uint, +t: T) -> spanned<T> {
55
respan(mk_sp(lo, hi), t)

src/libsyntax/attr.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Functions dealing with attributes and meta_items
22

3-
import std::map;
4-
import std::map::hashmap;
5-
import either::Either;
6-
import diagnostic::span_handler;
7-
import ast_util::{spanned, dummy_spanned};
8-
import parse::comments::{doc_comment_style, strip_doc_comment_decoration};
3+
use std::map;
4+
use std::map::hashmap;
5+
use either::Either;
6+
use diagnostic::span_handler;
7+
use ast_util::{spanned, dummy_spanned};
8+
use parse::comments::{doc_comment_style, strip_doc_comment_decoration};
99

1010
// Constructors
1111
export mk_name_value_item_str;

src/libsyntax/codemap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dvec::DVec;
1+
use dvec::DVec;
22

33
export filename;
44
export filemap;

src/libsyntax/diagnostic.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import std::term;
2-
import io::WriterUtil;
3-
import codemap::span;
1+
use std::term;
2+
use io::WriterUtil;
3+
use codemap::span;
44

55
export emitter, emit;
66
export level, fatal, error, warning, note;

src/libsyntax/ext/auto_serialize.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ into the tree. This is intended to prevent us from inserting the same
6969
node twice.
7070
7171
*/
72-
import base::*;
73-
import codemap::span;
74-
import std::map;
75-
import std::map::hashmap;
72+
use base::*;
73+
use codemap::span;
74+
use std::map;
75+
use std::map::hashmap;
7676

7777
export expand;
7878

src/libsyntax/ext/base.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import std::map::hashmap;
2-
import parse::parser;
3-
import diagnostic::span_handler;
4-
import codemap::{codemap, span, expn_info, expanded_from};
5-
import std::map::str_hash;
1+
use std::map::hashmap;
2+
use parse::parser;
3+
use diagnostic::span_handler;
4+
use codemap::{codemap, span, expn_info, expanded_from};
5+
use std::map::str_hash;
66

77
// obsolete old-style #macro code:
88
//

src/libsyntax/ext/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import codemap::span;
2-
import base::ext_ctxt;
1+
use codemap::span;
2+
use base::ext_ctxt;
33

44
fn mk_expr(cx: ext_ctxt, sp: codemap::span, expr: ast::expr_) ->
55
@ast::expr {

src/libsyntax/ext/concat_idents.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import base::*;
1+
use base::*;
22

33
fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, arg: ast::mac_arg,
44
_body: ast::mac_body) -> @ast::expr {

src/libsyntax/ext/env.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* should all get sucked into either the compiler syntax extension plugin
55
* interface.
66
*/
7-
import base::*;
8-
import build::mk_uniq_str;
7+
use base::*;
8+
use build::mk_uniq_str;
99
export expand_syntax_ext;
1010

1111
fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, arg: ast::mac_arg,

src/libsyntax/ext/expand.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import std::map::hashmap;
1+
use std::map::hashmap;
22

3-
import ast::{crate, expr_, expr_mac, mac_invoc, mac_invoc_tt,
3+
use ast::{crate, expr_, expr_mac, mac_invoc, mac_invoc_tt,
44
tt_delim, tt_tok, item_mac};
5-
import fold::*;
6-
import ext::base::*;
7-
import ext::qquote::{qq_helper};
8-
import parse::{parser, parse_expr_from_source_str, new_parser_from_tt};
5+
use fold::*;
6+
use ext::base::*;
7+
use ext::qquote::{qq_helper};
8+
use parse::{parser, parse_expr_from_source_str, new_parser_from_tt};
99

1010

11-
import codemap::{span, expanded_from};
11+
use codemap::{span, expanded_from};
1212

1313
fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt,
1414
e: expr_, s: span, fld: ast_fold,

src/libsyntax/ext/fmt.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
* should all get sucked into either the standard library extfmt module or the
66
* compiler syntax extension plugin interface.
77
*/
8-
import extfmt::ct::*;
9-
import base::*;
10-
import codemap::span;
11-
import ext::build::*;
8+
use extfmt::ct::*;
9+
use base::*;
10+
use codemap::span;
11+
use ext::build::*;
1212
export expand_syntax_ext;
1313

1414
fn expand_syntax_ext(cx: ext_ctxt, sp: span, arg: ast::mac_arg,

src/libsyntax/ext/ident_to_str.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import base::*;
2-
import build::mk_uniq_str;
3-
import option;
1+
use base::*;
2+
use build::mk_uniq_str;
43

54
fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, arg: ast::mac_arg,
65
_body: ast::mac_body) -> @ast::expr {

src/libsyntax/ext/log_syntax.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import base::*;
2-
import io::WriterUtil;
1+
use base::*;
2+
use io::WriterUtil;
33

44
fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, tt: ~[ast::token_tree])
55
-> base::mac_result {

src/libsyntax/ext/pipes.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ FIXME (#3072) - This is still incomplete.
3333
3434
*/
3535

36-
import codemap::span;
37-
import ext::base::ext_ctxt;
38-
import ast::tt_delim;
39-
import parse::lexer::{new_tt_reader, reader};
40-
import parse::parser::{parser, SOURCE_FILE};
41-
import parse::common::parser_common;
36+
use codemap::span;
37+
use ext::base::ext_ctxt;
38+
use ast::tt_delim;
39+
use parse::lexer::{new_tt_reader, reader};
40+
use parse::parser::{parser, SOURCE_FILE};
41+
use parse::common::parser_common;
4242

43-
import pipes::parse_proto::proto_parser;
43+
use pipes::parse_proto::proto_parser;
4444

45-
import pipes::proto::{visit, protocol};
45+
use pipes::proto::{visit, protocol};
4646

4747
fn expand_proto(cx: ext_ctxt, _sp: span, id: ast::ident,
4848
tt: ~[ast::token_tree]) -> base::mac_result

src/libsyntax/ext/pipes/ast_builder.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
// To start with, it will be use dummy spans, but it might someday do
44
// something smarter.
55

6-
import ast::{ident, node_id};
7-
import ast_util::respan;
8-
import codemap::span;
9-
import ext::base::mk_ctxt;
6+
use ast::{ident, node_id};
7+
use ast_util::respan;
8+
use codemap::span;
9+
use ext::base::mk_ctxt;
1010

1111
// Transitional reexports so qquote can find the paths it is looking for
1212
mod syntax {

src/libsyntax/ext/pipes/check.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ that.
1919
2020
*/
2121

22-
import ext::base::ext_ctxt;
22+
use ext::base::ext_ctxt;
2323

24-
import proto::{state, protocol, next_state};
25-
import ast_builder::empty_span;
24+
use proto::{state, protocol, next_state};
25+
use ast_builder::empty_span;
2626

2727
impl ext_ctxt: proto::visitor<(), (), ()> {
2828
fn visit_proto(_proto: protocol,

src/libsyntax/ext/pipes/liveness.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ updating the states using rule (2) until there are no changes.
2727
2828
*/
2929

30-
import std::bitv::{Bitv};
30+
use std::bitv::{Bitv};
3131

32-
import ast_builder::empty_span;
32+
use ast_builder::empty_span;
3333

3434
fn analyze(proto: protocol, _cx: ext_ctxt) {
3535
debug!("initializing colive analysis");

src/libsyntax/ext/pipes/parse_proto.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Parsing pipes protocols from token trees.
22

3-
import parse::parser;
4-
import parse::token;
3+
use parse::parser;
4+
use parse::token;
55

6-
import pipec::*;
6+
use pipec::*;
77

88
trait proto_parser {
99
fn parse_proto(id: ~str) -> protocol;

src/libsyntax/ext/pipes/pipec.rs

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
// A protocol compiler for Rust.
22

3-
import to_str::ToStr;
3+
use to_str::ToStr;
44

5-
import dvec::DVec;
5+
use dvec::DVec;
66

7-
import ast::ident;
8-
import util::interner;
9-
import print::pprust;
10-
import pprust::{item_to_str, ty_to_str};
11-
import ext::base::{mk_ctxt, ext_ctxt};
12-
import parse;
13-
import parse::*;
14-
import proto::*;
7+
use ast::ident;
8+
use util::interner;
9+
use print::pprust;
10+
use pprust::{item_to_str, ty_to_str};
11+
use ext::base::{mk_ctxt, ext_ctxt};
12+
use parse::*;
13+
use proto::*;
1514

16-
import ast_builder::{append_types, path, empty_span};
15+
use ast_builder::{append_types, path, empty_span};
1716

1817
// Transitional reexports so qquote can find the paths it is looking for
1918
mod syntax {

src/libsyntax/ext/pipes/proto.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import to_str::ToStr;
2-
import dvec::DVec;
1+
use to_str::ToStr;
2+
use dvec::DVec;
33

4-
import ast_builder::{path, append_types};
4+
use ast_builder::{path, append_types};
55

66
enum direction { send, recv }
77

src/libsyntax/ext/qquote.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import ast::{crate, expr_, mac_invoc,
1+
use ast::{crate, expr_, mac_invoc,
22
mac_aq, mac_var};
3-
import parse::parser;
4-
import parse::parser::parse_from_source_str;
5-
import dvec::DVec;
6-
import parse::token::ident_interner;
3+
use parse::parser;
4+
use parse::parser::parse_from_source_str;
5+
use dvec::DVec;
6+
use parse::token::ident_interner;
77

8-
import fold::*;
9-
import visit::*;
10-
import ext::base::*;
11-
import ext::build::*;
12-
import print::*;
13-
import io::*;
8+
use fold::*;
9+
use visit::*;
10+
use ext::base::*;
11+
use ext::build::*;
12+
use print::*;
13+
use io::*;
1414

15-
import codemap::span;
15+
use codemap::span;
1616

1717
struct gather_item {
1818
lo: uint;

src/libsyntax/ext/simplext.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import codemap::span;
2-
import std::map::{hashmap, str_hash, uint_hash};
3-
import dvec::DVec;
1+
use codemap::span;
2+
use std::map::{hashmap, str_hash, uint_hash};
3+
use dvec::DVec;
44

5-
import base::*;
5+
use base::*;
66

7-
import fold::*;
8-
import ast_util::respan;
9-
import ast::{ident, path, ty, blk_, expr, expr_path,
7+
use fold::*;
8+
use ast_util::respan;
9+
use ast::{ident, path, ty, blk_, expr, expr_path,
1010
expr_vec, expr_mac, mac_invoc, node_id, expr_index};
1111

1212
export add_new_extension;

src/libsyntax/ext/source_util.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import base::*;
2-
import ast;
3-
import codemap::span;
4-
import print::pprust;
5-
import build::{mk_base_vec_e,mk_uint,mk_u8,mk_uniq_str};
1+
use base::*;
2+
use codemap::span;
3+
use print::pprust;
4+
use build::{mk_base_vec_e,mk_uint,mk_u8,mk_uniq_str};
65

76
export expand_line;
87
export expand_col;

src/libsyntax/ext/trace_macros.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import codemap::span;
2-
import ext::base::ext_ctxt;
3-
import ast::tt_delim;
4-
import parse::lexer::{new_tt_reader, reader};
5-
import parse::parser::{parser, SOURCE_FILE};
6-
import parse::common::parser_common;
1+
use codemap::span;
2+
use ext::base::ext_ctxt;
3+
use ast::tt_delim;
4+
use parse::lexer::{new_tt_reader, reader};
5+
use parse::parser::{parser, SOURCE_FILE};
6+
use parse::common::parser_common;
77

88
fn expand_trace_macros(cx: ext_ctxt, sp: span,
99
tt: ~[ast::token_tree]) -> base::mac_result

0 commit comments

Comments
 (0)