Skip to content

Commit f92b931

Browse files
committed
Auto merge of #77856 - GuillaumeGomez:automatic-links-lint, r=jyn514,ollie27
Add non_autolinks lint Part of #77501. r? `@jyn514`
2 parents 9d78d1d + 99200f7 commit f92b931

File tree

34 files changed

+425
-37
lines changed

34 files changed

+425
-37
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4297,6 +4297,7 @@ dependencies = [
42974297
"itertools 0.9.0",
42984298
"minifier",
42994299
"pulldown-cmark 0.8.0",
4300+
"regex",
43004301
"rustc-rayon",
43014302
"serde",
43024303
"serde_json",

compiler/rustc_codegen_cranelift/src/discriminant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Handling of enum discriminants
22
//!
3-
//! Adapted from https://github.com/rust-lang/rust/blob/d760df5aea483aae041c9a241e7acacf48f75035/src/librustc_codegen_ssa/mir/place.rs
3+
//! Adapted from <https://github.com/rust-lang/rust/blob/d760df5aea483aae041c9a241e7acacf48f75035/src/librustc_codegen_ssa/mir/place.rs>
44
55
use rustc_target::abi::{Int, TagEncoding, Variants};
66

compiler/rustc_lint/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ use rustc_middle::ty::TyCtxt;
6969
use rustc_session::lint::builtin::{
7070
BARE_TRAIT_OBJECTS, BROKEN_INTRA_DOC_LINKS, ELIDED_LIFETIMES_IN_PATHS,
7171
EXPLICIT_OUTLIVES_REQUIREMENTS, INVALID_CODEBLOCK_ATTRIBUTES, INVALID_HTML_TAGS,
72-
MISSING_DOC_CODE_EXAMPLES, PRIVATE_DOC_TESTS,
72+
MISSING_DOC_CODE_EXAMPLES, NON_AUTOLINKS, PRIVATE_DOC_TESTS,
7373
};
7474
use rustc_span::symbol::{Ident, Symbol};
7575
use rustc_span::Span;
@@ -313,6 +313,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) {
313313

314314
add_lint_group!(
315315
"rustdoc",
316+
NON_AUTOLINKS,
316317
BROKEN_INTRA_DOC_LINKS,
317318
PRIVATE_INTRA_DOC_LINKS,
318319
INVALID_CODEBLOCK_ATTRIBUTES,

compiler/rustc_lint_defs/src/builtin.rs

+12
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,17 @@ declare_lint! {
18901890
"detects invalid HTML tags in doc comments"
18911891
}
18921892

1893+
declare_lint! {
1894+
/// The `non_autolinks` lint detects when a URL could be written using
1895+
/// only angle brackets. This is a `rustdoc` only lint, see the
1896+
/// documentation in the [rustdoc book].
1897+
///
1898+
/// [rustdoc book]: ../../../rustdoc/lints.html#non_autolinks
1899+
pub NON_AUTOLINKS,
1900+
Warn,
1901+
"detects URLs that could be written using only angle brackets"
1902+
}
1903+
18931904
declare_lint! {
18941905
/// The `where_clauses_object_safety` lint detects for [object safety] of
18951906
/// [where clauses].
@@ -2795,6 +2806,7 @@ declare_lint_pass! {
27952806
MISSING_DOC_CODE_EXAMPLES,
27962807
INVALID_HTML_TAGS,
27972808
PRIVATE_DOC_TESTS,
2809+
NON_AUTOLINKS,
27982810
WHERE_CLAUSES_OBJECT_SAFETY,
27992811
PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
28002812
MACRO_USE_EXTERN_CRATE,

compiler/rustc_lint_defs/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ pub struct Lint {
9999
/// The name is written with underscores, e.g., "unused_imports".
100100
/// On the command line, underscores become dashes.
101101
///
102-
/// See https://rustc-dev-guide.rust-lang.org/diagnostics.html#lint-naming
102+
/// See <https://rustc-dev-guide.rust-lang.org/diagnostics.html#lint-naming>
103103
/// for naming guidelines.
104104
pub name: &'static str,
105105

106106
/// Default level for the lint.
107107
///
108-
/// See https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-levels
108+
/// See <https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-levels>
109109
/// for guidelines on choosing a default level.
110110
pub default_level: Level,
111111

@@ -330,8 +330,8 @@ impl LintBuffer {
330330

331331
/// Declares a static item of type `&'static Lint`.
332332
///
333-
/// See https://rustc-dev-guide.rust-lang.org/diagnostics.html for documentation
334-
/// and guidelines on writing lints.
333+
/// See <https://rustc-dev-guide.rust-lang.org/diagnostics.html> for
334+
/// documentation and guidelines on writing lints.
335335
///
336336
/// The macro call should start with a doc comment explaining the lint
337337
/// which will be embedded in the rustc user documentation book. It should

compiler/rustc_middle/src/mir/coverage.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ rustc_index::newtype_index! {
1717
impl ExpressionOperandId {
1818
/// An expression operand for a "zero counter", as described in the following references:
1919
///
20-
/// * https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#counter
21-
/// * https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#tag
22-
/// * https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#counter-expressions
20+
/// * <https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#counter>
21+
/// * <https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#tag>
22+
/// * <https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#counter-expressions>
2323
///
2424
/// This operand can be used to count two or more separate code regions with a single counter,
2525
/// if they run sequentially with no branches, by injecting the `Counter` in a `BasicBlock` for

compiler/rustc_middle/src/mir/mono.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub struct CodegenUnit<'tcx> {
228228

229229
/// Specifies the linkage type for a `MonoItem`.
230230
///
231-
/// See https://llvm.org/docs/LangRef.html#linkage-types for more details about these variants.
231+
/// See <https://llvm.org/docs/LangRef.html#linkage-types> for more details about these variants.
232232
#[derive(Copy, Clone, PartialEq, Debug, TyEncodable, TyDecodable, HashStable)]
233233
pub enum Linkage {
234234
External,

compiler/rustc_middle/src/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ pub struct TypeckResults<'tcx> {
368368
/// leads to a `vec![&&Option<i32>, &Option<i32>]`. Empty vectors are not stored.
369369
///
370370
/// See:
371-
/// https://github.com/rust-lang/rfcs/blob/master/text/2005-match-ergonomics.md#definitions
371+
/// <https://github.com/rust-lang/rfcs/blob/master/text/2005-match-ergonomics.md#definitions>
372372
pat_adjustments: ItemLocalMap<Vec<Ty<'tcx>>>,
373373

374374
/// Borrows

compiler/rustc_mir/src/borrow_check/region_infer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
13641364
/// terms that the "longer free region" `'a` outlived the "shorter free region" `'b`.
13651365
///
13661366
/// More details can be found in this blog post by Niko:
1367-
/// http://smallcultfollowing.com/babysteps/blog/2019/01/17/polonius-and-region-errors/
1367+
/// <http://smallcultfollowing.com/babysteps/blog/2019/01/17/polonius-and-region-errors/>
13681368
///
13691369
/// In the canonical example
13701370
///

compiler/rustc_mir/src/transform/dest_prop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! inside a single block to shuffle a value around unnecessarily.
99
//!
1010
//! LLVM by itself is not good enough at eliminating these redundant copies (eg. see
11-
//! https://github.com/rust-lang/rust/issues/32966), so this leaves some performance on the table
11+
//! <https://github.com/rust-lang/rust/issues/32966>), so this leaves some performance on the table
1212
//! that we can regain by implementing an optimization for removing these assign statements in rustc
1313
//! itself. When this optimization runs fast enough, it can also speed up the constant evaluation
1414
//! and code generation phases of rustc due to the reduced number of statements and locals.

compiler/rustc_mir_build/src/thir/pattern/_match.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! (b) each pattern is necessary (usefulness)
99
//!
1010
//! The algorithm implemented here is a modified version of the one described in:
11-
//! http://moscova.inria.fr/~maranget/papers/warn/index.html
11+
//! <http://moscova.inria.fr/~maranget/papers/warn/index.html>
1212
//! However, to save future implementors from reading the original paper, we
1313
//! summarise the algorithm here to hopefully save time and be a little clearer
1414
//! (without being so rigorous).
@@ -2040,7 +2040,7 @@ impl<'tcx> MissingConstructors<'tcx> {
20402040
}
20412041
}
20422042

2043-
/// Algorithm from http://moscova.inria.fr/~maranget/papers/warn/index.html.
2043+
/// Algorithm from <http://moscova.inria.fr/~maranget/papers/warn/index.html>.
20442044
/// The algorithm from the paper has been modified to correctly handle empty
20452045
/// types. The changes are:
20462046
/// (0) We don't exit early if the pattern matrix has zero rows. We just

compiler/rustc_parse/src/lexer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ impl<'a> StringReader<'a> {
511511
}
512512

513513
/// Note: It was decided to not add a test case, because it would be to big.
514-
/// https://github.com/rust-lang/rust/pull/50296#issuecomment-392135180
514+
/// <https://github.com/rust-lang/rust/pull/50296#issuecomment-392135180>
515515
fn report_too_many_hashes(&self, start: BytePos, found: usize) -> ! {
516516
self.fatal_span_(
517517
start,

compiler/rustc_privacy/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use std::{cmp, fmt, mem};
3838
/// Implemented to visit all `DefId`s in a type.
3939
/// Visiting `DefId`s is useful because visibilities and reachabilities are attached to them.
4040
/// The idea is to visit "all components of a type", as documented in
41-
/// https://github.com/rust-lang/rfcs/blob/master/text/2145-type-privacy.md#how-to-determine-visibility-of-a-type.
41+
/// <https://github.com/rust-lang/rfcs/blob/master/text/2145-type-privacy.md#how-to-determine-visibility-of-a-type>.
4242
/// The default type visitor (`TypeVisitor`) does most of the job, but it has some shortcomings.
4343
/// First, it doesn't have overridable `fn visit_trait_ref`, so we have to catch trait `DefId`s
4444
/// manually. Second, it doesn't visit some type components like signatures of fn types, or traits

compiler/rustc_target/src/spec/crt_objects.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//!
44
//! Table of CRT objects for popular toolchains.
55
//! The `crtx` ones are generally distributed with libc and the `begin/end` ones with gcc.
6-
//! See https://dev.gentoo.org/~vapier/crt.txt for some more details.
6+
//! See <https://dev.gentoo.org/~vapier/crt.txt> for some more details.
77
//!
88
//! | Pre-link CRT objects | glibc | musl | bionic | mingw | wasi |
99
//! |----------------------|------------------------|------------------------|------------------|-------------------|------|

compiler/rustc_target/src/spec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ pub struct TargetOptions {
950950
/// The MergeFunctions pass is generally useful, but some targets may need
951951
/// to opt out. The default is "aliases".
952952
///
953-
/// Workaround for: https://github.com/rust-lang/rust/issues/57356
953+
/// Workaround for: <https://github.com/rust-lang/rust/issues/57356>
954954
pub merge_functions: MergeFunctions,
955955

956956
/// Use platform dependent mcount function

compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! (e.g. trying to create a TCP stream or something like that).
99
//!
1010
//! This target is more or less managed by the Rust and WebAssembly Working
11-
//! Group nowadays at https://github.com/rustwasm.
11+
//! Group nowadays at <https://github.com/rustwasm>.
1212
1313
use super::wasm32_base;
1414
use super::{LinkerFlavor, LldFlavor, Target};

compiler/rustc_target/src/spec/wasm32_wasi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! intended to empower WebAssembly binaries with native capabilities such as
88
//! filesystem access, network access, etc.
99
//!
10-
//! You can see more about the proposal at https://wasi.dev
10+
//! You can see more about the proposal at <https://wasi.dev>.
1111
//!
1212
//! The Rust target definition here is interesting in a few ways. We want to
1313
//! serve two use cases here with this target:

compiler/rustc_trait_selection/src/traits/object_safety.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ fn object_ty_for_trait<'tcx>(
621621
///
622622
/// In practice, we cannot use `dyn Trait` explicitly in the obligation because it would result
623623
/// in a new check that `Trait` is object safe, creating a cycle (until object_safe_for_dispatch
624-
/// is stabilized, see tracking issue https://github.com/rust-lang/rust/issues/43561).
624+
/// is stabilized, see tracking issue <https://github.com/rust-lang/rust/issues/43561>).
625625
/// Instead, we fudge a little by introducing a new type parameter `U` such that
626626
/// `Self: Unsize<U>` and `U: Trait + ?Sized`, and use `U` in place of `dyn Trait`.
627627
/// Written as a chalk-style query:

library/core/src/future/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub use poll_fn::{poll_fn, PollFn};
3232
/// This type is needed because:
3333
///
3434
/// a) Generators cannot implement `for<'a, 'b> Generator<&'a mut Context<'b>>`, so we need to pass
35-
/// a raw pointer (see https://github.com/rust-lang/rust/issues/68923).
35+
/// a raw pointer (see <https://github.com/rust-lang/rust/issues/68923>).
3636
/// b) Raw pointers and `NonNull` aren't `Send` or `Sync`, so that would make every single future
3737
/// non-Send/Sync as well, and we don't want that.
3838
///

library/core/src/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! This includes changes in the stability of the constness.
1010
//!
1111
//! In order to make an intrinsic usable at compile-time, one needs to copy the implementation
12-
//! from https://github.com/rust-lang/miri/blob/master/src/shims/intrinsics.rs to
12+
//! from <https://github.com/rust-lang/miri/blob/master/src/shims/intrinsics.rs> to
1313
//! `compiler/rustc_mir/src/interpret/intrinsics.rs` and add a
1414
//! `#[rustc_const_unstable(feature = "foo", issue = "01234")]` to the intrinsic.
1515
//!

library/core/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ pub mod primitive;
287287
unused_imports,
288288
unsafe_op_in_unsafe_fn
289289
)]
290+
#[cfg_attr(not(bootstrap), allow(non_autolinks))]
290291
// FIXME: This annotation should be moved into rust-lang/stdarch after clashing_extern_declarations is
291292
// merged. It currently cannot because bootstrap fails as the lint hasn't been defined yet.
292293
#[allow(clashing_extern_declarations)]

library/core/src/num/dec2flt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
//!
3434
//! Primarily, this module and its children implement the algorithms described in:
3535
//! "How to Read Floating Point Numbers Accurately" by William D. Clinger,
36-
//! available online: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.45.4152
36+
//! available online: <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.45.4152>
3737
//!
3838
//! In addition, there are numerous helper functions that are used in the paper but not available
3939
//! in Rust (or at least in core). Our version is additionally complicated by the need to handle

library/core/src/slice/sort.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Slice sorting
22
//!
33
//! This module contains a sorting algorithm based on Orson Peters' pattern-defeating quicksort,
4-
//! published at: https://github.com/orlp/pdqsort
4+
//! published at: <https://github.com/orlp/pdqsort>
55
//!
66
//! Unstable sorting is compatible with libcore because it doesn't allocate memory, unlike our
77
//! stable sorting implementation.

library/panic_unwind/src/dwarf/eh.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Parsing of GCC-style Language-Specific Data Area (LSDA)
22
//! For details see:
3-
//! http://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-PDA/LSB-PDA/ehframechpt.html
4-
//! http://mentorembedded.github.io/cxx-abi/exceptions.pdf
5-
//! http://www.airs.com/blog/archives/460
6-
//! http://www.airs.com/blog/archives/464
3+
//! * <http://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-PDA/LSB-PDA/ehframechpt.html>
4+
//! * <http://mentorembedded.github.io/cxx-abi/exceptions.pdf>
5+
//! * <http://www.airs.com/blog/archives/460>
6+
//! * <http://www.airs.com/blog/archives/464>
77
//!
88
//! A reference implementation may be found in the GCC source tree
99
//! (`<root>/libgcc/unwind-c.c` as of this writing).

library/panic_unwind/src/gcc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
//! "Exception Handling in LLVM" (llvm.org/docs/ExceptionHandling.html) and
55
//! documents linked from it.
66
//! These are also good reads:
7-
//! https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html
8-
//! http://monoinfinito.wordpress.com/series/exception-handling-in-c/
9-
//! http://www.airs.com/blog/index.php?s=exception+frames
7+
//! * <https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html>
8+
//! * <http://monoinfinito.wordpress.com/series/exception-handling-in-c/>
9+
//! * <http://www.airs.com/blog/index.php?s=exception+frames>
1010
//!
1111
//! ## A brief summary
1212
//!

src/bootstrap/toolstate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl Step for ToolStateCheck {
152152
/// error if there are any.
153153
///
154154
/// This also handles publishing the results to the `history` directory of
155-
/// the toolstate repo https://github.com/rust-lang-nursery/rust-toolstate
155+
/// the toolstate repo <https://github.com/rust-lang-nursery/rust-toolstate>
156156
/// if the env var `TOOLSTATE_PUBLISH` is set. Note that there is a
157157
/// *separate* step of updating the `latest.json` file and creating GitHub
158158
/// issues and comments in `src/ci/publish_toolstate.sh`, which is only
@@ -162,7 +162,7 @@ impl Step for ToolStateCheck {
162162
/// The rules for failure are:
163163
/// * If the PR modifies a tool, the status must be test-pass.
164164
/// NOTE: There is intent to change this, see
165-
/// https://github.com/rust-lang/rust/issues/65000.
165+
/// <https://github.com/rust-lang/rust/issues/65000>.
166166
/// * All "stable" tools must be test-pass on the stable or beta branches.
167167
/// * During beta promotion week, a PR is not allowed to "regress" a
168168
/// stable tool. That is, the status is not allowed to get worse

src/build_helper/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ macro_rules! t {
3232

3333
/// Reads an environment variable and adds it to dependencies.
3434
/// Supposed to be used for all variables except those set for build scripts by cargo
35-
/// https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
35+
/// <https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts>
3636
pub fn tracked_env_var_os<K: AsRef<OsStr> + Display>(key: K) -> Option<OsString> {
3737
println!("cargo:rerun-if-env-changed={}", key);
3838
env::var_os(key)

src/doc/rustdoc/src/lints.md

+38
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,41 @@ warning: unclosed HTML tag `h1`
285285
286286
warning: 2 warnings emitted
287287
```
288+
289+
## non_autolinks
290+
291+
This lint is **nightly-only** and **warns by default**. It detects links which
292+
could use the "automatic" link syntax. For example:
293+
294+
```rust
295+
/// http://example.org
296+
/// [http://example.com](http://example.com)
297+
/// [http://example.net]
298+
///
299+
/// [http://example.com]: http://example.com
300+
pub fn foo() {}
301+
```
302+
303+
Which will give:
304+
305+
```text
306+
warning: this URL is not a hyperlink
307+
--> foo.rs:1:5
308+
|
309+
1 | /// http://example.org
310+
| ^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://example.org>`
311+
|
312+
= note: `#[warn(non_autolinks)]` on by default
313+
314+
warning: unneeded long form for URL
315+
--> foo.rs:2:5
316+
|
317+
2 | /// [http://example.com](http://example.com)
318+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://example.com>`
319+
320+
warning: this URL is not a hyperlink
321+
--> foo.rs:3:6
322+
|
323+
3 | /// [http://example.net]
324+
| ^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://example.net>`
325+
```

src/librustdoc/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ serde_json = "1.0"
1616
smallvec = "1.0"
1717
tempfile = "3"
1818
itertools = "0.9"
19+
regex = "1"
1920

2021
[dev-dependencies]
2122
expect-test = "1.0"

src/librustdoc/core.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ pub fn run_core(
330330
let invalid_codeblock_attributes_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name;
331331
let invalid_html_tags = rustc_lint::builtin::INVALID_HTML_TAGS.name;
332332
let renamed_and_removed_lints = rustc_lint::builtin::RENAMED_AND_REMOVED_LINTS.name;
333+
let non_autolinks = rustc_lint::builtin::NON_AUTOLINKS.name;
333334
let unknown_lints = rustc_lint::builtin::UNKNOWN_LINTS.name;
334335

335336
// In addition to those specific lints, we also need to allow those given through
@@ -344,6 +345,7 @@ pub fn run_core(
344345
invalid_html_tags.to_owned(),
345346
renamed_and_removed_lints.to_owned(),
346347
unknown_lints.to_owned(),
348+
non_autolinks.to_owned(),
347349
];
348350

349351
let (lint_opts, lint_caps) = init_lints(lints_to_show, lint_opts, |lint| {
@@ -663,7 +665,7 @@ fn run_global_ctxt(
663665
(krate, ctxt.renderinfo.into_inner(), ctxt.render_options)
664666
}
665667

666-
/// Due to https://github.com/rust-lang/rust/pull/73566,
668+
/// Due to <https://github.com/rust-lang/rust/pull/73566>,
667669
/// the name resolution pass may find errors that are never emitted.
668670
/// If typeck is called after this happens, then we'll get an ICE:
669671
/// 'Res::Error found but not reported'. To avoid this, emit the errors now.

0 commit comments

Comments
 (0)