Skip to content

Commit dd69412

Browse files
committed
---
yaml --- r: 81918 b: refs/heads/master c: 47f2e80 h: refs/heads/master v: v3
1 parent 7e76e5e commit dd69412

File tree

11 files changed

+201
-144
lines changed

11 files changed

+201
-144
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ca697d370594aaed020fb252a216b632abc56d33
2+
refs/heads/master: 47f2e80b65bf814953c0ceda3b48e46802883f4b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729

trunk/src/librustdoc/clean.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ pub enum ItemEnum {
149149
MethodItem(Method),
150150
StructFieldItem(StructField),
151151
VariantItem(Variant),
152-
ForeignFunctionItem(Function),
153-
ForeignStaticItem(Static),
154152
}
155153

156154
#[deriving(Clone, Encodable, Decodable)]
@@ -174,7 +172,6 @@ impl Clean<Item> for doctree::Module {
174172
inner: ModuleItem(Module {
175173
items: std::vec::concat(&[self.structs.clean(),
176174
self.enums.clean(), self.fns.clean(),
177-
std::vec::concat(self.foreigns.clean()),
178175
self.mods.clean(), self.typedefs.clean(),
179176
self.statics.clean(), self.traits.clean(),
180177
self.impls.clean(), self.view_items.clean()])
@@ -971,41 +968,6 @@ impl Clean<ViewListIdent> for ast::path_list_ident {
971968
}
972969
}
973970

974-
impl Clean<~[Item]> for ast::foreign_mod {
975-
fn clean(&self) -> ~[Item] {
976-
self.items.clean()
977-
}
978-
}
979-
980-
impl Clean<Item> for ast::foreign_item {
981-
fn clean(&self) -> Item {
982-
let inner = match self.node {
983-
ast::foreign_item_fn(ref decl, ref generics) => {
984-
ForeignFunctionItem(Function {
985-
decl: decl.clean(),
986-
generics: generics.clean(),
987-
purity: ast::extern_fn,
988-
})
989-
}
990-
ast::foreign_item_static(ref ty, mutbl) => {
991-
ForeignStaticItem(Static {
992-
type_: ty.clean(),
993-
mutability: if mutbl {Mutable} else {Immutable},
994-
expr: ~"",
995-
})
996-
}
997-
};
998-
Item {
999-
name: Some(self.ident.clean()),
1000-
attrs: self.attrs.clean(),
1001-
source: self.span.clean(),
1002-
id: self.id,
1003-
visibility: self.vis.clean(),
1004-
inner: inner,
1005-
}
1006-
}
1007-
}
1008-
1009971
// Utilities
1010972

1011973
trait ToSource {

trunk/src/librustdoc/doctree.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pub struct Module {
3030
traits: ~[Trait],
3131
vis: ast::visibility,
3232
impls: ~[Impl],
33-
foreigns: ~[ast::foreign_mod],
3433
view_items: ~[ast::view_item],
3534
}
3635

@@ -51,7 +50,6 @@ impl Module {
5150
traits : ~[],
5251
impls : ~[],
5352
view_items : ~[],
54-
foreigns : ~[],
5553
}
5654
}
5755
}

trunk/src/librustdoc/html/render.rs

Lines changed: 32 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -521,14 +521,6 @@ impl Context {
521521
}
522522
}
523523
}
524-
clean::StructItem(s) => {
525-
let mut it = s.fields.move_iter();
526-
do self.recurse(name) |this| {
527-
for item in it {
528-
f(this, item);
529-
}
530-
}
531-
}
532524
_ => {}
533525
}
534526
}
@@ -540,21 +532,19 @@ impl Context {
540532

541533
fn shortty(item: &clean::Item) -> &'static str {
542534
match item.inner {
543-
clean::ModuleItem(*) => "mod",
544-
clean::StructItem(*) => "struct",
545-
clean::EnumItem(*) => "enum",
546-
clean::FunctionItem(*) => "fn",
547-
clean::TypedefItem(*) => "typedef",
548-
clean::StaticItem(*) => "static",
549-
clean::TraitItem(*) => "trait",
550-
clean::ImplItem(*) => "impl",
551-
clean::ViewItemItem(*) => "viewitem",
552-
clean::TyMethodItem(*) => "tymethod",
553-
clean::MethodItem(*) => "method",
554-
clean::StructFieldItem(*) => "structfield",
555-
clean::VariantItem(*) => "variant",
556-
clean::ForeignFunctionItem(*) => "ffi",
557-
clean::ForeignStaticItem(*) => "ffs",
535+
clean::ModuleItem(*) => "mod",
536+
clean::StructItem(*) => "struct",
537+
clean::EnumItem(*) => "enum",
538+
clean::FunctionItem(*) => "fn",
539+
clean::TypedefItem(*) => "typedef",
540+
clean::StaticItem(*) => "static",
541+
clean::TraitItem(*) => "trait",
542+
clean::ImplItem(*) => "impl",
543+
clean::ViewItemItem(*) => "viewitem",
544+
clean::TyMethodItem(*) => "tymethod",
545+
clean::MethodItem(*) => "method",
546+
clean::StructFieldItem(*) => "structfield",
547+
clean::VariantItem(*) => "variant",
558548
}
559549
}
560550

@@ -594,15 +584,12 @@ impl<'self> fmt::Default for Item<'self> {
594584
match it.item.inner {
595585
clean::ModuleItem(ref m) => item_module(fmt.buf, it.cx,
596586
it.item, m.items),
597-
clean::FunctionItem(ref f) | clean::ForeignFunctionItem(ref f) =>
598-
item_function(fmt.buf, it.item, f),
587+
clean::FunctionItem(ref f) => item_function(fmt.buf, it.item, f),
599588
clean::TraitItem(ref t) => item_trait(fmt.buf, it.item, t),
600589
clean::StructItem(ref s) => item_struct(fmt.buf, it.item, s),
601590
clean::EnumItem(ref e) => item_enum(fmt.buf, it.item, e),
602591
clean::TypedefItem(ref t) => item_typedef(fmt.buf, it.item, t),
603592
clean::VariantItem(*) => item_variant(fmt.buf, it.cx, it.item),
604-
clean::StructFieldItem(*) => item_struct_field(fmt.buf, it.cx,
605-
it.item),
606593
_ => {}
607594
}
608595
}
@@ -676,10 +663,6 @@ fn item_module(w: &mut io::Writer, cx: &Context,
676663
(_, &clean::EnumItem(*)) => false,
677664
(&clean::StaticItem(*), _) => true,
678665
(_, &clean::StaticItem(*)) => false,
679-
(&clean::ForeignFunctionItem(*), _) => true,
680-
(_, &clean::ForeignFunctionItem(*)) => false,
681-
(&clean::ForeignStaticItem(*), _) => true,
682-
(_, &clean::ForeignStaticItem(*)) => false,
683666
(&clean::TraitItem(*), _) => true,
684667
(_, &clean::TraitItem(*)) => false,
685668
(&clean::FunctionItem(*), _) => true,
@@ -707,31 +690,27 @@ fn item_module(w: &mut io::Writer, cx: &Context,
707690
}
708691
curty = myty;
709692
write!(w, "<h2>{}</h2>\n<table>", match myitem.inner {
710-
clean::ModuleItem(*) => "Modules",
711-
clean::StructItem(*) => "Structs",
712-
clean::EnumItem(*) => "Enums",
713-
clean::FunctionItem(*) => "Functions",
714-
clean::TypedefItem(*) => "Type Definitions",
715-
clean::StaticItem(*) => "Statics",
716-
clean::TraitItem(*) => "Traits",
717-
clean::ImplItem(*) => "Implementations",
718-
clean::ViewItemItem(*) => "Reexports",
719-
clean::TyMethodItem(*) => "Type Methods",
720-
clean::MethodItem(*) => "Methods",
721-
clean::StructFieldItem(*) => "Struct Fields",
722-
clean::VariantItem(*) => "Variants",
723-
clean::ForeignFunctionItem(*) => "Foreign Functions",
724-
clean::ForeignStaticItem(*) => "Foreign Statics",
693+
clean::ModuleItem(*) => "Modules",
694+
clean::StructItem(*) => "Structs",
695+
clean::EnumItem(*) => "Enums",
696+
clean::FunctionItem(*) => "Functions",
697+
clean::TypedefItem(*) => "Type Definitions",
698+
clean::StaticItem(*) => "Statics",
699+
clean::TraitItem(*) => "Traits",
700+
clean::ImplItem(*) => "Implementations",
701+
clean::ViewItemItem(*) => "Reexports",
702+
clean::TyMethodItem(*) => "Type Methods",
703+
clean::MethodItem(*) => "Methods",
704+
clean::StructFieldItem(*) => "Struct Fields",
705+
clean::VariantItem(*) => "Variants",
725706
});
726707
}
727708

728709
match myitem.inner {
729-
clean::StaticItem(ref s) | clean::ForeignStaticItem(ref s) => {
710+
clean::StaticItem(ref s) => {
730711
struct Initializer<'self>(&'self str);
731712
impl<'self> fmt::Default for Initializer<'self> {
732713
fn fmt(s: &Initializer<'self>, f: &mut fmt::Formatter) {
733-
if s.len() == 0 { return; }
734-
write!(f.buf, "<code> = </code>");
735714
let tag = if s.contains("\n") { "pre" } else { "code" };
736715
write!(f.buf, "<{tag}>{}</{tag}>",
737716
s.as_slice(), tag=tag);
@@ -740,7 +719,7 @@ fn item_module(w: &mut io::Writer, cx: &Context,
740719

741720
write!(w, "
742721
<tr>
743-
<td><code>{}static {}: {}</code>{}</td>
722+
<td><code>{}static {}: {} = </code>{}</td>
744723
<td class='docblock'>{}&nbsp;</td>
745724
</tr>
746725
",
@@ -1001,12 +980,11 @@ fn render_struct(w: &mut io::Writer, it: &clean::Item,
1001980
for field in fields.iter() {
1002981
match field.inner {
1003982
clean::StructFieldItem(ref ty) => {
1004-
write!(w, " {}<a name='field.{name}'>{name}</a>: \
1005-
{},\n{}",
983+
write!(w, " {}{}: {},\n{}",
1006984
VisSpace(field.visibility),
985+
field.name.get_ref().as_slice(),
1007986
ty.type_,
1008-
tab,
1009-
name = field.name.get_ref().as_slice());
987+
tab);
1010988
}
1011989
_ => unreachable!()
1012990
}
@@ -1192,12 +1170,3 @@ fn item_variant(w: &mut io::Writer, cx: &Context, it: &clean::Item) {
11921170
*cx.current.last(),
11931171
it.name.get_ref().as_slice());
11941172
}
1195-
1196-
fn item_struct_field(w: &mut io::Writer, cx: &Context, it: &clean::Item) {
1197-
write!(w, "<DOCTYPE html><html><head>\
1198-
<meta http-equiv='refresh' content='0; \
1199-
url=../struct.{}.html\\#field.{}'>\
1200-
</head><body></body></html>",
1201-
*cx.current.last(),
1202-
it.name.get_ref().as_slice());
1203-
}

trunk/src/librustdoc/passes.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ pub fn strip_private(crate: clean::Crate) -> plugins::PluginResult {
5959
clean::TypedefItem(*) | clean::StaticItem(*) |
6060
clean::StructItem(*) | clean::EnumItem(*) |
6161
clean::TraitItem(*) | clean::FunctionItem(*) |
62-
clean::ViewItemItem(*) | clean::MethodItem(*) |
63-
clean::ForeignFunctionItem(*) | clean::ForeignStaticItem(*) => {
62+
clean::ViewItemItem(*) | clean::MethodItem(*) => {
6463
// XXX: re-exported items should get surfaced in the docs as
6564
// well (using the output of resolve analysis)
6665
if i.visibility != Some(ast::public) {

trunk/src/librustdoc/visit_ast.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@ impl RustdocVisitor {
174174
};
175175
om.impls.push(i);
176176
},
177-
ast::item_foreign_mod(ref fm) => {
178-
om.foreigns.push(fm.clone());
179-
}
180177
_ => (),
181178
}
182179
}

trunk/src/libstd/rt/comm.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,17 @@ impl<T> ChanOne<T> {
118118
rtassert!(!rt::in_sched_context());
119119
}
120120

121+
// In order to prevent starvation of other tasks in situations
122+
// where a task sends repeatedly without ever receiving, we
123+
// occassionally yield instead of doing a send immediately.
124+
// Only doing this if we're doing a rescheduling send,
125+
// otherwise the caller is expecting not to context switch.
126+
if do_resched {
127+
// XXX: This TLS hit should be combined with other uses of the scheduler below
128+
let sched: ~Scheduler = Local::take();
129+
sched.maybe_yield();
130+
}
131+
121132
let mut this = self;
122133
let mut recvr_active = true;
123134
let packet = this.packet();

0 commit comments

Comments
 (0)