Skip to content

Commit a51fae0

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

20 files changed

+56
-65
lines changed

src/libextra/sync.rs

-1
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

+1-1
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

+3-3
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

+11-12
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

+1-2
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

-1
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

+18-21
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

+2-2
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

+1-1
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

+2-2
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
}

src/librustc/util/ppaux.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ impl Repr for ty::Method {
654654
}
655655

656656
impl Repr for ast::ident {
657-
fn repr(&self, tcx: ctxt) -> ~str {
657+
fn repr(&self, _tcx: ctxt) -> ~str {
658658
copy *token::ident_to_str(self)
659659
}
660660
}

src/librustpkg/rustpkg.rc

+3-3
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,9 @@ impl PkgSrc {
649649
if self.libs.is_empty() && self.mains.is_empty()
650650
&& self.tests.is_empty() && self.benchs.is_empty() {
651651

652-
util::note(~"Couldn't infer any crates to build.\n\
653-
Try naming a crate `main.rs`, `lib.rs`, \
654-
`test.rs`, or `bench.rs`.");
652+
util::note("Couldn't infer any crates to build.\n\
653+
Try naming a crate `main.rs`, `lib.rs`, \
654+
`test.rs`, or `bench.rs`.");
655655
cond.raise(copy self.id);
656656
}
657657

src/librustpkg/util.rs

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ use rustc::driver::{driver, session};
1414
use rustc::metadata::filesearch;
1515
use extra::getopts::groups::getopts;
1616
use extra::term;
17-
#[cfg(not(test))]
18-
use extra::getopts;
1917
use syntax::ast_util::*;
2018
use syntax::codemap::{dummy_sp, spanned};
2119
use syntax::codemap::dummy_spanned;

src/libsyntax/ext/expand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ pub fn new_name_finder() -> @Visitor<@mut ~[ast::ident]> {
394394
}
395395

396396
pub fn expand_block(extsbox: @mut SyntaxEnv,
397-
cx: @ExtCtxt,
397+
_cx: @ExtCtxt,
398398
blk: &blk_,
399399
sp: span,
400400
fld: @ast_fold,

src/libsyntax/ext/fmt.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ pub fn expand_syntax_ext(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
5353
fn pieces_to_expr(cx: @ExtCtxt, sp: span,
5454
pieces: ~[Piece], args: ~[@ast::expr])
5555
-> @ast::expr {
56-
fn make_path_vec(cx: @ExtCtxt, ident: &str) -> ~[ast::ident] {
56+
fn make_path_vec(ident: &str) -> ~[ast::ident] {
5757
return ~[str_to_ident("std"),
5858
str_to_ident("unstable"),
5959
str_to_ident("extfmt"),
6060
str_to_ident("rt"),
6161
str_to_ident(ident)];
6262
}
6363
fn make_rt_path_expr(cx: @ExtCtxt, sp: span, nm: &str) -> @ast::expr {
64-
let path = make_path_vec(cx, nm);
64+
let path = make_path_vec(nm);
6565
cx.expr_path(cx.path_global(sp, path))
6666
}
6767
// Produces an AST expression that represents a RT::conv record,
@@ -90,7 +90,7 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span,
9090
}
9191
CountIs(c) => {
9292
let count_lit = cx.expr_uint(sp, c as uint);
93-
let count_is_path = make_path_vec(cx, "CountIs");
93+
let count_is_path = make_path_vec("CountIs");
9494
let count_is_args = ~[count_lit];
9595
return cx.expr_call_global(sp, count_is_path, count_is_args);
9696
}
@@ -114,7 +114,7 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span,
114114
ty_expr: @ast::expr) -> @ast::expr {
115115
cx.expr_struct(
116116
sp,
117-
cx.path_global(sp, make_path_vec(cx, "Conv")),
117+
cx.path_global(sp, make_path_vec("Conv")),
118118
~[
119119
cx.field_imm(sp, str_to_ident("flags"), flags_expr),
120120
cx.field_imm(sp, str_to_ident("width"), width_expr),
@@ -133,7 +133,7 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span,
133133
fn make_conv_call(cx: @ExtCtxt, sp: span, conv_type: &str, cnv: &Conv,
134134
arg: @ast::expr, buf: @ast::expr) -> @ast::expr {
135135
let fname = ~"conv_" + conv_type;
136-
let path = make_path_vec(cx, fname);
136+
let path = make_path_vec(fname);
137137
let cnv_expr = make_rt_conv_expr(cx, sp, cnv);
138138
let args = ~[cnv_expr, arg, buf];
139139
cx.expr_call_global(arg.span, path, args)

src/libsyntax/ext/quote.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub mod rt {
9292

9393
impl<'self> ToSource for &'self [@ast::item] {
9494
fn to_source(&self) -> ~str {
95-
str::connect(self.map(|i| i.to_source()), ~"\n\n")
95+
str::connect(self.map(|i| i.to_source()), "\n\n")
9696
}
9797
}
9898

@@ -104,7 +104,7 @@ pub mod rt {
104104

105105
impl<'self> ToSource for &'self [@ast::Ty] {
106106
fn to_source(&self) -> ~str {
107-
str::connect(self.map(|i| i.to_source()), ~", ")
107+
str::connect(self.map(|i| i.to_source()), ", ")
108108
}
109109
}
110110

src/libsyntax/ext/source_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use core::prelude::*;
1212

1313
use ast;
1414
use codemap;
15-
use codemap::{FileMap, Loc, Pos, ExpandedFrom, span};
15+
use codemap::{Pos, ExpandedFrom, span};
1616
use codemap::{CallInfo, NameAndSpan};
1717
use ext::base::*;
1818
use ext::base;

src/libsyntax/ext/tt/transcribe.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ enum lis {
132132
}
133133

134134
fn lockstep_iter_size(t: &token_tree, r: &mut TtReader) -> lis {
135-
fn lis_merge(lhs: lis, rhs: lis, r: &mut TtReader) -> lis {
135+
fn lis_merge(lhs: lis, rhs: lis) -> lis {
136136
match lhs {
137137
lis_unconstrained => copy rhs,
138138
lis_contradiction(_) => copy lhs,
@@ -154,7 +154,7 @@ fn lockstep_iter_size(t: &token_tree, r: &mut TtReader) -> lis {
154154
tt_delim(ref tts) | tt_seq(_, ref tts, _, _) => {
155155
vec::foldl(lis_unconstrained, *tts, |lis, tt| {
156156
let lis2 = lockstep_iter_size(tt, r);
157-
lis_merge(lis, lis2, r)
157+
lis_merge(lis, lis2)
158158
})
159159
}
160160
tt_tok(*) => lis_unconstrained,

src/libsyntax/parse/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub fn seq_sep_none() -> SeqSep {
4949

5050
// maps any token back to a string. not necessary if you know it's
5151
// an identifier....
52-
pub fn token_to_str(reader: @reader, token: &token::Token) -> ~str {
52+
pub fn token_to_str(token: &token::Token) -> ~str {
5353
token::to_str(get_ident_interner(), token)
5454
}
5555

0 commit comments

Comments
 (0)