about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-06-06 09:14:09 -0700
committerEsteban Küber <esteban@kuber.com.ar>2018-06-06 09:38:47 -0700
commit7d0b6b75f05a669ee8cc76e651a654296d7d166c (patch)
tree666b2653fe9eb718bf116896227c39b7d0be5202 /src/test/rustdoc-ui
parent507dfd2148f68bc3bd6349d5e666b12e360a9d15 (diff)
downloadrust-7d0b6b75f05a669ee8cc76e651a654296d7d166c.tar.gz
rust-7d0b6b75f05a669ee8cc76e651a654296d7d166c.zip
When unable to sinthesize link span, fallback to previous behavior
Diffstat (limited to 'src/test/rustdoc-ui')
-rw-r--r--src/test/rustdoc-ui/intra-links-warning.rs42
-rw-r--r--src/test/rustdoc-ui/intra-links-warning.stderr87
2 files changed, 114 insertions, 15 deletions
diff --git a/src/test/rustdoc-ui/intra-links-warning.rs b/src/test/rustdoc-ui/intra-links-warning.rs
index 0d886bf0972..d6bc275b57a 100644
--- a/src/test/rustdoc-ui/intra-links-warning.rs
+++ b/src/test/rustdoc-ui/intra-links-warning.rs
@@ -11,11 +11,47 @@
 // compile-pass
 
        //! Test with [Foo::baz], [Bar::foo], ...
-       //! , [Uniooon::X] and [Qux::Z].
-       //! .
-       //! , [Uniooon::X] and [Qux::Z].
+     //! , [Uniooon::X] and [Qux::Z].
+       //!
+      //! , [Uniooon::X] and [Qux::Z].
 
        /// [Qux:Y]
 pub struct Foo {
     pub bar: usize,
 }
+
+/// Foo
+/// bar [BarA] bar
+/// baz
+pub fn a() {}
+
+/**
+ * Foo
+ * bar [BarB] bar
+ * baz
+ */
+pub fn b() {}
+
+/** Foo
+
+bar [BarC] bar
+baz
+
+    let bar_c_1 = 0;
+    let bar_c_2 = 0;
+    let g = [bar_c_1];
+    let h = g[bar_c_2];
+
+*/
+pub fn c() {}
+
+#[doc = "Foo\nbar [BarD] bar\nbaz"]
+pub fn d() {}
+
+macro_rules! f {
+    ($f:expr) => {
+        #[doc = $f]
+        pub fn f() {}
+    }
+}
+f!("Foo\nbar [BarF] bar\nbaz");
diff --git a/src/test/rustdoc-ui/intra-links-warning.stderr b/src/test/rustdoc-ui/intra-links-warning.stderr
index a5a5598ed8f..52adba5679f 100644
--- a/src/test/rustdoc-ui/intra-links-warning.stderr
+++ b/src/test/rustdoc-ui/intra-links-warning.stderr
@@ -11,28 +11,28 @@ warning: `[Bar::foo]` cannot be resolved, ignoring it...
    |                                   ^^^^^^^^ cannot be resolved, ignoring
 
 warning: `[Uniooon::X]` cannot be resolved, ignoring it...
-  --> $DIR/intra-links-warning.rs:14:15
+  --> $DIR/intra-links-warning.rs:14:13
    |
-14 |        //! , [Uniooon::X] and [Qux::Z].
-   |               ^^^^^^^^^^ cannot be resolved, ignoring
+14 |      //! , [Uniooon::X] and [Qux::Z].
+   |             ^^^^^^^^^^ cannot be resolved, ignoring
 
 warning: `[Qux::Z]` cannot be resolved, ignoring it...
-  --> $DIR/intra-links-warning.rs:14:32
+  --> $DIR/intra-links-warning.rs:14:30
    |
-14 |        //! , [Uniooon::X] and [Qux::Z].
-   |                                ^^^^^^ cannot be resolved, ignoring
+14 |      //! , [Uniooon::X] and [Qux::Z].
+   |                              ^^^^^^ cannot be resolved, ignoring
 
 warning: `[Uniooon::X]` cannot be resolved, ignoring it...
-  --> $DIR/intra-links-warning.rs:16:15
+  --> $DIR/intra-links-warning.rs:16:14
    |
-16 |        //! , [Uniooon::X] and [Qux::Z].
-   |               ^^^^^^^^^^ cannot be resolved, ignoring
+16 |       //! , [Uniooon::X] and [Qux::Z].
+   |              ^^^^^^^^^^ cannot be resolved, ignoring
 
 warning: `[Qux::Z]` cannot be resolved, ignoring it...
-  --> $DIR/intra-links-warning.rs:16:32
+  --> $DIR/intra-links-warning.rs:16:31
    |
-16 |        //! , [Uniooon::X] and [Qux::Z].
-   |                                ^^^^^^ cannot be resolved, ignoring
+16 |       //! , [Uniooon::X] and [Qux::Z].
+   |                               ^^^^^^ cannot be resolved, ignoring
 
 warning: `[Qux:Y]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:18:13
@@ -40,3 +40,66 @@ warning: `[Qux:Y]` cannot be resolved, ignoring it...
 18 |        /// [Qux:Y]
    |             ^^^^^ cannot be resolved, ignoring
 
+warning: `[BarA]` cannot be resolved, ignoring it...
+  --> $DIR/intra-links-warning.rs:24:10
+   |
+24 | /// bar [BarA] bar
+   |          ^^^^ cannot be resolved, ignoring
+
+warning: `[BarB]` cannot be resolved, ignoring it...
+  --> $DIR/intra-links-warning.rs:28:1
+   |
+28 | / /**
+29 | |  * Foo
+30 | |  * bar [BarB] bar
+31 | |  * baz
+32 | |  */
+   | |___^
+   |
+   = note: the link appears in this line:
+           
+            bar [BarB] bar
+                 ^^^^
+
+warning: `[BarC]` cannot be resolved, ignoring it...
+  --> $DIR/intra-links-warning.rs:35:1
+   |
+35 | / /** Foo
+36 | |
+37 | | bar [BarC] bar
+38 | | baz
+...  |
+44 | |
+45 | | */
+   | |__^
+   |
+   = note: the link appears in this line:
+           
+           bar [BarC] bar
+                ^^^^
+
+warning: `[BarD]` cannot be resolved, ignoring it...
+  --> $DIR/intra-links-warning.rs:48:1
+   |
+48 | #[doc = "Foo/nbar [BarD] bar/nbaz"]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the link appears in this line:
+           
+           bar [BarD] bar
+                ^^^^
+
+warning: `[BarF]` cannot be resolved, ignoring it...
+  --> $DIR/intra-links-warning.rs:53:9
+   |
+53 |         #[doc = $f]
+   |         ^^^^^^^^^^^
+...
+57 | f!("Foo/nbar [BarF] bar/nbaz");
+   | ------------------------------- in this macro invocation
+   |
+   = note: the link appears in this line:
+           
+           bar [BarF] bar
+                ^^^^
+