File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
branches/snap-stage3/src/rustdoc Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 2898dcc5d97da9427ac367542382b6239d9c0bbf
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: fc64aefe0aebe547322e86b3e5daa4564d038e63
4
+ refs/heads/snap-stage3: 6d8058451b71f3e5a8178ca21856b529655df032
5
5
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ type fn_attrs = {
25
25
brief : option < str > ,
26
26
desc : option < str > ,
27
27
args : [ arg_attrs ] ,
28
- return : option < str >
28
+ return : option < str > ,
29
+ failure : option < str >
29
30
} ;
30
31
31
32
type arg_attrs = {
@@ -193,7 +194,8 @@ fn parse_fn(
193
194
brief: none,
194
195
desc: desc,
195
196
args: [ ] ,
196
- return : none
197
+ return : none,
198
+ failure: none
197
199
}
198
200
} ,
199
201
parse_fn_long_doc
@@ -206,7 +208,7 @@ fn parse_fn_long_doc(
206
208
desc : option < str >
207
209
) -> fn_attrs {
208
210
let return = attr:: meta_item_value_from_list ( items, "return" ) ;
209
-
211
+ let failure = attr :: meta_item_value_from_list ( items , "failure" ) ;
210
212
let args = alt attr:: meta_item_list_from_list ( items, "args" ) {
211
213
some ( items) {
212
214
vec:: filter_map ( items) { |item|
@@ -225,7 +227,8 @@ fn parse_fn_long_doc(
225
227
brief: brief,
226
228
desc: desc,
227
229
args: args,
228
- return : return
230
+ return : return ,
231
+ failure: failure
229
232
}
230
233
}
231
234
@@ -281,6 +284,14 @@ fn parse_fn_should_parse_the_argument_descriptions() {
281
284
assert attrs. args [ 1 ] == { name: "b", desc: " arg b"};
282
285
}
283
286
287
+ #[test]
288
+ fn parse_fn_should_parse_failure_conditions() {
289
+ let source = " #[ doc( failure = \"it' s the fail\" ) ] ";
290
+ let attrs = test::parse_attributes(source);
291
+ let attrs = parse_fn(attrs);
292
+ assert attrs.failure == some(" it' s the fail") ;
293
+ }
294
+
284
295
fn parse_const ( attrs : [ ast:: attribute ] ) -> const_attrs {
285
296
parse_short_doc_or (
286
297
attrs,
You can’t perform that action at this time.
0 commit comments