rustdoc: Add #[doc(test(no_inject_crate))] attribute
So that collections doctests don't automatically fail themselves by injecting `extern crate collections` when they are mostly using the std facade.
This commit is contained in:
parent
3d365f6a01
commit
7770ea706b
3 changed files with 49 additions and 11 deletions
|
@ -230,7 +230,7 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result {
|
|||
stripped_filtered_line(l).unwrap_or(l)
|
||||
}).collect::<Vec<&str>>().connect("\n");
|
||||
let krate = krate.as_ref().map(|s| &**s);
|
||||
let test = test::maketest(&test, krate, false, false);
|
||||
let test = test::maketest(&test, krate, false, false, true);
|
||||
s.push_str(&format!("<span class='rusttest'>{}</span>", Escape(&test)));
|
||||
});
|
||||
s.push_str(&highlight::highlight(&text,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue