Skip to content

Commit 73a28e5

Browse files
committed
auto merge of #8920 : Kimundi/rust/master, r=thestinger
2 parents 1f4aba8 + 857f867 commit 73a28e5

Some content is hidden

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

56 files changed

+513
-511
lines changed

src/librustc/driver/session.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,12 @@ impl Session_ {
337337
}
338338

339339
// pointless function, now...
340-
pub fn str_of(@self, id: ast::ident) -> @str {
340+
pub fn str_of(@self, id: ast::Ident) -> @str {
341341
token::ident_to_str(&id)
342342
}
343343

344344
// pointless function, now...
345-
pub fn ident_of(@self, st: &str) -> ast::ident {
345+
pub fn ident_of(@self, st: &str) -> ast::Ident {
346346
token::str_to_ident(st)
347347
}
348348

src/librustc/front/test.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type node_id_gen = @fn() -> ast::NodeId;
3030

3131
struct Test {
3232
span: Span,
33-
path: ~[ast::ident],
33+
path: ~[ast::Ident],
3434
bench: bool,
3535
ignore: bool,
3636
should_fail: bool
@@ -39,7 +39,7 @@ struct Test {
3939
struct TestCtxt {
4040
sess: session::Session,
4141
crate: @ast::Crate,
42-
path: ~[ast::ident],
42+
path: ~[ast::Ident],
4343
ext_cx: @ExtCtxt,
4444
testfns: ~[Test]
4545
}
@@ -383,7 +383,7 @@ fn nospan<T>(t: T) -> codemap::Spanned<T> {
383383
codemap::Spanned { node: t, span: dummy_sp() }
384384
}
385385

386-
fn path_node(ids: ~[ast::ident]) -> ast::Path {
386+
fn path_node(ids: ~[ast::Ident]) -> ast::Path {
387387
ast::Path {
388388
span: dummy_sp(),
389389
global: false,
@@ -395,7 +395,7 @@ fn path_node(ids: ~[ast::ident]) -> ast::Path {
395395
}
396396
}
397397

398-
fn path_node_global(ids: ~[ast::ident]) -> ast::Path {
398+
fn path_node_global(ids: ~[ast::Ident]) -> ast::Path {
399399
ast::Path {
400400
span: dummy_sp(),
401401
global: true,

src/librustc/metadata/csearch.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use syntax::ast_map;
2525
use syntax::diagnostic::expect;
2626

2727
pub struct StaticMethodInfo {
28-
ident: ast::ident,
28+
ident: ast::Ident,
2929
def_id: ast::def_id,
3030
purity: ast::purity
3131
}
@@ -52,7 +52,7 @@ pub fn each_lang_item(cstore: @mut cstore::CStore,
5252
/// Iterates over each child of the given item.
5353
pub fn each_child_of_item(cstore: @mut cstore::CStore,
5454
def_id: ast::def_id,
55-
callback: &fn(decoder::DefLike, ast::ident)) {
55+
callback: &fn(decoder::DefLike, ast::Ident)) {
5656
let crate_data = cstore::get_crate_data(cstore, def_id.crate);
5757
let get_crate_data: decoder::GetCrateDataCb = |cnum| {
5858
cstore::get_crate_data(cstore, cnum)
@@ -68,7 +68,7 @@ pub fn each_child_of_item(cstore: @mut cstore::CStore,
6868
pub fn each_top_level_item_of_crate(cstore: @mut cstore::CStore,
6969
cnum: ast::CrateNum,
7070
callback: &fn(decoder::DefLike,
71-
ast::ident)) {
71+
ast::Ident)) {
7272
let crate_data = cstore::get_crate_data(cstore, cnum);
7373
let get_crate_data: decoder::GetCrateDataCb = |cnum| {
7474
cstore::get_crate_data(cstore, cnum)
@@ -129,7 +129,7 @@ pub fn get_method(tcx: ty::ctxt, def: ast::def_id) -> ty::Method {
129129

130130
pub fn get_method_name_and_explicit_self(cstore: @mut cstore::CStore,
131131
def: ast::def_id)
132-
-> (ast::ident, ast::explicit_self_)
132+
-> (ast::Ident, ast::explicit_self_)
133133
{
134134
let cdata = cstore::get_crate_data(cstore, def.crate);
135135
decoder::get_method_name_and_explicit_self(cstore.intr, cdata, def.node)
@@ -156,7 +156,7 @@ pub fn get_supertraits(tcx: ty::ctxt, def: ast::def_id) -> ~[@ty::TraitRef] {
156156
}
157157

158158
pub fn get_type_name_if_impl(cstore: @mut cstore::CStore, def: ast::def_id)
159-
-> Option<ast::ident> {
159+
-> Option<ast::Ident> {
160160
let cdata = cstore::get_crate_data(cstore, def.crate);
161161
decoder::get_type_name_if_impl(cdata, def.node)
162162
}
@@ -245,7 +245,7 @@ pub fn get_impl_vtables(tcx: ty::ctxt,
245245

246246
pub fn get_impl_method(cstore: @mut cstore::CStore,
247247
def: ast::def_id,
248-
mname: ast::ident)
248+
mname: ast::Ident)
249249
-> Option<ast::def_id> {
250250
let cdata = cstore::get_crate_data(cstore, def.crate);
251251
decoder::get_impl_method(cstore.intr, cdata, def.node, mname)

src/librustc/metadata/decoder.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,12 @@ fn item_path(item_doc: ebml::Doc) -> ast_map::path {
312312
return result;
313313
}
314314

315-
fn item_name(intr: @ident_interner, item: ebml::Doc) -> ast::ident {
315+
fn item_name(intr: @ident_interner, item: ebml::Doc) -> ast::Ident {
316316
let name = reader::get_doc(item, tag_paths_data_name);
317317
let string = name.as_str_slice();
318318
match intr.find_equiv(&string) {
319319
None => token::str_to_ident(string),
320-
Some(val) => ast::new_ident(val),
320+
Some(val) => ast::Ident::new(val),
321321
}
322322
}
323323

@@ -452,7 +452,7 @@ pub fn get_impl_vtables(cdata: Cmd,
452452

453453

454454
pub fn get_impl_method(intr: @ident_interner, cdata: Cmd, id: ast::NodeId,
455-
name: ast::ident) -> Option<ast::def_id> {
455+
name: ast::Ident) -> Option<ast::def_id> {
456456
let items = reader::get_doc(reader::Doc(cdata.data), tag_items);
457457
let mut found = None;
458458
do reader::tagged_docs(find_item(id, items), tag_item_impl_method) |mid| {
@@ -706,7 +706,7 @@ fn each_child_of_item_or_crate(intr: @ident_interner,
706706
cdata: Cmd,
707707
item_doc: ebml::Doc,
708708
get_crate_data: GetCrateDataCb,
709-
callback: &fn(DefLike, ast::ident)) {
709+
callback: &fn(DefLike, ast::Ident)) {
710710
// Iterate over all children.
711711
let _ = do reader::tagged_docs(item_doc, tag_mod_child) |child_info_doc| {
712712
let child_def_id = reader::with_doc_data(child_info_doc,
@@ -829,7 +829,7 @@ pub fn each_child_of_item(intr: @ident_interner,
829829
cdata: Cmd,
830830
id: ast::NodeId,
831831
get_crate_data: GetCrateDataCb,
832-
callback: &fn(DefLike, ast::ident)) {
832+
callback: &fn(DefLike, ast::Ident)) {
833833
// Find the item.
834834
let root_doc = reader::Doc(cdata.data);
835835
let items = reader::get_doc(root_doc, tag_items);
@@ -849,7 +849,7 @@ pub fn each_child_of_item(intr: @ident_interner,
849849
pub fn each_top_level_item_of_crate(intr: @ident_interner,
850850
cdata: Cmd,
851851
get_crate_data: GetCrateDataCb,
852-
callback: &fn(DefLike, ast::ident)) {
852+
callback: &fn(DefLike, ast::Ident)) {
853853
let root_doc = reader::Doc(cdata.data);
854854
let misc_info_doc = reader::get_doc(root_doc, tag_misc_info);
855855
let crate_items_doc = reader::get_doc(misc_info_doc,
@@ -995,7 +995,7 @@ pub fn get_impl(intr: @ident_interner, cdata: Cmd, impl_id: ast::NodeId,
995995
pub fn get_method_name_and_explicit_self(
996996
intr: @ident_interner,
997997
cdata: Cmd,
998-
id: ast::NodeId) -> (ast::ident, ast::explicit_self_)
998+
id: ast::NodeId) -> (ast::Ident, ast::explicit_self_)
999999
{
10001000
let method_doc = lookup_item(id, cdata.data);
10011001
let name = item_name(intr, method_doc);
@@ -1093,7 +1093,7 @@ pub fn get_supertraits(cdata: Cmd, id: ast::NodeId, tcx: ty::ctxt)
10931093
}
10941094

10951095
pub fn get_type_name_if_impl(cdata: Cmd,
1096-
node_id: ast::NodeId) -> Option<ast::ident> {
1096+
node_id: ast::NodeId) -> Option<ast::Ident> {
10971097
let item = lookup_item(node_id, cdata.data);
10981098
if item_family(item) != Impl {
10991099
return None;
@@ -1352,7 +1352,7 @@ pub fn get_crate_attributes(data: @~[u8]) -> ~[ast::Attribute] {
13521352
#[deriving(Clone)]
13531353
pub struct CrateDep {
13541354
cnum: ast::CrateNum,
1355-
name: ast::ident,
1355+
name: ast::Ident,
13561356
vers: @str,
13571357
hash: @str
13581358
}

src/librustc/metadata/encoder.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ pub fn reachable(ecx: &EncodeContext, id: NodeId) -> bool {
102102

103103
fn encode_name(ecx: &EncodeContext,
104104
ebml_w: &mut writer::Encoder,
105-
name: ident) {
105+
name: Ident) {
106106
ebml_w.wr_tagged_str(tag_paths_data_name, ecx.tcx.sess.str_of(name));
107107
}
108108

109109
fn encode_impl_type_basename(ecx: &EncodeContext,
110110
ebml_w: &mut writer::Encoder,
111-
name: ident) {
111+
name: Ident) {
112112
ebml_w.wr_tagged_str(tag_item_impl_type_basename,
113113
ecx.tcx.sess.str_of(name));
114114
}
@@ -135,9 +135,9 @@ struct entry<T> {
135135
}
136136

137137
fn add_to_index(ebml_w: &mut writer::Encoder,
138-
path: &[ident],
138+
path: &[Ident],
139139
index: &mut ~[entry<~str>],
140-
name: ident) {
140+
name: Ident) {
141141
let mut full_path = ~[];
142142
full_path.push_all(path);
143143
full_path.push(name);
@@ -379,7 +379,7 @@ fn encode_reexported_static_method(ecx: &EncodeContext,
379379
ebml_w: &mut writer::Encoder,
380380
exp: &middle::resolve::Export2,
381381
method_def_id: def_id,
382-
method_ident: ident) {
382+
method_ident: Ident) {
383383
debug!("(encode reexported static method) %s::%s",
384384
exp.name, ecx.tcx.sess.str_of(method_ident));
385385
ebml_w.start_tag(tag_items_data_item_reexport);
@@ -541,7 +541,7 @@ fn encode_info_for_mod(ecx: &EncodeContext,
541541
md: &_mod,
542542
id: NodeId,
543543
path: &[ast_map::path_elt],
544-
name: ident,
544+
name: Ident,
545545
vis: visibility) {
546546
ebml_w.start_tag(tag_items_data_item);
547547
encode_def_id(ebml_w, local_def(id));
@@ -700,7 +700,7 @@ fn encode_info_for_struct(ecx: &EncodeContext,
700700
fn encode_info_for_struct_ctor(ecx: &EncodeContext,
701701
ebml_w: &mut writer::Encoder,
702702
path: &[ast_map::path_elt],
703-
name: ast::ident,
703+
name: ast::Ident,
704704
ctor_id: NodeId,
705705
index: @mut ~[entry<i64>]) {
706706
index.push(entry { val: ctor_id as i64, pos: ebml_w.writer.tell() });

src/librustc/metadata/tydecode.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ fn scan<R>(st: &mut PState, is_last: &fn(char) -> bool,
9090
return op(st.data.slice(start_pos, end_pos));
9191
}
9292

93-
pub fn parse_ident(st: &mut PState, last: char) -> ast::ident {
93+
pub fn parse_ident(st: &mut PState, last: char) -> ast::Ident {
9494
fn is_last(b: char, c: char) -> bool { return c == b; }
9595
return parse_ident_(st, |a| is_last(last, a) );
9696
}
9797

9898
fn parse_ident_(st: &mut PState, is_last: @fn(char) -> bool) ->
99-
ast::ident {
99+
ast::Ident {
100100
let rslt = scan(st, is_last, str::from_bytes);
101101
return st.tcx.sess.ident_of(rslt);
102102
}
@@ -130,7 +130,7 @@ pub fn parse_trait_ref_data(data: &[u8], crate_num: int, pos: uint, tcx: ty::ctx
130130
}
131131

132132
fn parse_path(st: &mut PState) -> @ast::Path {
133-
let mut idents: ~[ast::ident] = ~[];
133+
let mut idents: ~[ast::Ident] = ~[];
134134
fn is_last(c: char) -> bool { return c == '(' || c == ':'; }
135135
idents.push(parse_ident_(st, is_last));
136136
loop {

src/librustc/middle/astencode.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ trait fake_ext_ctxt {
12561256
fn cfg(&self) -> ast::CrateConfig;
12571257
fn parse_sess(&self) -> @mut parse::ParseSess;
12581258
fn call_site(&self) -> Span;
1259-
fn ident_of(&self, st: &str) -> ast::ident;
1259+
fn ident_of(&self, st: &str) -> ast::Ident;
12601260
}
12611261

12621262
#[cfg(test)]
@@ -1273,7 +1273,7 @@ impl fake_ext_ctxt for fake_session {
12731273
expn_info: None
12741274
}
12751275
}
1276-
fn ident_of(&self, st: &str) -> ast::ident {
1276+
fn ident_of(&self, st: &str) -> ast::Ident {
12771277
token::str_to_ident(st)
12781278
}
12791279
}

src/librustc/middle/cfg/construct.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ impl CFGBuilder {
488488

489489
fn find_scope(&self,
490490
expr: @ast::expr,
491-
label: Option<ast::ident>) -> LoopScope {
491+
label: Option<ast::Ident>) -> LoopScope {
492492
match label {
493493
None => {
494494
return *self.loop_scopes.last();

src/librustc/middle/dataflow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
867867

868868
fn find_scope<'a>(&self,
869869
expr: @ast::expr,
870-
label: Option<ast::ident>,
870+
label: Option<ast::Ident>,
871871
loop_scopes: &'a mut ~[LoopScope]) -> &'a mut LoopScope {
872872
let index = match label {
873873
None => {

src/librustc/middle/lint.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ fn lint_path_statement() -> @mut OuterLint {
10331033
}
10341034

10351035
fn check_item_non_camel_case_types(cx: &Context, it: &ast::item) {
1036-
fn is_camel_case(cx: ty::ctxt, ident: ast::ident) -> bool {
1036+
fn is_camel_case(cx: ty::ctxt, ident: ast::Ident) -> bool {
10371037
let ident = cx.sess.str_of(ident);
10381038
assert!(!ident.is_empty());
10391039
let ident = ident.trim_chars(&'_');
@@ -1044,7 +1044,7 @@ fn check_item_non_camel_case_types(cx: &Context, it: &ast::item) {
10441044
!ident.contains_char('_')
10451045
}
10461046

1047-
fn check_case(cx: &Context, sort: &str, ident: ast::ident, span: Span) {
1047+
fn check_case(cx: &Context, sort: &str, ident: ast::Ident, span: Span) {
10481048
if !is_camel_case(cx.tcx, ident) {
10491049
cx.span_lint(
10501050
non_camel_case_types, span,

src/librustc/middle/liveness.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,13 @@ enum LocalKind {
227227

228228
struct LocalInfo {
229229
id: NodeId,
230-
ident: ident,
230+
ident: Ident,
231231
is_mutbl: bool,
232232
kind: LocalKind,
233233
}
234234

235235
enum VarKind {
236-
Arg(NodeId, ident),
236+
Arg(NodeId, Ident),
237237
Local(LocalInfo),
238238
ImplicitRet
239239
}
@@ -756,7 +756,7 @@ impl Liveness {
756756
}
757757

758758
pub fn find_loop_scope(&self,
759-
opt_label: Option<ident>,
759+
opt_label: Option<Ident>,
760760
id: NodeId,
761761
sp: Span)
762762
-> NodeId {

src/librustc/middle/mem_categorization.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub enum InteriorKind {
9999

100100
#[deriving(Eq, IterBytes)]
101101
pub enum FieldName {
102-
NamedField(ast::ident),
102+
NamedField(ast::Ident),
103103
PositionalField(uint)
104104
}
105105

@@ -613,7 +613,7 @@ impl mem_categorization_ctxt {
613613
pub fn cat_field<N:ast_node>(&self,
614614
node: N,
615615
base_cmt: cmt,
616-
f_name: ast::ident,
616+
f_name: ast::Ident,
617617
f_ty: ty::t)
618618
-> cmt {
619619
@cmt_ {
@@ -1058,7 +1058,7 @@ impl mem_categorization_ctxt {
10581058
/// an enum to determine which variant is in use.
10591059
pub fn field_mutbl(tcx: ty::ctxt,
10601060
base_ty: ty::t,
1061-
f_name: ast::ident,
1061+
f_name: ast::Ident,
10621062
node_id: ast::NodeId)
10631063
-> Option<ast::mutability> {
10641064
// Need to refactor so that struct/enum fields can be treated uniformly.

src/librustc/middle/pat_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use syntax::ast::*;
1616
use syntax::ast_util::{path_to_ident, walk_pat};
1717
use syntax::codemap::Span;
1818

19-
pub type PatIdMap = HashMap<ident, NodeId>;
19+
pub type PatIdMap = HashMap<Ident, NodeId>;
2020

2121
// This is used because same-named variables in alternative patterns need to
2222
// use the NodeId of their namesake in the first pattern.

0 commit comments

Comments
 (0)