Skip to content

Commit 7415e4d

Browse files
committed
rustdoc: update pulldown-cmark to 0.10
1 parent d7ea278 commit 7415e4d

File tree

9 files changed

+100
-106
lines changed

9 files changed

+100
-106
lines changed

Cargo.lock

+6-17
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ dependencies = [
23622362
"memchr",
23632363
"once_cell",
23642364
"opener",
2365-
"pulldown-cmark 0.10.2",
2365+
"pulldown-cmark",
23662366
"regex",
23672367
"serde",
23682368
"serde_json",
@@ -3045,20 +3045,9 @@ dependencies = [
30453045

30463046
[[package]]
30473047
name = "pulldown-cmark"
3048-
version = "0.9.6"
3049-
source = "registry+https://github.com/rust-lang/crates.io-index"
3050-
checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b"
3051-
dependencies = [
3052-
"bitflags 2.5.0",
3053-
"memchr",
3054-
"unicase",
3055-
]
3056-
3057-
[[package]]
3058-
name = "pulldown-cmark"
3059-
version = "0.10.2"
3048+
version = "0.10.3"
30603049
source = "registry+https://github.com/rust-lang/crates.io-index"
3061-
checksum = "5f0530d13d87d1f549b66a3e8d0c688952abe5994e204ed62615baaf25dc029c"
3050+
checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993"
30623051
dependencies = [
30633052
"bitflags 2.5.0",
30643053
"memchr",
@@ -3068,9 +3057,9 @@ dependencies = [
30683057

30693058
[[package]]
30703059
name = "pulldown-cmark-escape"
3071-
version = "0.10.0"
3060+
version = "0.10.1"
30723061
source = "registry+https://github.com/rust-lang/crates.io-index"
3073-
checksum = "d5d8f9aa0e3cbcfaf8bf00300004ee3b72f74770f9cbac93f6928771f613276b"
3062+
checksum = "bd348ff538bc9caeda7ee8cad2d1d48236a1f443c1fa3913c6a02fe0043b1dd3"
30743063

30753064
[[package]]
30763065
name = "punycode"
@@ -4522,7 +4511,7 @@ name = "rustc_resolve"
45224511
version = "0.0.0"
45234512
dependencies = [
45244513
"bitflags 2.5.0",
4525-
"pulldown-cmark 0.9.6",
4514+
"pulldown-cmark",
45264515
"rustc_arena",
45274516
"rustc_ast",
45284517
"rustc_ast_pretty",

compiler/rustc_resolve/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
9-
pulldown-cmark = { version = "0.9.6", default-features = false }
9+
pulldown-cmark = { version = "0.10", default-features = false, features = ["html"] }
1010
rustc_arena = { path = "../rustc_arena" }
1111
rustc_ast = { path = "../rustc_ast" }
1212
rustc_ast_pretty = { path = "../rustc_ast_pretty" }

compiler/rustc_resolve/src/rustdoc.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
use pulldown_cmark::{BrokenLink, CowStr, Event, LinkType, Options, Parser, Tag};
1+
use pulldown_cmark::{
2+
BrokenLink, BrokenLinkCallback, CowStr, Event, LinkType, Options, Parser, Tag,
3+
};
24
use rustc_ast as ast;
35
use rustc_ast::util::comments::beautify_doc_string;
46
use rustc_data_structures::fx::FxHashMap;
@@ -426,7 +428,7 @@ fn parse_links<'md>(doc: &'md str) -> Vec<Box<str>> {
426428

427429
while let Some(event) = event_iter.next() {
428430
match event {
429-
Event::Start(Tag::Link(link_type, dest, _)) if may_be_doc_link(link_type) => {
431+
Event::Start(Tag::Link { link_type, dest_url, .. }) if may_be_doc_link(link_type) => {
430432
if matches!(
431433
link_type,
432434
LinkType::Inline
@@ -440,7 +442,7 @@ fn parse_links<'md>(doc: &'md str) -> Vec<Box<str>> {
440442
}
441443
}
442444

443-
links.push(preprocess_link(&dest));
445+
links.push(preprocess_link(&dest_url));
444446
}
445447
_ => {}
446448
}
@@ -450,9 +452,10 @@ fn parse_links<'md>(doc: &'md str) -> Vec<Box<str>> {
450452
}
451453

452454
/// Collects additional data of link.
453-
fn collect_link_data<'input, 'callback>(
454-
event_iter: &mut Parser<'input, 'callback>,
455-
) -> Option<Box<str>> {
455+
fn collect_link_data<'input, F>(event_iter: &mut Parser<'input, F>) -> Option<Box<str>>
456+
where
457+
F: BrokenLinkCallback<'input>,
458+
{
456459
let mut display_text: Option<String> = None;
457460
let mut append_text = |text: CowStr<'_>| {
458461
if let Some(display_text) = &mut display_text {

0 commit comments

Comments
 (0)