@@ -1817,35 +1817,10 @@ declare_lint! {
1817
1817
1818
1818
declare_lint ! {
1819
1819
/// The `broken_intra_doc_links` lint detects failures in resolving
1820
- /// intra-doc link targets. This is a `rustdoc` only lint, and only works
1821
- /// on the [**nightly channel** ].
1820
+ /// intra-doc link targets. This is a `rustdoc` only lint, see the
1821
+ /// documentation in the [rustdoc book ].
1822
1822
///
1823
- /// [**nightly channel**]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
1824
- ///
1825
- /// ### Example
1826
- ///
1827
- /// ```rust,rustdoc
1828
- /// /// This is a doc comment.
1829
- /// ///
1830
- /// /// See also [`bar`].
1831
- /// pub fn foo() {
1832
- /// }
1833
- /// ```
1834
- ///
1835
- /// {{produces}}
1836
- ///
1837
- /// ### Explanation
1838
- ///
1839
- /// `rustdoc` allows [linking to items by name][intra] which will
1840
- /// automatically generate links in the documentation to the item. This
1841
- /// lint is issued when `rustdoc` is unable to find the named item. Check
1842
- /// that the name is correct, that it is in scope, or if you need to
1843
- /// qualify it with a path. If you intended to have square brackets appear
1844
- /// literally in the text, surround the brackets with backticks such as ``
1845
- /// `[example]` `` to indicate a code span, or prefix it with a backslash
1846
- /// such as `\[example]`.
1847
- ///
1848
- /// [intra]: https://doc.rust-lang.org/nightly/rustdoc/unstable-features.html#linking-to-items-by-name
1823
+ /// [rustdoc book]: ../../../rustdoc/lints.html#broken_intra_doc_links
1849
1824
pub BROKEN_INTRA_DOC_LINKS ,
1850
1825
Warn ,
1851
1826
"failures in resolving intra-doc link targets"
@@ -1854,52 +1829,20 @@ declare_lint! {
1854
1829
declare_lint ! {
1855
1830
/// The `invalid_codeblock_attributes` lint detects code block attributes
1856
1831
/// in documentation examples that have potentially mis-typed values. This
1857
- /// is a `rustdoc` only lint.
1858
- ///
1859
- /// ### Example
1832
+ /// is a `rustdoc` only lint, see the documentation in the [rustdoc book].
1860
1833
///
1861
- /// ```rust,rustdoc
1862
- /// /// Example.
1863
- /// ///
1864
- /// /// ```should-panic
1865
- /// /// assert_eq!(1, 2);
1866
- /// /// ```
1867
- /// pub fn foo() {}
1868
- /// ```
1869
- ///
1870
- /// {{produces}}
1871
- ///
1872
- /// ### Explanation
1873
- ///
1874
- /// This lint is issued when `rustdoc` detects an example code block
1875
- /// attribute that appears similar to a valid one. In the example above,
1876
- /// the correct form is `should_panic`. This helps detect typo mistakes
1877
- /// for some common attributes.
1834
+ /// [rustdoc book]: ../../../rustdoc/lints.html#invalid_codeblock_attributes
1878
1835
pub INVALID_CODEBLOCK_ATTRIBUTES ,
1879
1836
Warn ,
1880
1837
"codeblock attribute looks a lot like a known one"
1881
1838
}
1882
1839
1883
1840
declare_lint ! {
1884
1841
/// The `missing_crate_level_docs` lint detects if documentation is
1885
- /// missing at the crate root. This is a `rustdoc` only lint. This is a
1886
- /// `rustdoc` only lint.
1887
- ///
1888
- /// ### Example
1889
- ///
1890
- /// ```rust,rustdoc
1891
- /// #![deny(missing_crate_level_docs)]
1892
- /// ```
1893
- ///
1894
- /// {{produces}}
1895
- ///
1896
- /// ### Explanation
1842
+ /// missing at the crate root. This is a `rustdoc` only lint, see the
1843
+ /// documentation in the [rustdoc book].
1897
1844
///
1898
- /// This lint causes `rustdoc` to check if the crate root is missing
1899
- /// documentation. This is currently "allow" by default, but it is
1900
- /// intended to make this a warning in the future. This is intended as a
1901
- /// means to introduce new users on *how* to document their crate by
1902
- /// pointing them to some instructions on how to get started.
1845
+ /// [rustdoc book]: ../../../rustdoc/lints.html#missing_crate_level_docs
1903
1846
pub MISSING_CRATE_LEVEL_DOCS ,
1904
1847
Allow ,
1905
1848
"detects crates with no crate-level documentation"
@@ -1908,75 +1851,20 @@ declare_lint! {
1908
1851
declare_lint ! {
1909
1852
/// The `missing_doc_code_examples` lint detects publicly-exported items
1910
1853
/// without code samples in their documentation. This is a `rustdoc` only
1911
- /// lint, and only works on the [**nightly channel** ].
1854
+ /// lint, see the documentation in the [rustdoc book ].
1912
1855
///
1913
- /// [**nightly channel**]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
1914
- ///
1915
- /// ### Example
1916
- ///
1917
- /// ```rust,rustdoc
1918
- /// #![warn(missing_doc_code_examples)]
1919
- ///
1920
- /// /// There is no code example!
1921
- /// pub fn no_code_example() {}
1922
- /// ```
1923
- ///
1924
- /// {{produces}}
1925
- ///
1926
- /// ### Explanation
1927
- ///
1928
- /// This lint is to ensure a high level of quality for documentation. Code
1929
- /// examples can be very useful to see how to use an API. To add an
1930
- /// example, include a markdown code block with an example of how to use
1931
- /// the item, such as:
1932
- ///
1933
- /// ```rust
1934
- /// /// Adds one to the number given.
1935
- /// ///
1936
- /// /// # Examples
1937
- /// ///
1938
- /// /// ```
1939
- /// /// let arg = 5;
1940
- /// /// let answer = my_crate::add_one(arg);
1941
- /// ///
1942
- /// /// assert_eq!(6, answer);
1943
- /// /// ```
1944
- /// pub fn add_one(x: i32) -> i32 {
1945
- /// x + 1
1946
- /// }
1947
- /// ```
1856
+ /// [rustdoc book]: ../../../rustdoc/lints.html#missing_doc_code_examples
1948
1857
pub MISSING_DOC_CODE_EXAMPLES ,
1949
1858
Allow ,
1950
1859
"detects publicly-exported items without code samples in their documentation"
1951
1860
}
1952
1861
1953
1862
declare_lint ! {
1954
1863
/// The `private_doc_tests` lint detects code samples in docs of private
1955
- /// items not documented by `rustdoc`. This is a `rustdoc` only lint.
1956
- ///
1957
- /// ### Example
1958
- ///
1959
- /// ```rust,rustdoc
1960
- /// #![deny(private_doc_tests)]
1864
+ /// items not documented by `rustdoc`. This is a `rustdoc` only lint, see
1865
+ /// the documentation in the [rustdoc book].
1961
1866
///
1962
- /// mod foo {
1963
- /// /// private doc test
1964
- /// ///
1965
- /// /// ```
1966
- /// /// assert!(false);
1967
- /// /// ```
1968
- /// fn bar() {}
1969
- /// }
1970
- /// ```
1971
- ///
1972
- /// {{produces}}
1973
- ///
1974
- /// ### Explanation
1975
- ///
1976
- /// Because documentation examples link against the public API of the
1977
- /// crate, it is not possible for an example to access a private item.
1978
- /// This means it was likely a mistake to add a code example to a private
1979
- /// item.
1867
+ /// [rustdoc book]: ../../../rustdoc/lints.html#private_doc_tests
1980
1868
pub PRIVATE_DOC_TESTS ,
1981
1869
Allow ,
1982
1870
"detects code samples in docs of private items not documented by rustdoc"
0 commit comments