fn next(&mut self) -> Option<Self::Item> {
let event = self.inner.next();
let compile_fail;
+ let should_panic;
let ignore;
let edition;
if let Some(Event::Start(Tag::CodeBlock(kind))) = event {
return Some(Event::Start(Tag::CodeBlock(kind)));
}
compile_fail = parse_result.compile_fail;
+ should_panic = parse_result.should_panic;
ignore = parse_result.ignore;
edition = parse_result.edition;
} else {
Some(("This example is not tested".to_owned(), "ignore"))
} else if compile_fail {
Some(("This example deliberately fails to compile".to_owned(), "compile_fail"))
+ } else if should_panic {
+ Some(("This example panics".to_owned(), "should_panic"))
} else if explicit_edition {
Some((format!("This code runs with edition {}", edition), "edition"))
} else {
" ignore"
} else if compile_fail {
" compile_fail"
+ } else if should_panic {
+ " should_panic"
} else if explicit_edition {
" edition "
} else {
" ignore"
} else if compile_fail {
" compile_fail"
+ } else if should_panic {
+ " should_panic"
} else if explicit_edition {
" edition "
} else {
border-style: solid;
}
-.tooltip.compile_fail, .tooltip.ignore {
+.tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
font-weight: bold;
font-size: 20px;
}
border-left: 2px solid #f00;
}
+pre.should_panic {
+ border-left: 2px solid rgba(255,0,0,.8);
+}
+
+pre.should_panic:hover, .information:hover + pre.should_panic {
+ border-left: 2px solid #f00;
+}
+
pre.ignore {
border-left: 2px solid rgba(255,142,0,.6);
}
color: #f00;
}
+.tooltip.should_panic {
+ color: rgba(255,0,0,.8);
+}
+
+.information > .should_panic:hover {
+ color: #f00;
+}
+
.tooltip.ignore {
color: rgba(255,142,0,.6);
}
border-left: 2px solid #f00;
}
+pre.should_panic {
+ border-left: 2px solid rgba(255,0,0,.5);
+}
+
+pre.should_panic:hover, .information:hover + pre.should_panic {
+ border-left: 2px solid #f00;
+}
+
pre.ignore {
border-left: 2px solid rgba(255,142,0,.6);
}
color: #f00;
}
+.tooltip.should_panic {
+ color: rgba(255,0,0,.5);
+}
+
+.information > .should_panic:hover {
+ color: #f00;
+}
+
.tooltip.ignore {
color: rgba(255,142,0,.6);
}
// @has foo/fn.bar.html '//*[@class="tooltip compile_fail"]/span' "This example deliberately fails to compile"
// @has foo/fn.bar.html '//*[@class="tooltip ignore"]/span' "This example is not tested"
+// @has foo/fn.bar.html '//*[@class="tooltip should_panic"]/span' "This example panics"
/// foo
///
/// goo();
/// ```
///
+/// ```should_panic
+/// hoo();
+/// ```
+///
/// ```
/// let x = 0;
/// ```