Skip to content

Commit cd05166

Browse files
committed
---
yaml --- r: 13762 b: refs/heads/try c: 3310112 h: refs/heads/master v: v3
1 parent da5a6ea commit cd05166

File tree

2 files changed

+13
-2
lines changed

2 files changed

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

branches/try/src/rustdoc/trim_pass.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ fn fold_fn(fold: fold::fold<()>, doc: doc::fndoc) -> doc::fndoc {
9191
return: {
9292
desc: trimopt(doc.return.desc)
9393
with doc.return
94-
}
94+
},
95+
failure: trimopt(doc.failure)
9596
with *doc
9697
}
9798
}
@@ -128,3 +129,13 @@ fn should_trim_ret() {
128129
let doc = run(srv, doc);
129130
assert doc.topmod.fns[0].return.desc == some("a");
130131
}
132+
133+
#[test]
134+
fn should_trim_failure_conditions() {
135+
let source = "#[doc(failure = \"\na\n\")] fn a() -> int { }";
136+
let srv = astsrv::mk_srv_from_str(source);
137+
let doc = extract::from_srv(srv, "");
138+
let doc = attr_pass::mk_pass()(srv, doc);
139+
let doc = run(srv, doc);
140+
assert doc.topmod.fns[0].failure == some("a");
141+
}

0 commit comments

Comments
 (0)