Skip to content

Commit 6a5b057

Browse files
committed
---
yaml --- r: 14719 b: refs/heads/try c: 5c28b2c h: refs/heads/master i: 14717: b3ffd79 14715: c14a256 14711: 3c5e389 14703: 84760c8 14687: bd3a13b 14655: 98d253c 14591: b754f0a v: v3
1 parent 8cedf82 commit 6a5b057

File tree

5 files changed

+11
-126
lines changed

5 files changed

+11
-126
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: fcde161f4f9b686a790da52653a0a810bf09d487
5+
refs/heads/try: 5c28b2c1d111c285148f977a0f39c35cac264db5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustdoc/doc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ type fndoc = {
6666

6767
type argdoc = {
6868
name: str,
69-
desc: option<str>,
70-
ty: option<str>
69+
desc: option<str>
7170
};
7271

7372
type retdoc = {

branches/try/src/rustdoc/extract.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ fn argdocs_from_args(args: [ast::arg]) -> [doc::argdoc] {
161161
fn argdoc_from_arg(arg: ast::arg) -> doc::argdoc {
162162
{
163163
name: arg.ident,
164-
desc: none,
165-
ty: none
164+
desc: none
166165
}
167166
}
168167

branches/try/src/rustdoc/markdown_pass.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,9 @@ fn write_args(
486486
}
487487

488488
fn write_arg(ctxt: ctxt, arg: doc::argdoc) {
489-
assert option::is_some(arg.ty);
490489
ctxt.w.write_str(#fmt(
491-
"* `%s`: `%s`",
492-
arg.name,
493-
option::get(arg.ty)
490+
"* `%s`",
491+
arg.name
494492
));
495493
alt arg.desc {
496494
some(desc) {
@@ -509,8 +507,8 @@ fn should_write_argument_list() {
509507
markdown,
510508
"Arguments:\n\
511509
\n\
512-
* `b`: `int`\n\
513-
* `c`: `int`\n\
510+
* `b`\n\
511+
* `c`\n\
514512
\n"
515513
);
516514
}
@@ -526,7 +524,7 @@ fn should_not_write_arguments_if_none() {
526524
fn should_write_argument_description() {
527525
let source = "#[doc(args(a = \"milk\"))] fn f(a: bool) { }";
528526
let markdown = test::render(source);
529-
assert str::contains(markdown, "`a`: `bool` - milk");
527+
assert str::contains(markdown, "`a` - milk");
530528
}
531529

532530
fn write_return(
@@ -740,7 +738,7 @@ fn should_write_resource_signature() {
740738
fn should_write_resource_args() {
741739
let markdown = test::render("#[doc(args(a = \"b\"))]\
742740
resource r(a: bool) { }");
743-
assert str::contains(markdown, "Arguments:\n\n* `a`: `bool` - b");
741+
assert str::contains(markdown, "Arguments:\n\n* `a` - b");
744742
}
745743

746744
fn write_iface(ctxt: ctxt, doc: doc::ifacedoc) {
@@ -812,7 +810,7 @@ fn should_write_iface_method_argument_header() {
812810
fn should_write_iface_method_arguments() {
813811
let markdown = test::render(
814812
"iface a { fn a(b: int); }");
815-
assert str::contains(markdown, "* `b`: `int`\n");
813+
assert str::contains(markdown, "* `b`\n");
816814
}
817815

818816
#[test]
@@ -894,7 +892,7 @@ fn should_write_impl_method_argument_header() {
894892
fn should_write_impl_method_arguments() {
895893
let markdown = test::render(
896894
"impl a for int { fn a(b: int) { } }");
897-
assert str::contains(markdown, "* `b`: `int`\n");
895+
assert str::contains(markdown, "* `b`\n");
898896
}
899897

900898
#[test]

branches/try/src/rustdoc/tystr_pass.rs

Lines changed: 0 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ fn fold_fn(
4040
let srv = fold.ctxt;
4141

4242
{
43-
args: merge_arg_tys(srv, doc.id(), doc.args),
4443
return: merge_ret_ty(srv, doc.id(), doc.return),
4544
sig: get_fn_sig(srv, doc.id())
4645
with doc
@@ -134,22 +133,6 @@ fn should_add_native_fn_ret_types() {
134133
assert doc.cratemod().nmods()[0].fns[0].return.ty == some("int");
135134
}
136135

137-
fn merge_arg_tys(
138-
srv: astsrv::srv,
139-
fn_id: doc::ast_id,
140-
args: [doc::argdoc]
141-
) -> [doc::argdoc] {
142-
let tys = get_arg_tys(srv, fn_id);
143-
vec::map2(args, tys) {|arg, ty|
144-
// Sanity check that we're talking about the same args
145-
assert arg.name == tuple::first(ty);
146-
{
147-
ty: some(tuple::second(ty))
148-
with arg
149-
}
150-
}
151-
}
152-
153136
fn get_arg_tys(srv: astsrv::srv, fn_id: doc::ast_id) -> [(str, str)] {
154137
astsrv::exec(srv) {|ctxt|
155138
alt check ctxt.ast_map.get(fn_id) {
@@ -174,20 +157,6 @@ fn decl_arg_tys(decl: ast::fn_decl) -> [(str, str)] {
174157
}
175158
}
176159

177-
#[test]
178-
fn should_add_arg_types() {
179-
let doc = test::mk_doc("fn a(b: int, c: bool) { }");
180-
let fn_ = doc.cratemod().fns()[0];
181-
assert fn_.args[0].ty == some("int");
182-
assert fn_.args[1].ty == some("bool");
183-
}
184-
185-
#[test]
186-
fn should_add_native_fn_arg_types() {
187-
let doc = test::mk_doc("native mod a { fn a(b: int); }");
188-
assert doc.cratemod().nmods()[0].fns[0].args[0].ty == some("int");
189-
}
190-
191160
fn fold_const(
192161
fold: fold::fold<astsrv::srv>,
193162
doc: doc::constdoc
@@ -260,7 +229,6 @@ fn fold_res(
260229
let srv = fold.ctxt;
261230

262231
{
263-
args: merge_arg_tys(srv, doc.id(), doc.args),
264232
sig: some(astsrv::exec(srv) {|ctxt|
265233
alt check ctxt.ast_map.get(doc.id()) {
266234
ast_map::node_item(@{
@@ -280,12 +248,6 @@ fn should_add_resource_sigs() {
280248
assert doc.cratemod().resources()[0].sig == some("resource r(b: bool)");
281249
}
282250

283-
#[test]
284-
fn should_add_resource_arg_tys() {
285-
let doc = test::mk_doc("resource r(a: bool) { }");
286-
assert doc.cratemod().resources()[0].args[0].ty == some("bool");
287-
}
288-
289251
fn fold_iface(
290252
fold: fold::fold<astsrv::srv>,
291253
doc: doc::ifacedoc
@@ -303,11 +265,6 @@ fn merge_methods(
303265
) -> [doc::methoddoc] {
304266
par::anymap(docs) {|doc|
305267
{
306-
args: merge_method_arg_tys(
307-
srv,
308-
item_id,
309-
doc.args,
310-
doc.name),
311268
return: merge_method_ret_ty(
312269
srv,
313270
item_id,
@@ -403,58 +360,6 @@ fn get_method_sig(
403360
}
404361
}
405362

406-
fn merge_method_arg_tys(
407-
srv: astsrv::srv,
408-
item_id: doc::ast_id,
409-
args: [doc::argdoc],
410-
method_name: str
411-
) -> [doc::argdoc] {
412-
let tys = get_method_arg_tys(srv, item_id, method_name);
413-
vec::map2(args, tys) {|arg, ty|
414-
assert arg.name == tuple::first(ty);
415-
{
416-
ty: some(tuple::second(ty))
417-
with arg
418-
}
419-
}
420-
}
421-
422-
fn get_method_arg_tys(
423-
srv: astsrv::srv,
424-
item_id: doc::ast_id,
425-
method_name: str
426-
) -> [(str, str)] {
427-
astsrv::exec(srv) {|ctxt|
428-
alt ctxt.ast_map.get(item_id) {
429-
ast_map::node_item(@{
430-
node: ast::item_iface(_, methods), _
431-
}, _) {
432-
alt vec::find(methods) {|method|
433-
method.ident == method_name
434-
} {
435-
some(method) {
436-
decl_arg_tys(method.decl)
437-
}
438-
_ { fail "get_method_arg_tys: expected method"; }
439-
}
440-
}
441-
ast_map::node_item(@{
442-
node: ast::item_impl(_, _, _, methods), _
443-
}, _) {
444-
alt vec::find(methods) {|method|
445-
method.ident == method_name
446-
} {
447-
some(method) {
448-
decl_arg_tys(method.decl)
449-
}
450-
_ { fail "get_method_arg_tys: expected method"; }
451-
}
452-
}
453-
_ { fail }
454-
}
455-
}
456-
}
457-
458363
#[test]
459364
fn should_add_iface_method_sigs() {
460365
let doc = test::mk_doc("iface i { fn a() -> int; }");
@@ -473,14 +378,6 @@ fn should_not_add_iface_method_nil_ret_type() {
473378
assert doc.cratemod().ifaces()[0].methods[0].return.ty == none;
474379
}
475380

476-
#[test]
477-
fn should_add_iface_method_arg_types() {
478-
let doc = test::mk_doc("iface i { fn a(b: int, c: bool); }");
479-
let fn_ = doc.cratemod().ifaces()[0].methods[0];
480-
assert fn_.args[0].ty == some("int");
481-
assert fn_.args[1].ty == some("bool");
482-
}
483-
484381
fn fold_impl(
485382
fold: fold::fold<astsrv::srv>,
486383
doc: doc::impldoc
@@ -546,14 +443,6 @@ fn should_not_add_impl_method_nil_ret_type() {
546443
assert doc.cratemod().impls()[0].methods[0].return.ty == none;
547444
}
548445

549-
#[test]
550-
fn should_add_impl_method_arg_types() {
551-
let doc = test::mk_doc("impl i for int { fn a(b: int, c: bool) { } }");
552-
let fn_ = doc.cratemod().impls()[0].methods[0];
553-
assert fn_.args[0].ty == some("int");
554-
assert fn_.args[1].ty == some("bool");
555-
}
556-
557446
fn fold_type(
558447
fold: fold::fold<astsrv::srv>,
559448
doc: doc::tydoc

0 commit comments

Comments
 (0)