Skip to content

Commit 5e13e52

Browse files
committed
---
yaml --- r: 7774 b: refs/heads/snap-stage3 c: efc0679 h: refs/heads/master v: v3
1 parent 8210fdf commit 5e13e52

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 2898dcc5d97da9427ac367542382b6239d9c0bbf
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 6d8058451b71f3e5a8178ca21856b529655df032
4+
refs/heads/snap-stage3: efc067952dc907f3f9646d4effc1f3891e582557
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/snap-stage3/src/rustdoc/attr_pass.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ fn fold_fn(
135135
brief: attrs.brief,
136136
desc: attrs.desc,
137137
args: merge_arg_attrs(doc.args, attrs.args),
138-
return: merge_ret_attrs(doc.return, attrs.return)
138+
return: merge_ret_attrs(doc.return, attrs.return),
139+
failure: attrs.failure
139140
with *doc
140141
};
141142
}
@@ -213,6 +214,16 @@ fn fold_fn_should_preserve_sig() {
213214
assert doc.sig == some("fn a() -> int");
214215
}
215216

217+
#[test]
218+
fn fold_fn_should_extract_failure_conditions() {
219+
let source = "#[doc(failure = \"what\")] fn a() { }";
220+
let srv = astsrv::mk_srv_from_str(source);
221+
let doc = extract::from_srv(srv, "");
222+
let fold = fold::default_seq_fold(srv);
223+
let doc = fold_fn(fold, doc.topmod.fns[0]);
224+
assert doc.failure == some("what");
225+
}
226+
216227
fn fold_const(
217228
fold: fold::fold<astsrv::srv>,
218229
doc: doc::constdoc

branches/snap-stage3/src/rustdoc/doc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type fndoc = ~{
3232
desc: option<str>,
3333
args: [argdoc],
3434
return: retdoc,
35+
failure: option<str>,
3536
sig: option<str>
3637
};
3738

branches/snap-stage3/src/rustdoc/extract.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ fn fndoc_from_fn(
9595
desc: none,
9696
ty: none
9797
},
98+
failure: none,
9899
sig: none
99100
}
100101
}

0 commit comments

Comments
 (0)