-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: improve refdef handling in the unresolved link lint #136363
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,24 +117,49 @@ pub struct WLinkToCloneWithUnmatchedEscapedCloseParenAndDoubleSpace; | |
|
||
// References | ||
|
||
/// The [cln][] link here is going to be unresolved, because `Clone()` gets rejected //~ERROR link | ||
/// in Markdown for not being URL-shaped enough. | ||
/// | ||
/// [cln]: Clone() //~ERROR link | ||
/// The [cln][] link here is going to be unresolved, because `Clone()` gets | ||
//~^ ERROR link | ||
/// rejected in Markdown for not being URL-shaped enough. | ||
/// [cln]: Clone() | ||
//~^ ERROR link | ||
pub struct LinkToCloneWithParensInReference; | ||
|
||
/// The [cln][] link here is going to be unresolved, because `struct@Clone` gets //~ERROR link | ||
/// rejected in Markdown for not being URL-shaped enough. | ||
Comment on lines
-126
to
-127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment was wrong.
By using a below-the-line comment, I can work around that and demonstrate the change correctly. |
||
/// The [cln][] link here is going to produce a good inline suggestion | ||
/// | ||
/// [cln]: struct@Clone //~ERROR link | ||
/// [cln]: struct@Clone | ||
//~^ ERROR link | ||
pub struct LinkToCloneWithWrongPrefix; | ||
|
||
/// The [cln][] link here will produce a plain text suggestion //~ERROR link | ||
/// The [cln][] link here will produce a good inline suggestion | ||
/// | ||
/// [cln]: Clone\(\) | ||
//~^ ERROR link | ||
pub struct LinkToCloneWithEscapedParensInReference; | ||
|
||
/// The [cln][] link here will produce a plain text suggestion //~ERROR link | ||
/// The [cln][] link here will produce a good inline suggestion | ||
/// | ||
/// [cln]: struct\@Clone | ||
//~^ ERROR link | ||
pub struct LinkToCloneWithEscapedAtsInReference; | ||
|
||
|
||
/// This link reference definition isn't used, but since it is still parsed, | ||
/// it should still produce a warning. | ||
/// | ||
/// [cln]: struct\@Clone | ||
//~^ ERROR link | ||
pub struct UnusedLinkToCloneReferenceDefinition; | ||
|
||
/// <https://github.com/rust-lang/rust/issues/133150> | ||
/// | ||
/// - [`SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER`]: the | ||
//~^ ERROR link | ||
/// `(__unsafe_unretained)` NSWindow associated with the window, if you want | ||
/// to wrap an existing window. | ||
/// - [`SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER`]: the `(__unsafe_unretained)` | ||
/// NSView associated with the window, defaults to `[window contentView]` | ||
pub fn a() {} | ||
#[allow(nonstandard_style)] | ||
pub struct SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER; | ||
#[allow(nonstandard_style)] | ||
pub struct SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is run on a compiler's happy path, when rustdoc and its lints are not involved.
Could you do a perf run before merging this?