Skip to content

Commit cd92339

Browse files
committed
---
yaml --- r: 13763 b: refs/heads/try c: dc69355 h: refs/heads/master i: 13761: da5a6ea 13759: 4d20d7e v: v3
1 parent cd05166 commit cd92339

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
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: 3310112169ddbc0a12043635e0ed81204d15b9c0
5+
refs/heads/try: dc69355e999d6c923507ccae4d877fa4370c872d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustdoc/gen.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ fn write_fn(
116116
write_desc(ctxt, doc.desc);
117117
write_args(ctxt, doc.args);
118118
write_return(ctxt, doc.return);
119+
write_failure(ctxt, doc.failure);
119120
}
120121

121122
fn write_sig(ctxt: ctxt, sig: option<str>) {
@@ -304,6 +305,25 @@ fn should_write_return_description_on_same_line_as_type() {
304305
assert str::contains(markdown, "Returns `int` - blorp");
305306
}
306307

308+
fn write_failure(ctxt: ctxt, str: option<str>) {
309+
alt str {
310+
some(str) {
311+
ctxt.w.write_line(#fmt("Failure conditions: %s", str));
312+
ctxt.w.write_line("");
313+
}
314+
none { }
315+
}
316+
}
317+
318+
#[test]
319+
fn should_write_failure_conditions() {
320+
let markdown = test::render(
321+
"#[doc(failure = \"it's the fail\")] fn a () { }");
322+
assert str::contains(
323+
markdown,
324+
"\n\nFailure conditions: it's the fail\n\n");
325+
}
326+
307327
fn write_const(
308328
ctxt: ctxt,
309329
doc: doc::constdoc

0 commit comments

Comments
 (0)