diff options
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 10 | ||||
| -rw-r--r-- | src/test/rustdoc/intra-links.rs | 6 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index e1dbcb27864..5e8d6301acb 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -926,8 +926,14 @@ impl Clean<Attributes> for [ast::Attribute] { // for structs, etc, and the link won't work. if let Ok(path) = resolve(false) { path.def - } else if let Ok(path) = resolve(true) { - path.def + } else if let Ok(_path) = resolve(true) { + let sp = attrs.doc_strings.first().map_or(DUMMY_SP, |a| a.span()); + cx.sess().struct_span_err(sp, &format!("could not resolve `{}`", + path_str)) + .help(&format!("try `{0}()`, `static@{0}`, or `const@{0}`", + path_str)) + .emit(); + continue; } else { // this could just be a normal link continue; diff --git a/src/test/rustdoc/intra-links.rs b/src/test/rustdoc/intra-links.rs index cc9d288ba91..aa6f5538754 100644 --- a/src/test/rustdoc/intra-links.rs +++ b/src/test/rustdoc/intra-links.rs @@ -27,9 +27,9 @@ //! * [`ThisTrait`](ThisTrait) //! * [`ThisAlias`](ThisAlias) //! * [`ThisUnion`](ThisUnion) -//! * [`this_function`](this_function) -//! * [`THIS_CONST`](THIS_CONST) -//! * [`THIS_STATIC`](THIS_STATIC) +//! * [`this_function`](this_function()) +//! * [`THIS_CONST`](const@THIS_CONST) +//! * [`THIS_STATIC`](static@THIS_STATIC) //! * [`this_macro`](this_macro!) //! //! In addition, there's some specifics we want to look at. There's [a trait called |
