1 //! This test ensures that code from doctests is properly re-mapped.
2 //! See <https://github.com/rust-lang/rust/issues/79417> for more info.
4 //! Just some random code:
7 //! // this is executed!
15 //! doctest testing external code:
17 //! extern crate doctest_crate;
18 //! doctest_crate::fn_run_in_doctests(1);
21 //! doctest returning a result:
25 //! let mut res = Err(SomeError);
31 //! // need to be explicit because rustdoc cant infer the return type
32 //! Ok::<(), SomeError>(())
35 //! doctest with custom main:
40 //! extern crate doctest_crate;
42 //! fn doctest_main() -> Result<(), SomeError> {
43 //! doctest_crate::fn_run_in_doctests(2);
47 //! // this `main` is not shown as covered, as it clashes with all the other
48 //! // `main` functions that were automatically generated for doctests
49 //! fn main() -> Result<(), SomeError> {
54 /// doctest attached to fn testing external code:
56 /// extern crate doctest_crate;
57 /// doctest_crate::fn_run_in_doctests(3);