From 49c6dac47aa93d11b2d4c8deeded4626e23081e7 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 5 Jun 2012 15:50:46 -0700 Subject: [PATCH] rustc: Fix some more cyclic imports --- src/rustc/driver/rustc.rs | 3 ++- src/rustc/metadata/decoder.rs | 2 +- src/rustc/middle/tstate/auxiliary.rs | 5 ++--- src/rustc/middle/ty.rs | 6 +++--- src/rustc/middle/typeck/astconv.rs | 3 ++- src/rustc/middle/typeck/check.rs | 3 ++- src/rustc/util/ppaux.rs | 10 +++++++++- 7 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/rustc/driver/rustc.rs b/src/rustc/driver/rustc.rs index db185215bea..5e88df1de5e 100644 --- a/src/rustc/driver/rustc.rs +++ b/src/rustc/driver/rustc.rs @@ -15,7 +15,8 @@ import std::map::hashmap; import getopts::{opt_present}; import rustc::driver::driver::*; import syntax::codemap; -import rustc::driver::{diagnostic, session}; +import syntax::diagnostic; +import rustc::driver::session; import rustc::middle::lint; import io::reader_util; diff --git a/src/rustc/metadata/decoder.rs b/src/rustc/metadata/decoder.rs index 644d519fc0f..4df45033a77 100644 --- a/src/rustc/metadata/decoder.rs +++ b/src/rustc/metadata/decoder.rs @@ -7,7 +7,6 @@ import syntax::{ast, ast_util}; import syntax::attr; import middle::ty; import syntax::ast_map; -import common::*; import tydecode::{parse_ty_data, parse_def_id, parse_bounds_data, parse_ident}; import syntax::print::pprust; @@ -15,6 +14,7 @@ import cmd=cstore::crate_metadata; import util::ppaux::ty_to_str; import ebml::deserializer; import syntax::diagnostic::span_handler; +import common::*; export class_dtor; export get_class_fields; diff --git a/src/rustc/middle/tstate/auxiliary.rs b/src/rustc/middle/tstate/auxiliary.rs index c34953ac33e..a41812f72a7 100644 --- a/src/rustc/middle/tstate/auxiliary.rs +++ b/src/rustc/middle/tstate/auxiliary.rs @@ -13,9 +13,8 @@ import tstate::ann::{pre_and_post, pre_and_post_state, empty_ann, prestate, set_postcondition, ts_ann, clear_in_postcond, clear_in_poststate_}; -import tritv::*; -import bitvectors::promises_; import driver::session::session; +import tritv::{dont_care, tfalse, tritv_get, ttrue}; import syntax::print::pprust::{constr_args_to_str, lit_to_str}; @@ -811,7 +810,7 @@ fn copy_in_poststate_two(fcx: fn_ctxt, src_post: poststate, // dest def_id let insts = find_instances(fcx, subst, val); for insts.each {|p| - if promises_(p.from, src_post) { + if bitvectors::promises_(p.from, src_post) { set_in_poststate_(p.to, target_post); } } diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index 3b32bca1e5f..73f601cf4b0 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -4,19 +4,19 @@ import std::map::hashmap; import driver::session; import session::session; import syntax::{ast, ast_map}; -import syntax::ast::*; import syntax::ast_util; import syntax::ast_util::{is_local, local_def, split_class_items, new_def_hash}; import syntax::codemap::span; import metadata::csearch; -import util::common::*; import util::ppaux::region_to_str; import util::ppaux::vstore_to_str; import util::ppaux::{ty_to_str, tys_to_str, ty_constr_to_str}; -import syntax::print::pprust::*; import middle::lint::{get_warning_level, vecs_not_implicitly_copyable, ignore}; +import syntax::ast::*; +import syntax::print::pprust::*; + export ty_vid, region_vid, vid; export br_hashmap; export is_instantiable; diff --git a/src/rustc/middle/typeck/astconv.rs b/src/rustc/middle/typeck/astconv.rs index d8ce3d83a60..476ef9d3ba5 100644 --- a/src/rustc/middle/typeck/astconv.rs +++ b/src/rustc/middle/typeck/astconv.rs @@ -45,7 +45,8 @@ an rptr (`&r.T`) use the region `r` that appears in the rptr. "]; import check::fn_ctxt; -import rscope::*; +import rscope::{anon_rscope, binding_rscope, empty_rscope, in_anon_rscope}; +import rscope::{in_binding_rscope, region_scope, type_rscope}; iface ast_conv { fn tcx() -> ty::ctxt; diff --git a/src/rustc/middle/typeck/check.rs b/src/rustc/middle/typeck/check.rs index 2649dc6c675..70167192afc 100644 --- a/src/rustc/middle/typeck/check.rs +++ b/src/rustc/middle/typeck/check.rs @@ -71,7 +71,8 @@ import collect::{methods}; // ccx.to_ty() import method::{methods}; // methods for method::lookup import middle::ty::tys_in_fn_ty; import regionmanip::{replace_bound_regions_in_fn_ty, region_of}; -import rscope::*; +import rscope::{anon_rscope, binding_rscope, empty_rscope, in_anon_rscope}; +import rscope::{in_binding_rscope, region_scope, type_rscope}; type fn_ctxt = // var_bindings, locals and next_var_id are shared diff --git a/src/rustc/util/ppaux.rs b/src/rustc/util/ppaux.rs index 60f4ea8dabf..c5c445702d5 100644 --- a/src/rustc/util/ppaux.rs +++ b/src/rustc/util/ppaux.rs @@ -1,6 +1,14 @@ import std::map::hashmap; import middle::ty; -import middle::ty::*; +import middle::ty::{arg, bound_region, br_anon, br_named, canon_mode}; +import middle::ty::{ck_block, ck_box, ck_uniq, constr, ctxt, field, method}; +import middle::ty::{mt, re_bound, re_free, re_scope, re_var, region, t}; +import middle::ty::{ty_bool, ty_bot, ty_box, ty_class, ty_constr, ty_enum}; +import middle::ty::{ty_estr, ty_evec, ty_float, ty_fn, ty_iface, ty_int}; +import middle::ty::{ty_nil, ty_opaque_box, ty_opaque_closure_ptr, ty_param}; +import middle::ty::{ty_ptr, ty_rec, ty_res, ty_rptr, ty_self, ty_str, ty_tup}; +import middle::ty::{ty_type, ty_uniq, ty_uint, ty_var, ty_var_integral}; +import middle::ty::{ty_vec, vid}; import metadata::encoder; import syntax::codemap; import syntax::print::pprust;