Skip to content

Commit df41115

Browse files
committed
auto merge of #10750 : Blei/rust/no-at-struct-field, r=alexcrichton
2 parents 83084e9 + 47ce981 commit df41115

File tree

13 files changed

+31
-31
lines changed

13 files changed

+31
-31
lines changed

src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ fn encode_provided_source(ebml_w: &mut writer::Encoder,
730730
fn encode_info_for_struct(ecx: &EncodeContext,
731731
ebml_w: &mut writer::Encoder,
732732
path: &[ast_map::path_elt],
733-
fields: &[@struct_field],
733+
fields: &[struct_field],
734734
global_index: @mut ~[entry<i64>])
735735
-> ~[entry<i64>] {
736736
/* Each class has its own index, since different classes

src/librustc/middle/lint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ impl<'self> Visitor<()> for Context<'self> {
13101310
self.cur_struct_def_id = old_id;
13111311
}
13121312

1313-
fn visit_struct_field(&mut self, s: @ast::struct_field, _: ()) {
1313+
fn visit_struct_field(&mut self, s: &ast::struct_field, _: ()) {
13141314
self.with_lint_attrs(s.node.attrs, |cx| {
13151315
check_missing_doc_struct_field(cx, s);
13161316
check_attrs_usage(cx, s.node.attrs);

src/librustc/middle/resolve.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3873,9 +3873,9 @@ impl Resolver {
38733873
fn resolve_struct(&mut self,
38743874
id: NodeId,
38753875
generics: &Generics,
3876-
fields: &[@struct_field]) {
3877-
let mut ident_map: HashMap<ast::Ident,@struct_field> = HashMap::new();
3878-
for &field in fields.iter() {
3876+
fields: &[struct_field]) {
3877+
let mut ident_map: HashMap<ast::Ident, &struct_field> = HashMap::new();
3878+
for field in fields.iter() {
38793879
match field.node.kind {
38803880
named_field(ident, _) => {
38813881
match ident_map.find(&ident) {

src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,7 @@ pub fn trans_enum_variant(ccx: @mut CrateContext,
20372037
}
20382038

20392039
pub fn trans_tuple_struct(ccx: @mut CrateContext,
2040-
fields: &[@ast::struct_field],
2040+
fields: &[ast::struct_field],
20412041
ctor_id: ast::NodeId,
20422042
param_substs: Option<@param_substs>,
20432043
llfndecl: ValueRef) {
@@ -2062,7 +2062,7 @@ impl IdAndTy for ast::variant_arg {
20622062
fn ty(&self) -> ast::P<ast::Ty> { self.ty }
20632063
}
20642064

2065-
impl IdAndTy for @ast::struct_field {
2065+
impl IdAndTy for ast::struct_field {
20662066
fn id(&self) -> ast::NodeId { self.node.id }
20672067
fn ty(&self) -> ast::P<ast::Ty> { self.node.ty }
20682068
}

src/librustc/middle/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3693,7 +3693,7 @@ impl VariantInfo {
36933693
},
36943694
ast::struct_variant_kind(ref struct_def) => {
36953695

3696-
let fields: &[@struct_field] = struct_def.fields;
3696+
let fields: &[struct_field] = struct_def.fields;
36973697

36983698
assert!(fields.len() > 0);
36993699

@@ -4082,7 +4082,7 @@ pub fn lookup_struct_field(cx: ctxt,
40824082
}
40834083
}
40844084

4085-
fn struct_field_tys(fields: &[@struct_field]) -> ~[field_ty] {
4085+
fn struct_field_tys(fields: &[struct_field]) -> ~[field_ty] {
40864086
fields.map(|field| {
40874087
match field.node.kind {
40884088
named_field(ident, visibility) => {

src/librustc/middle/typeck/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ pub fn convert_struct(ccx: &CrateCtxt,
620620

621621
// Write the type of each of the members
622622
for f in struct_def.fields.iter() {
623-
convert_field(ccx, &tpt.generics, *f);
623+
convert_field(ccx, &tpt.generics, f);
624624
}
625625
let substs = mk_item_substs(ccx, &tpt.generics, None);
626626
let selfty = ty::mk_struct(tcx, local_def(id), substs);

src/librustdoc/doctree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub struct Struct {
8080
name: Ident,
8181
generics: ast::Generics,
8282
attrs: ~[ast::Attribute],
83-
fields: ~[@ast::struct_field],
83+
fields: ~[ast::struct_field],
8484
where: Span,
8585
}
8686

src/librustdoc/visit_ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl RustdocVisitor {
4646
vis: item.vis,
4747
attrs: item.attrs.clone(),
4848
generics: generics.clone(),
49-
fields: sd.fields.iter().map(|x| (*x).clone()).to_owned_vec(),
49+
fields: sd.fields.clone(),
5050
where: item.span
5151
}
5252
}

src/libsyntax/ast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ impl visibility {
11051105
}
11061106
}
11071107

1108-
#[deriving(Eq, Encodable, Decodable,IterBytes)]
1108+
#[deriving(Clone, Eq, Encodable, Decodable,IterBytes)]
11091109
pub struct struct_field_ {
11101110
kind: struct_field_kind,
11111111
id: NodeId,
@@ -1115,15 +1115,15 @@ pub struct struct_field_ {
11151115

11161116
pub type struct_field = Spanned<struct_field_>;
11171117

1118-
#[deriving(Eq, Encodable, Decodable,IterBytes)]
1118+
#[deriving(Clone, Eq, Encodable, Decodable,IterBytes)]
11191119
pub enum struct_field_kind {
11201120
named_field(Ident, visibility),
11211121
unnamed_field // element of a tuple-like struct
11221122
}
11231123

11241124
#[deriving(Eq, Encodable, Decodable,IterBytes)]
11251125
pub struct struct_def {
1126-
fields: ~[@struct_field], /* fields, not including ctor */
1126+
fields: ~[struct_field], /* fields, not including ctor */
11271127
/* ID of the constructor. This is only used for tuple- or enum-like
11281128
* structs. */
11291129
ctor_id: Option<NodeId>

src/libsyntax/ast_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ impl<'self, O: IdVisitingOperation> Visitor<()> for IdVisitor<'self, O> {
565565
}
566566
}
567567

568-
fn visit_struct_field(&mut self, struct_field: @struct_field, env: ()) {
568+
fn visit_struct_field(&mut self, struct_field: &struct_field, env: ()) {
569569
self.operation.visit_id(struct_field.node.id);
570570
visit::walk_struct_field(self, struct_field, env)
571571
}

0 commit comments

Comments
 (0)