Skip to content

Commit 3cfa10c

Browse files
committed
---
yaml --- r: 225496 b: refs/heads/stable c: 5235065 h: refs/heads/master v: v3
1 parent 45c19d0 commit 3cfa10c

File tree

11 files changed

+82
-229
lines changed

11 files changed

+82
-229
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 9a2f68e1594718a8565139b44edfd905803134ce
32+
refs/heads/stable: 5235065d740cad78ab55a89299fc1f5d32bf8f46
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b

branches/stable/src/doc/reference.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,9 +1943,6 @@ macro scope.
19431943
- `simd` - on certain tuple structs, derive the arithmetic operators, which
19441944
lower to the target's SIMD instructions, if any; the `simd` feature gate
19451945
is necessary to use this attribute.
1946-
- `static_assert` - on statics whose type is `bool`, terminates compilation
1947-
with an error if it is not initialized to `true`. To use this, the `static_assert`
1948-
feature gate must be enabled.
19491946
- `unsafe_no_drop_flag` - on structs, remove the flag that prevents
19501947
destructors from being run twice. Destructors might be run multiple times on
19511948
the same object with this attribute. To use this, the `unsafe_no_drop_flag` feature
@@ -2301,12 +2298,6 @@ The currently implemented features of the reference compiler are:
23012298
crate. Stability markers are also attributes: `#[stable]`,
23022299
`#[unstable]`, and `#[deprecated]` are the three levels.
23032300

2304-
* `static_assert` - The `#[static_assert]` functionality is experimental and
2305-
unstable. The attribute can be attached to a `static` of
2306-
type `bool` and the compiler will error if the `bool` is
2307-
`false` at compile time. This version of this functionality
2308-
is unintuitive and suboptimal.
2309-
23102301
* `start` - Allows use of the `#[start]` attribute, which changes the entry point
23112302
into a Rust program. This capability, especially the signature for the
23122303
annotated function, is subject to change.

branches/stable/src/librustc_trans/save/dump_csv.rs

Lines changed: 79 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
169169
};
170170
self.fmt.sub_mod_ref_str(path.span,
171171
*span,
172-
&qualname,
172+
&qualname[..],
173173
self.cur_scope);
174174
}
175175
}
@@ -192,7 +192,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
192192
};
193193
self.fmt.sub_mod_ref_str(path.span,
194194
*span,
195-
&qualname,
195+
&qualname[..],
196196
self.cur_scope);
197197
}
198198
}
@@ -211,7 +211,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
211211
let (ref span, ref qualname) = sub_paths[len-2];
212212
self.fmt.sub_type_ref_str(path.span,
213213
*span,
214-
&qualname);
214+
&qualname[..]);
215215

216216
// write the other sub-paths
217217
if len <= 2 {
@@ -221,7 +221,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
221221
for &(ref span, ref qualname) in sub_paths {
222222
self.fmt.sub_mod_ref_str(path.span,
223223
*span,
224-
&qualname,
224+
&qualname[..],
225225
self.cur_scope);
226226
}
227227
}
@@ -293,7 +293,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
293293
id,
294294
qualname,
295295
&path_to_string(p),
296-
&typ);
296+
&typ[..]);
297297
}
298298
}
299299
}
@@ -451,9 +451,9 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
451451
Some(sub_span) => self.fmt.field_str(field.span,
452452
Some(sub_span),
453453
field.node.id,
454-
&name,
455-
&qualname,
456-
&typ,
454+
&name[..],
455+
&qualname[..],
456+
&typ[..],
457457
scope_id),
458458
None => self.sess.span_bug(field.span,
459459
&format!("Could not find sub-span for field {}",
@@ -485,7 +485,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
485485
self.fmt.typedef_str(full_span,
486486
Some(*param_ss),
487487
param.id,
488-
&name,
488+
&name[..],
489489
"");
490490
}
491491
self.visit_generics(generics);
@@ -561,7 +561,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
561561
sub_span,
562562
id,
563563
&get_ident((*ident).clone()),
564-
&qualname,
564+
&qualname[..],
565565
&self.span.snippet(expr.span),
566566
&ty_to_string(&*typ),
567567
self.cur_scope);
@@ -587,77 +587,82 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
587587
sub_span,
588588
item.id,
589589
ctor_id,
590-
&qualname,
590+
&qualname[..],
591591
self.cur_scope,
592-
&val);
592+
&val[..]);
593593

594594
// fields
595595
for field in &def.fields {
596-
self.process_struct_field_def(field, &qualname, item.id);
596+
self.process_struct_field_def(field, &qualname[..], item.id);
597597
self.visit_ty(&*field.node.ty);
598598
}
599599

600-
self.process_generic_params(ty_params, item.span, &qualname, item.id);
600+
self.process_generic_params(ty_params, item.span, &qualname[..], item.id);
601601
}
602602

603603
fn process_enum(&mut self,
604604
item: &ast::Item,
605605
enum_definition: &ast::EnumDef,
606606
ty_params: &ast::Generics) {
607-
let enum_data = self.save_ctxt.get_item_data(item);
608-
if let super::Data::EnumData(enum_data) = enum_data {
609-
self.fmt.enum_str(item.span,
610-
Some(enum_data.span),
611-
enum_data.id,
612-
&enum_data.qualname,
613-
self.cur_scope,
614-
&enum_data.value);
615-
for variant in &enum_definition.variants {
616-
let name = &get_ident(variant.node.name);
617-
let mut qualname = enum_data.qualname.clone();
618-
qualname.push_str("::");
619-
qualname.push_str(name);
620-
let val = self.span.snippet(variant.span);
621-
match variant.node.kind {
622-
ast::TupleVariantKind(ref args) => {
623-
// first ident in span is the variant's name
624-
self.fmt.tuple_variant_str(variant.span,
625-
self.span.span_for_first_ident(variant.span),
626-
variant.node.id,
627-
name,
628-
&qualname,
629-
&enum_data.qualname,
630-
&val,
631-
item.id);
632-
for arg in args {
633-
self.visit_ty(&*arg.ty);
634-
}
607+
let enum_name = format!("::{}", self.analysis.ty_cx.map.path_to_string(item.id));
608+
let val = self.span.snippet(item.span);
609+
match self.span.sub_span_after_keyword(item.span, keywords::Enum) {
610+
Some(sub_span) => self.fmt.enum_str(item.span,
611+
Some(sub_span),
612+
item.id,
613+
&enum_name[..],
614+
self.cur_scope,
615+
&val[..]),
616+
None => self.sess.span_bug(item.span,
617+
&format!("Could not find subspan for enum {}",
618+
enum_name)),
619+
}
620+
for variant in &enum_definition.variants {
621+
let name = get_ident(variant.node.name);
622+
let name = &name;
623+
let mut qualname = enum_name.clone();
624+
qualname.push_str("::");
625+
qualname.push_str(name);
626+
let val = self.span.snippet(variant.span);
627+
match variant.node.kind {
628+
ast::TupleVariantKind(ref args) => {
629+
// first ident in span is the variant's name
630+
self.fmt.tuple_variant_str(variant.span,
631+
self.span.span_for_first_ident(variant.span),
632+
variant.node.id,
633+
name,
634+
&qualname[..],
635+
&enum_name[..],
636+
&val[..],
637+
item.id);
638+
for arg in args {
639+
self.visit_ty(&*arg.ty);
635640
}
636-
ast::StructVariantKind(ref struct_def) => {
637-
let ctor_id = match struct_def.ctor_id {
638-
Some(node_id) => node_id,
639-
None => -1,
640-
};
641-
self.fmt.struct_variant_str(variant.span,
642-
self.span.span_for_first_ident(variant.span),
643-
variant.node.id,
644-
ctor_id,
645-
&qualname,
646-
&enum_data.qualname,
647-
&val,
648-
item.id);
649-
650-
for field in &struct_def.fields {
651-
self.process_struct_field_def(field, &qualname, variant.node.id);
652-
self.visit_ty(&*field.node.ty);
653-
}
641+
}
642+
ast::StructVariantKind(ref struct_def) => {
643+
let ctor_id = match struct_def.ctor_id {
644+
Some(node_id) => node_id,
645+
None => -1,
646+
};
647+
self.fmt.struct_variant_str(
648+
variant.span,
649+
self.span.span_for_first_ident(variant.span),
650+
variant.node.id,
651+
ctor_id,
652+
&qualname[..],
653+
&enum_name[..],
654+
&val[..],
655+
item.id);
656+
657+
for field in &struct_def.fields {
658+
self.process_struct_field_def(field, &qualname, variant.node.id);
659+
self.visit_ty(&*field.node.ty);
654660
}
655661
}
656662
}
657-
self.process_generic_params(ty_params, item.span, &enum_data.qualname, item.id);
658-
} else {
659-
self.sess.span_bug(item.span, "expected EnumData");
660663
}
664+
665+
self.process_generic_params(ty_params, item.span, &enum_name[..], item.id);
661666
}
662667

663668
fn process_impl(&mut self,
@@ -722,9 +727,9 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
722727
self.fmt.trait_str(item.span,
723728
sub_span,
724729
item.id,
725-
&qualname,
730+
&qualname[..],
726731
self.cur_scope,
727-
&val);
732+
&val[..]);
728733

729734
// super-traits
730735
for super_bound in &**trait_refs {
@@ -756,7 +761,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
756761
}
757762

758763
// walk generics and methods
759-
self.process_generic_params(generics, item.span, &qualname, item.id);
764+
self.process_generic_params(generics, item.span, &qualname[..], item.id);
760765
for method in methods {
761766
self.visit_trait_item(method)
762767
}
@@ -996,7 +1001,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
9961001
self.cur_scope);
9971002

9981003
// walk receiver and args
999-
visit::walk_exprs(self, &args);
1004+
visit::walk_exprs(self, &args[..]);
10001005
}
10011006

10021007
fn process_pat(&mut self, p:&ast::Pat) {
@@ -1155,7 +1160,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
11551160
item.id,
11561161
cnum,
11571162
name,
1158-
&location,
1163+
&location[..],
11591164
self.cur_scope);
11601165
}
11611166
ast::ItemFn(ref decl, _, _, _, ref ty_params, ref body) =>
@@ -1190,8 +1195,8 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
11901195
self.fmt.typedef_str(item.span,
11911196
sub_span,
11921197
item.id,
1193-
&qualname,
1194-
&value);
1198+
&qualname[..],
1199+
&value[..]);
11951200

11961201
self.visit_ty(&**ty);
11971202
self.process_generic_params(ty_params, item.span, &qualname, item.id);
@@ -1343,7 +1348,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
13431348

13441349
let mut id = String::from_str("$");
13451350
id.push_str(&ex.id.to_string());
1346-
self.process_formals(&decl.inputs, &id);
1351+
self.process_formals(&decl.inputs, &id[..]);
13471352

13481353
// walk arg and return types
13491354
for arg in &decl.inputs {
@@ -1403,7 +1408,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
14031408
Some(p.span),
14041409
id,
14051410
&path_to_string(p),
1406-
&value,
1411+
&value[..],
14071412
"")
14081413
}
14091414
def::DefVariant(..) | def::DefTy(..) | def::DefStruct(..) => {
@@ -1461,8 +1466,8 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
14611466
sub_span,
14621467
id,
14631468
&path_to_string(p),
1464-
&value,
1465-
&typ);
1469+
&value[..],
1470+
&typ[..]);
14661471
}
14671472

14681473
// Just walk the initialiser and type (don't want to walk the pattern again).

branches/stable/src/librustc_trans/save/mod.rs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ pub enum Data {
5151
VariableData(VariableData),
5252
/// Data for modules.
5353
ModData(ModData),
54-
/// Data for Enums.
55-
EnumData(EnumData),
5654

5755
/// Data for the use of some variable (e.g., the use of a local variable, which
5856
/// will refere to that variables declaration).
@@ -90,14 +88,6 @@ pub struct ModData {
9088
pub filename: String,
9189
}
9290

93-
/// Data for enum declarations.
94-
pub struct EnumData {
95-
pub id: NodeId,
96-
pub value: String,
97-
pub qualname: String,
98-
pub span: Span,
99-
}
100-
10191
/// Data for the use of some item (e.g., the use of a local variable, which
10292
/// will refere to that variables declaration (by ref_id)).
10393
pub struct VariableRefData {
@@ -198,19 +188,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
198188
scope: self.analysis.ty_cx.map.get_parent(item.id),
199189
filename: filename,
200190
})
201-
},
202-
ast::ItemEnum(..) => {
203-
let enum_name = format!("::{}", self.analysis.ty_cx.map.path_to_string(item.id));
204-
let val = self.span_utils.snippet(item.span);
205-
let sub_span = self.span_utils.sub_span_after_keyword(item.span, keywords::Enum);
206-
207-
Data::EnumData(EnumData {
208-
id: item.id,
209-
value: val,
210-
span: sub_span.unwrap(),
211-
qualname: enum_name,
212-
})
213-
},
191+
}
214192
_ => {
215193
// FIXME
216194
unimplemented!();
@@ -367,7 +345,7 @@ pub fn process_crate(sess: &Session,
367345

368346
let mut visitor = dump_csv::DumpCsvVisitor::new(sess, analysis, output_file);
369347

370-
visitor.dump_crate_info(&cratename, krate);
348+
visitor.dump_crate_info(&cratename[..], krate);
371349
visit::walk_crate(&mut visitor, krate);
372350
}
373351

0 commit comments

Comments
 (0)