From afe3e27085752efd1d9affe1f9c95e67de4dcf5d Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Mon, 8 Jan 2018 13:20:19 -0600 Subject: value-namespace items require a marker, so emit an error --- src/librustdoc/clean/mod.rs | 10 ++++++++-- src/test/rustdoc/intra-links.rs | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src') 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 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 -- cgit 1.4.1-3-g733a5