Skip to content

Commit a51fae0

Browse files
committed
auto merge of #6937 : msullivan/rust/no-warnings, r=bstrie
2 parents 0e96369 + 8bbf83b commit a51fae0

File tree

20 files changed

+56
-65
lines changed

20 files changed

+56
-65
lines changed

src/libextra/sync.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use core::prelude::*;
1919

2020
use core::borrow;
2121
use core::comm;
22-
use core::ptr;
2322
use core::task;
2423
use core::unstable::sync::{Exclusive, exclusive};
2524
use core::util;

src/librustc/metadata/creader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ fn resolve_crate_deps(e: @mut Env, cdata: @~[u8]) -> cstore::cnum_map {
303303
// The map from crate numbers in the crate we're resolving to local crate
304304
// numbers
305305
let mut cnum_map = HashMap::new();
306-
for decoder::get_crate_deps(e.intr, cdata).each |dep| {
306+
for decoder::get_crate_deps(cdata).each |dep| {
307307
let extrn_cnum = dep.cnum;
308308
let cname = dep.name;
309309
let cname_str = token::ident_to_str(&dep.name);

src/librustc/metadata/csearch.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub fn each_path(cstore: @mut cstore::CStore,
6969
pub fn get_item_path(tcx: ty::ctxt, def: ast::def_id) -> ast_map::path {
7070
let cstore = tcx.cstore;
7171
let cdata = cstore::get_crate_data(cstore, def.crate);
72-
let path = decoder::get_item_path(cstore.intr, cdata, def.node);
72+
let path = decoder::get_item_path(cdata, def.node);
7373

7474
// FIXME #1920: This path is not always correct if the crate is not linked
7575
// into the root namespace.
@@ -91,7 +91,7 @@ pub fn maybe_get_item_ast(tcx: ty::ctxt, def: ast::def_id,
9191
-> found_ast {
9292
let cstore = tcx.cstore;
9393
let cdata = cstore::get_crate_data(cstore, def.crate);
94-
decoder::maybe_get_item_ast(cstore.intr, cdata, tcx, def.node,
94+
decoder::maybe_get_item_ast(cdata, tcx, def.node,
9595
decode_inlined_item)
9696
}
9797

@@ -149,7 +149,7 @@ pub fn get_supertraits(tcx: ty::ctxt, def: ast::def_id) -> ~[@ty::TraitRef] {
149149
pub fn get_type_name_if_impl(cstore: @mut cstore::CStore, def: ast::def_id)
150150
-> Option<ast::ident> {
151151
let cdata = cstore::get_crate_data(cstore, def.crate);
152-
decoder::get_type_name_if_impl(cstore.intr, cdata, def.node)
152+
decoder::get_type_name_if_impl(cdata, def.node)
153153
}
154154

155155
pub fn get_static_methods_if_impl(cstore: @mut cstore::CStore,

src/librustc/metadata/decoder.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ fn enum_variant_ids(item: ebml::Doc, cdata: cmd) -> ~[ast::def_id] {
288288
return ids;
289289
}
290290

291-
fn item_path(intr: @ident_interner, item_doc: ebml::Doc) -> ast_map::path {
291+
fn item_path(item_doc: ebml::Doc) -> ast_map::path {
292292
let path_doc = reader::get_doc(item_doc, tag_path);
293293

294294
let len_doc = reader::get_doc(path_doc, tag_path_len);
@@ -491,7 +491,7 @@ pub fn _each_path(intr: @ident_interner,
491491
for reader::tagged_docs(items_data, tag_items_data_item) |item_doc| {
492492
if !broken {
493493
let path = ast_map::path_to_str_with_sep(
494-
item_path(intr, item_doc), ~"::", intr);
494+
item_path(item_doc), "::", intr);
495495
let path_is_empty = path.is_empty();
496496
if !path_is_empty {
497497
// Extract the def ID.
@@ -575,9 +575,9 @@ pub fn each_path(intr: @ident_interner,
575575
_each_path(intr, cdata, get_crate_data, f)
576576
}
577577

578-
pub fn get_item_path(intr: @ident_interner, cdata: cmd, id: ast::node_id)
578+
pub fn get_item_path(cdata: cmd, id: ast::node_id)
579579
-> ast_map::path {
580-
item_path(intr, lookup_item(id, cdata.data))
580+
item_path(lookup_item(id, cdata.data))
581581
}
582582

583583
pub type decode_inlined_item<'self> = &'self fn(
@@ -586,14 +586,14 @@ pub type decode_inlined_item<'self> = &'self fn(
586586
path: ast_map::path,
587587
par_doc: ebml::Doc) -> Option<ast::inlined_item>;
588588

589-
pub fn maybe_get_item_ast(intr: @ident_interner, cdata: cmd, tcx: ty::ctxt,
589+
pub fn maybe_get_item_ast(cdata: cmd, tcx: ty::ctxt,
590590
id: ast::node_id,
591591
decode_inlined_item: decode_inlined_item)
592592
-> csearch::found_ast {
593593
debug!("Looking up item: %d", id);
594594
let item_doc = lookup_item(id, cdata.data);
595595
let path = {
596-
let item_path = item_path(intr, item_doc);
596+
let item_path = item_path(item_doc);
597597
vec::to_owned(item_path.init())
598598
};
599599
match decode_inlined_item(cdata, tcx, copy path, item_doc) {
@@ -835,8 +835,7 @@ pub fn get_supertraits(cdata: cmd, id: ast::node_id, tcx: ty::ctxt)
835835
return results;
836836
}
837837

838-
pub fn get_type_name_if_impl(intr: @ident_interner,
839-
cdata: cmd,
838+
pub fn get_type_name_if_impl(cdata: cmd,
840839
node_id: ast::node_id) -> Option<ast::ident> {
841840
let item = lookup_item(node_id, cdata.data);
842841
if item_family(item) != Impl {
@@ -1086,7 +1085,7 @@ pub struct crate_dep {
10861085
hash: @~str
10871086
}
10881087

1089-
pub fn get_crate_deps(intr: @ident_interner, data: @~[u8]) -> ~[crate_dep] {
1088+
pub fn get_crate_deps(data: @~[u8]) -> ~[crate_dep] {
10901089
let mut deps: ~[crate_dep] = ~[];
10911090
let cratedoc = reader::Doc(data);
10921091
let depsdoc = reader::get_doc(cratedoc, tag_crate_deps);
@@ -1104,10 +1103,10 @@ pub fn get_crate_deps(intr: @ident_interner, data: @~[u8]) -> ~[crate_dep] {
11041103
return deps;
11051104
}
11061105

1107-
fn list_crate_deps(intr: @ident_interner, data: @~[u8], out: @io::Writer) {
1106+
fn list_crate_deps(data: @~[u8], out: @io::Writer) {
11081107
out.write_str("=External Dependencies=\n");
11091108

1110-
for get_crate_deps(intr, data).each |dep| {
1109+
for get_crate_deps(data).each |dep| {
11111110
out.write_str(
11121111
fmt!("%d %s-%s-%s\n",
11131112
dep.cnum, *token::ident_to_str(&dep.name), *dep.hash, *dep.vers));
@@ -1151,7 +1150,7 @@ pub fn list_crate_metadata(intr: @ident_interner, bytes: @~[u8],
11511150
let hash = get_crate_hash(bytes);
11521151
let md = reader::Doc(bytes);
11531152
list_crate_attributes(intr, md, *hash, out);
1154-
list_crate_deps(intr, bytes, out);
1153+
list_crate_deps(bytes, out);
11551154
}
11561155

11571156
// Translates a def_id from an external crate to a def_id for the current

src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ struct entry<T> {
132132
pos: uint
133133
}
134134

135-
fn add_to_index(ecx: @EncodeContext,
136-
ebml_w: &mut writer::Encoder,
135+
fn add_to_index(ebml_w: &mut writer::Encoder,
137136
path: &[ident],
138137
index: &mut ~[entry<~str>],
139138
name: ident) {

src/librustc/middle/kind.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use core::prelude::*;
1212

1313
use middle::freevars::freevar_entry;
1414
use middle::freevars;
15-
use middle::pat_util;
1615
use middle::ty;
1716
use middle::typeck;
1817
use util::ppaux::{Repr, ty_to_str};

src/librustc/middle/resolve.rs

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -725,35 +725,34 @@ pub struct PrimitiveTypeTable {
725725

726726
impl PrimitiveTypeTable {
727727
pub fn intern(&mut self,
728-
intr: @ident_interner,
729728
string: &str,
730729
primitive_type: prim_ty) {
731730
let ident = token::str_to_ident(string);
732731
self.primitive_types.insert(ident, primitive_type);
733732
}
734733
}
735734

736-
pub fn PrimitiveTypeTable(intr: @ident_interner) -> PrimitiveTypeTable {
735+
pub fn PrimitiveTypeTable() -> PrimitiveTypeTable {
737736
let mut table = PrimitiveTypeTable {
738737
primitive_types: HashMap::new()
739738
};
740739

741-
table.intern(intr, "bool", ty_bool);
742-
table.intern(intr, "char", ty_int(ty_char));
743-
table.intern(intr, "float", ty_float(ty_f));
744-
table.intern(intr, "f32", ty_float(ty_f32));
745-
table.intern(intr, "f64", ty_float(ty_f64));
746-
table.intern(intr, "int", ty_int(ty_i));
747-
table.intern(intr, "i8", ty_int(ty_i8));
748-
table.intern(intr, "i16", ty_int(ty_i16));
749-
table.intern(intr, "i32", ty_int(ty_i32));
750-
table.intern(intr, "i64", ty_int(ty_i64));
751-
table.intern(intr, "str", ty_str);
752-
table.intern(intr, "uint", ty_uint(ty_u));
753-
table.intern(intr, "u8", ty_uint(ty_u8));
754-
table.intern(intr, "u16", ty_uint(ty_u16));
755-
table.intern(intr, "u32", ty_uint(ty_u32));
756-
table.intern(intr, "u64", ty_uint(ty_u64));
740+
table.intern("bool", ty_bool);
741+
table.intern("char", ty_int(ty_char));
742+
table.intern("float", ty_float(ty_f));
743+
table.intern("f32", ty_float(ty_f32));
744+
table.intern("f64", ty_float(ty_f64));
745+
table.intern("int", ty_int(ty_i));
746+
table.intern("i8", ty_int(ty_i8));
747+
table.intern("i16", ty_int(ty_i16));
748+
table.intern("i32", ty_int(ty_i32));
749+
table.intern("i64", ty_int(ty_i64));
750+
table.intern("str", ty_str);
751+
table.intern("uint", ty_uint(ty_u));
752+
table.intern("u8", ty_uint(ty_u8));
753+
table.intern("u16", ty_uint(ty_u16));
754+
table.intern("u32", ty_uint(ty_u32));
755+
table.intern("u64", ty_uint(ty_u64));
757756

758757
return table;
759758
}
@@ -806,7 +805,7 @@ pub fn Resolver(session: Session,
806805
self_ident: special_idents::self_,
807806
type_self_ident: special_idents::type_self,
808807

809-
primitive_type_table: @PrimitiveTypeTable(token::get_ident_interner()),
808+
primitive_type_table: @PrimitiveTypeTable(),
810809

811810
namespaces: ~[ TypeNS, ValueNS ],
812811

@@ -2942,8 +2941,6 @@ impl Resolver {
29422941
module_: @mut Module,
29432942
module_path: &[ident])
29442943
-> ResolveResult<ModulePrefixResult> {
2945-
let interner = token::get_ident_interner();
2946-
29472944
// Start at the current module if we see `self` or `super`, or at the
29482945
// top of the crate otherwise.
29492946
let mut containing_module;

src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3070,7 +3070,7 @@ pub fn trans_crate(sess: session::Session,
30703070
lib::llvm::associate_type(tn, @"tydesc", tydesc_type);
30713071
let crate_map = decl_crate_map(sess, link_meta, llmod);
30723072
let dbg_cx = if sess.opts.debuginfo {
3073-
Some(debuginfo::mk_ctxt(copy llmod_id, token::get_ident_interner()))
3073+
Some(debuginfo::mk_ctxt(copy llmod_id))
30743074
} else {
30753075
None
30763076
};
@@ -3105,7 +3105,7 @@ pub fn trans_crate(sess: session::Session,
31053105
lltypes: @mut HashMap::new(),
31063106
llsizingtypes: @mut HashMap::new(),
31073107
adt_reprs: @mut HashMap::new(),
3108-
names: new_namegen(token::get_ident_interner()),
3108+
names: new_namegen(),
31093109
next_addrspace: new_addrspace_gen(),
31103110
symbol_hasher: symbol_hasher,
31113111
type_hashcodes: @mut HashMap::new(),

src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ use syntax::abi::{X86, X86_64, Arm, Mips};
6060
// NOTE: this thunk is totally pointless now that we're not passing
6161
// interners around...
6262
pub type namegen = @fn(s: &str) -> ident;
63-
pub fn new_namegen(intr: @ident_interner) -> namegen {
63+
pub fn new_namegen() -> namegen {
6464
let f: @fn(s: &str) -> ident = |prefix| {
6565
token::str_to_ident(fmt!("%s_%u",
6666
prefix,

src/librustc/middle/trans/debuginfo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ pub struct DebugContext {
108108
crate_file: ~str
109109
}
110110

111-
pub fn mk_ctxt(crate: ~str, intr: @ident_interner) -> DebugContext {
111+
pub fn mk_ctxt(crate: ~str) -> DebugContext {
112112
DebugContext {
113113
llmetadata: @mut HashMap::new(),
114-
names: new_namegen(intr),
114+
names: new_namegen(),
115115
crate_file: crate
116116
}
117117
}

0 commit comments

Comments
 (0)