Skip to content

Rollup of 8 pull requests #82749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 29 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fbd575a
process::unix: Handle other wait statuses in ExitStatus as Display
ijackson Feb 22, 2021
d8cfd56
process::unix: Test wait status formatting
ijackson Feb 22, 2021
4bb8425
ExitStatus: Improve documentation re wait status vs exit status
ijackson Feb 22, 2021
2f04a79
Revert `Vec::spare_capacity_mut` impl to prevent pointers invalidation
WaffleLapkin Feb 26, 2021
cc62018
Rename rustdoc lints to be a tool lint instead of built-in.
jyn514 Dec 30, 2020
37e4cfe
Move lint machinery into a separate file
jyn514 Dec 30, 2020
7195355
Add `declare_rustdoc_lint!` macro
jyn514 Dec 30, 2020
e8ddfda
Improve error messages
jyn514 Jan 17, 2021
0517ea7
Address review comments
jyn514 Jan 18, 2021
c7535d1
Update comments
jyn514 Jan 19, 2021
75efb6e
Test that using the previous lint names still applies the lint
jyn514 Feb 28, 2021
c194849
Fix stabilization version of move_ref_pattern
jplatte Mar 2, 2021
768d5e9
Load rustdoc's JS search index on-demand.
jsha Feb 20, 2021
9c4e3af
Add test that Vec::spare_capacity_mut doesn't invalidate pointers
WaffleLapkin Mar 2, 2021
a1835bc
Make Vec::split_at_spare_mut impl safer & simplier
WaffleLapkin Mar 2, 2021
d3e7ffa
Improve page load performance in rustdoc.
jsha Feb 20, 2021
5824917
Account for macros when suggesting adding lifetime
estebank Mar 3, 2021
f9cfe15
Use Arial as fallback font instead of sans-serif.
jsha Mar 3, 2021
950f121
Update library/alloc/src/vec/mod.rs
WaffleLapkin Mar 3, 2021
5d0697b
reworded message
estebank Mar 3, 2021
a705a58
Fix commit detected when using `download-rustc`
jyn514 Mar 4, 2021
7619837
Rollup merge of #80527 - jyn514:rustdoc-lints, r=GuillaumeGomez
JohnTitor Mar 4, 2021
22f5255
Rollup merge of #82310 - jsha:rustdoc-search-onfocus, r=GuillaumeGomez
JohnTitor Mar 4, 2021
0856c3a
Rollup merge of #82315 - jsha:font-display-swap, r=GuillaumeGomez
JohnTitor Mar 4, 2021
346fca8
Rollup merge of #82411 - ijackson:fix-exitstatus, r=dtolnay
JohnTitor Mar 4, 2021
d444700
Rollup merge of #82564 - WaffleLapkin:revert_spare_mut, r=RalfJung
JohnTitor Mar 4, 2021
d892d31
Rollup merge of #82697 - jplatte:patch-1, r=davidtwco
JohnTitor Mar 4, 2021
ccbb37c
Rollup merge of #82717 - estebank:issue-70152, r=lcnr
JohnTitor Mar 4, 2021
7511bde
Rollup merge of #82740 - jyn514:proper-history, r=Mark-Simulacrum
JohnTitor Mar 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add declare_rustdoc_lint! macro
  • Loading branch information
jyn514 committed Mar 2, 2021
commit 719535576738ee97a866ce7fbf76a42d6399627b
36 changes: 22 additions & 14 deletions src/librustdoc/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,78 +63,86 @@ where
(lint_opts, lint_caps)
}

declare_tool_lint! {
macro_rules! declare_rustdoc_lint {
($(#[$attr:meta])* $name: ident, $level: ident, $descr: literal $(,)?) => {
declare_tool_lint! {
$(#[$attr])* pub rustdoc::$name, $level, $descr
}
}
}

declare_rustdoc_lint! {
/// The `broken_intra_doc_links` lint detects failures in resolving
/// intra-doc link targets. This is a `rustdoc` only lint, see the
/// documentation in the [rustdoc book].
///
/// [rustdoc book]: ../../../rustdoc/lints.html#broken_intra_doc_links
pub rustdoc::BROKEN_INTRA_DOC_LINKS,
BROKEN_INTRA_DOC_LINKS,
Warn,
"failures in resolving intra-doc link targets"
}

declare_tool_lint! {
declare_rustdoc_lint! {
/// This is a subset of `broken_intra_doc_links` that warns when linking from
/// a public item to a private one. This is a `rustdoc` only lint, see the
/// documentation in the [rustdoc book].
///
/// [rustdoc book]: ../../../rustdoc/lints.html#private_intra_doc_links
pub rustdoc::PRIVATE_INTRA_DOC_LINKS,
PRIVATE_INTRA_DOC_LINKS,
Warn,
"linking from a public item to a private one"
}

declare_tool_lint! {
declare_rustdoc_lint! {
/// The `invalid_codeblock_attributes` lint detects code block attributes
/// in documentation examples that have potentially mis-typed values. This
/// is a `rustdoc` only lint, see the documentation in the [rustdoc book].
///
/// [rustdoc book]: ../../../rustdoc/lints.html#invalid_codeblock_attributes
pub rustdoc::INVALID_CODEBLOCK_ATTRIBUTES,
INVALID_CODEBLOCK_ATTRIBUTES,
Warn,
"codeblock attribute looks a lot like a known one"
}

declare_tool_lint! {
declare_rustdoc_lint! {
/// The `missing_doc_code_examples` lint detects publicly-exported items
/// without code samples in their documentation. This is a `rustdoc` only
/// lint, see the documentation in the [rustdoc book].
///
/// [rustdoc book]: ../../../rustdoc/lints.html#missing_doc_code_examples
pub rustdoc::MISSING_DOC_CODE_EXAMPLES,
MISSING_DOC_CODE_EXAMPLES,
Allow,
"detects publicly-exported items without code samples in their documentation"
}

declare_tool_lint! {
declare_rustdoc_lint! {
/// The `private_doc_tests` lint detects code samples in docs of private
/// items not documented by `rustdoc`. This is a `rustdoc` only lint, see
/// the documentation in the [rustdoc book].
///
/// [rustdoc book]: ../../../rustdoc/lints.html#private_doc_tests
pub rustdoc::PRIVATE_DOC_TESTS,
PRIVATE_DOC_TESTS,
Allow,
"detects code samples in docs of private items not documented by rustdoc"
}

declare_tool_lint! {
declare_rustdoc_lint! {
/// The `invalid_html_tags` lint detects invalid HTML tags. This is a
/// `rustdoc` only lint, see the documentation in the [rustdoc book].
///
/// [rustdoc book]: ../../../rustdoc/lints.html#invalid_html_tags
pub rustdoc::INVALID_HTML_TAGS,
INVALID_HTML_TAGS,
Allow,
"detects invalid HTML tags in doc comments"
}

declare_tool_lint! {
declare_rustdoc_lint! {
/// The `non_autolinks` lint detects when a URL could be written using
/// only angle brackets. This is a `rustdoc` only lint, see the
/// documentation in the [rustdoc book].
///
/// [rustdoc book]: ../../../rustdoc/lints.html#non_autolinks
pub rustdoc::NON_AUTOLINKS,
NON_AUTOLINKS,
Warn,
"detects URLs that could be written using only angle brackets"
}
Expand Down