File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: 3310112169ddbc0a12043635e0ed81204d15b9c0
5
+ refs/heads/try: dc69355e999d6c923507ccae4d877fa4370c872d
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ fn write_fn(
116
116
write_desc ( ctxt, doc. desc ) ;
117
117
write_args ( ctxt, doc. args ) ;
118
118
write_return ( ctxt, doc. return ) ;
119
+ write_failure ( ctxt, doc. failure ) ;
119
120
}
120
121
121
122
fn write_sig ( ctxt : ctxt , sig : option < str > ) {
@@ -304,6 +305,25 @@ fn should_write_return_description_on_same_line_as_type() {
304
305
assert str:: contains ( markdown, "Returns `int` - blorp" ) ;
305
306
}
306
307
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 \n Failure conditions: it's the fail\n \n " ) ;
325
+ }
326
+
307
327
fn write_const (
308
328
ctxt : ctxt ,
309
329
doc : doc:: constdoc
You can’t perform that action at this time.
0 commit comments