-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...est/rustdoc-ui/coverage/basic.rs | 7 | 14 | 50.0% |
-+-------------------------------------+------------+------------+------------+
-| Total | 7 | 14 | 50.0% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...est/rustdoc-ui/coverage/basic.rs | 7 | 14 | 50.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 7 | 14 | 50.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
--- /dev/null
+// compile-flags:-Z unstable-options --show-coverage
+// check-pass
+
+//! This test ensure that only rust code examples are counted.
+
+/// Doc
+///
+/// ```
+/// let x = 2;
+/// ```
+pub struct Foo;
+
+/// Doc
+///
+/// ```text
+/// yolo
+/// ```
+pub trait Bar {}
+
+/// Doc
+///
+/// ```ignore (just for the sake of this test)
+/// let x = 2;
+/// ```
+pub fn foo<T: Bar, D: ::std::fmt::Debug>(a: Foo, b: u32, c: T, d: D) -> u32 {
+ 0
+}
--- /dev/null
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...tdoc-ui/coverage/doc-examples.rs | 4 | 4 | 100.0% | 2 | 50.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 4 | 4 | 100.0% | 2 | 50.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...est/rustdoc-ui/coverage/empty.rs | 0 | 1 | 0.0% |
-+-------------------------------------+------------+------------+------------+
-| Total | 0 | 1 | 0.0% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...est/rustdoc-ui/coverage/empty.rs | 0 | 1 | 0.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 0 | 1 | 0.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...est/rustdoc-ui/coverage/enums.rs | 6 | 8 | 75.0% |
-+-------------------------------------+------------+------------+------------+
-| Total | 6 | 8 | 75.0% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...est/rustdoc-ui/coverage/enums.rs | 6 | 8 | 75.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 6 | 8 | 75.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...st/rustdoc-ui/coverage/exotic.rs | 1 | 1 | 100.0% |
-| <anon> | 2 | 2 | 100.0% |
-+-------------------------------------+------------+------------+------------+
-| Total | 3 | 3 | 100.0% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...st/rustdoc-ui/coverage/exotic.rs | 1 | 1 | 100.0% | 0 | 0.0% |
+| <anon> | 2 | 2 | 100.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 3 | 3 | 100.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-{"$DIR/json.rs":{"total":13,"with_docs":7}}
+{"$DIR/json.rs":{"total":13,"with_docs":7,"with_examples":0}}
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...t/rustdoc-ui/coverage/private.rs | 4 | 7 | 57.1% |
-+-------------------------------------+------------+------------+------------+
-| Total | 4 | 7 | 57.1% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...t/rustdoc-ui/coverage/private.rs | 4 | 7 | 57.1% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 4 | 7 | 57.1% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...oc-ui/coverage/statics-consts.rs | 6 | 7 | 85.7% |
-+-------------------------------------+------------+------------+------------+
-| Total | 6 | 7 | 85.7% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...oc-ui/coverage/statics-consts.rs | 6 | 7 | 85.7% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 6 | 7 | 85.7% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...st/rustdoc-ui/coverage/traits.rs | 6 | 7 | 85.7% |
-+-------------------------------------+------------+------------+------------+
-| Total | 6 | 7 | 85.7% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...st/rustdoc-ui/coverage/traits.rs | 6 | 7 | 85.7% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 6 | 7 | 85.7% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+