Skip to content

Commit

Permalink
Rename intra-doc lint
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 13, 2018
1 parent e6c7868 commit d2a4e42
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/librustc/lint/builtin.rs
Expand Up @@ -299,7 +299,7 @@ declare_lint! {
}

declare_lint! {
pub INTRA_LINK_RESOLUTION_FAILURE,
pub INTRA_DOC_LINK_RESOLUTION_FAILURE,
Warn,
"warn about documentation intra links resolution failure"
}
Expand Down Expand Up @@ -357,7 +357,7 @@ impl LintPass for HardwiredLints {
UNSTABLE_NAME_COLLISIONS,
DUPLICATE_ASSOCIATED_TYPE_BINDINGS,
DUPLICATE_MACRO_EXPORTS,
INTRA_LINK_RESOLUTION_FAILURE,
INTRA_DOC_LINK_RESOLUTION_FAILURE,
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/clean/mod.rs
Expand Up @@ -1284,13 +1284,13 @@ fn resolution_failure(
link_range.end + code_dox_len,
);

diag = cx.tcx.struct_span_lint_node(lint::builtin::INTRA_LINK_RESOLUTION_FAILURE,
diag = cx.tcx.struct_span_lint_node(lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE,
NodeId::new(0),
sp,
&msg);
diag.span_label(sp, "cannot be resolved, ignoring");
} else {
diag = cx.tcx.struct_span_lint_node(lint::builtin::INTRA_LINK_RESOLUTION_FAILURE,
diag = cx.tcx.struct_span_lint_node(lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE,
NodeId::new(0),
sp,
&msg);
Expand All @@ -1310,7 +1310,7 @@ fn resolution_failure(
}
diag
} else {
cx.tcx.struct_span_lint_node(lint::builtin::INTRA_LINK_RESOLUTION_FAILURE,
cx.tcx.struct_span_lint_node(lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE,
NodeId::new(0),
sp,
&msg)
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/core.rs
Expand Up @@ -187,7 +187,7 @@ pub fn run_core(search_paths: SearchPaths,
_ => None
};

let intra_link_resolution_failure_name = lint::builtin::INTRA_LINK_RESOLUTION_FAILURE.name;
let intra_link_resolution_failure_name = lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE.name;
let warnings_lint_name = lint::builtin::WARNINGS.name;
let lints = lint::builtin::HardwiredLints.get_lints()
.iter()
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/deny-intra-link-resolution-failure.rs
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![deny(intra_link_resolution_failure)]
#![deny(intra_doc_link_resolution_failure)]

/// [v2] //~ ERROR
pub fn foo() {}
4 changes: 2 additions & 2 deletions src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr
Expand Up @@ -7,7 +7,7 @@ error: `[v2]` cannot be resolved, ignoring it...
note: lint level defined here
--> $DIR/deny-intra-link-resolution-failure.rs:11:9
|
11 | #![deny(intra_link_resolution_failure)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 | #![deny(intra_doc_link_resolution_failure)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/intra-links-warning.stderr
Expand Up @@ -4,7 +4,7 @@ warning: `[Foo::baz]` cannot be resolved, ignoring it...
13 | //! Test with [Foo::baz], [Bar::foo], ...
| ^^^^^^^^ cannot be resolved, ignoring
|
= note: #[warn(intra_link_resolution_failure)] on by default
= note: #[warn(intra_doc_link_resolution_failure)] on by default
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`

warning: `[Bar::foo]` cannot be resolved, ignoring it...
Expand Down

0 comments on commit d2a4e42

Please sign in to comment.