diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-02-16 18:33:14 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-02-18 23:24:58 +0100 |
| commit | fd62036caa266460bcdee5adc370232751e6eb0d (patch) | |
| tree | a9943212fa290db6cb29f99ad63edb66f41ffbe3 /compiler/rustc_resolve/src/rustdoc.rs | |
| parent | 9a7cc6c32f1a690f86827e4724bcda85e506ef35 (diff) | |
| download | rust-fd62036caa266460bcdee5adc370232751e6eb0d.tar.gz rust-fd62036caa266460bcdee5adc370232751e6eb0d.zip | |
Correctly handle if a link starts with a whitespace
Diffstat (limited to 'compiler/rustc_resolve/src/rustdoc.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/rustdoc.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/rustdoc.rs b/compiler/rustc_resolve/src/rustdoc.rs index 3425e24585c..74c0527d33f 100644 --- a/compiler/rustc_resolve/src/rustdoc.rs +++ b/compiler/rustc_resolve/src/rustdoc.rs @@ -340,6 +340,7 @@ pub fn inner_docs(attrs: &[ast::Attribute]) -> bool { fn preprocess_link(link: &str) -> String { let link = link.replace('`', ""); let link = link.split('#').next().unwrap(); + let link = link.trim(); let link = link.rsplit('@').next().unwrap(); let link = link.strip_suffix("()").unwrap_or(link); let link = link.strip_suffix("{}").unwrap_or(link); |
