Skip to content

Update dependency pulldown-cmark to v0.10.0 for mdman #13509

@weihanglo

Description

@weihanglo

Problem

Renovate bot found a newer version available for dependency pulldown-cmark in #13508. pulldown-cmark is used by mdman for templatizing and generating man pages.

However, the new version has some API changes that need to be fixed:

Build failure. Click to See details

error[E0433]: failed to resolve: could not find `html` in `pulldown_cmark`
  --> crates/mdman/src/format/md.rs:22:25
   |
22 |         pulldown_cmark::html::push_html(&mut html_output, parser.map(|(e, _r)| e));
   |                         ^^^^ could not find `html` in `pulldown_cmark`

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Heading`
   --> crates/mdman/src/format/man.rs:125:25
    |
125 |                         Tag::Heading(level, ..) => {
    |                         ^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Link`
   --> crates/mdman/src/format/man.rs:215:25
    |
215 |                         Tag::Link(link_type, dest_url, _title) => {
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Image`
   --> crates/mdman/src/format/man.rs:250:25
    |
250 |                         Tag::Image(_link_type, _dest_url, _title) => {
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:257:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
257 |                         Tag::Paragraph => self.flush(),
    |                         ^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Heading`
   --> crates/mdman/src/format/man.rs:258:25
    |
258 |                         Tag::Heading(..) => {}
    |                         ^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:259:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
259 |                         Tag::BlockQuote => {
    |                         ^^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:264:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
264 |                         Tag::CodeBlock(_kind) => {
    |                         ^^^^^^^^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:269:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
269 |                         Tag::List(_) => {
    |                         ^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:272:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
272 |                         Tag::Item => {
    |                         ^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:277:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
277 |                         Tag::FootnoteDefinition(_label) => {}
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:278:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
278 |                         Tag::Table(_) => {
    |                         ^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:284:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
284 |                         Tag::TableHead => {}
    |                         ^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:285:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
285 |                         Tag::TableRow => {}
    |                         ^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:286:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
286 |                         Tag::TableCell => {
    |                         ^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:290:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
290 |                         Tag::Emphasis | Tag::Strong => self.pop_font(),
    |                         ^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:290:41
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
290 |                         Tag::Emphasis | Tag::Strong => self.pop_font(),
    |                                         ^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/man.rs:291:25
    |
256 |                     match &tag {
    |                           ---- this expression has type `&TagEnd`
...
291 |                         Tag::Strikethrough => self.output.push_str("~~"),
    |                         ^^^^^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Link`
   --> crates/mdman/src/format/man.rs:292:25
    |
292 |                         Tag::Link(link_type, dest_url, _title) => {
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Image`
   --> crates/mdman/src/format/man.rs:311:25
    |
311 |                         Tag::Image(_link_type, _dest_url, _title) => {}
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Heading`
   --> crates/mdman/src/format/text.rs:119:25
    |
119 |                         Tag::Heading(level, ..) => {
    |                         ^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Link`
   --> crates/mdman/src/format/text.rs:183:25
    |
183 |                         Tag::Link(link_type, dest_url, _title) => {
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Image`
   --> crates/mdman/src/format/text.rs:216:25
    |
216 |                         Tag::Image(_link_type, _dest_url, _title) => {
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:222:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
222 |                     Tag::Paragraph => {
    |                     ^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Heading`
   --> crates/mdman/src/format/text.rs:226:21
    |
226 |                     Tag::Heading(..) => {}
    |                     ^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:227:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
227 |                     Tag::BlockQuote => {
    |                     ^^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:230:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
230 |                     Tag::CodeBlock(_kind) => {
    |                     ^^^^^^^^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:235:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
235 |                     Tag::List(_) => {
    |                     ^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:238:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
238 |                     Tag::Item => {
    |                     ^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:243:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
243 |                     Tag::FootnoteDefinition(_label) => {}
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:244:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
244 |                     Tag::Table(_) => {}
    |                     ^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:245:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
245 |                     Tag::TableHead => {}
    |                     ^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:246:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
246 |                     Tag::TableRow => {}
    |                     ^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:247:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
247 |                     Tag::TableCell => {}
    |                     ^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:248:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
248 |                     Tag::Emphasis => {}
    |                     ^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:249:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
249 |                     Tag::Strong => {}
    |                     ^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:250:21
    |
221 |                 Event::End(tag) => match &tag {
    |                                          ---- this expression has type `&TagEnd`
...
250 |                     Tag::Strikethrough => self.word.push_str("~~"),
    |                     ^^^^^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Link`
   --> crates/mdman/src/format/text.rs:251:21
    |
251 |                     Tag::Link(link_type, dest_url, _title) => {
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Image`
   --> crates/mdman/src/format/text.rs:268:21
    |
268 |                     Tag::Image(_link_type, _dest_url, _title) => {}
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Link`
   --> crates/mdman/src/format/text.rs:454:21
    |
454 |                     Tag::Link(_, _, _) => {}
    |                     ^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:458:21
    |
457 |                 Event::End(tag) => match tag {
    |                                          --- this expression has type `TagEnd`
458 |                     Tag::Table(_) => return self.render(indent),
    |                     ^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:459:21
    |
457 |                 Event::End(tag) => match tag {
    |                                          --- this expression has type `TagEnd`
458 |                     Tag::Table(_) => return self.render(indent),
459 |                     Tag::TableCell => {
    |                     ^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:463:21
    |
457 |                 Event::End(tag) => match tag {
    |                                          --- this expression has type `TagEnd`
...
463 |                     Tag::TableHead | Tag::TableRow => {
    |                     ^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:463:38
    |
457 |                 Event::End(tag) => match tag {
    |                                          --- this expression has type `TagEnd`
...
463 |                     Tag::TableHead | Tag::TableRow => {
    |                                      ^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0308]: mismatched types
   --> crates/mdman/src/format/text.rs:467:21
    |
457 |                 Event::End(tag) => match tag {
    |                                          --- this expression has type `TagEnd`
...
467 |                     Tag::Strikethrough => self.cell.push_str("~~"),
    |                     ^^^^^^^^^^^^^^^^^^ expected `TagEnd`, found `Tag<'_>`

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Heading`
  --> crates/mdman/src/util.rs:34:26
   |
34 |         Some((Event::End(Tag::Heading(..)), _range)) => {
   |                          ^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Link`
  --> crates/mdman/src/lib.rs:77:22
   |
77 |         Event::Start(Tag::Link(lt, dest_url, title)) if !matches!(lt, LinkType::Email) => (
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0164]: expected tuple struct or tuple variant, found struct variant `Tag::Link`
  --> crates/mdman/src/lib.rs:81:20
   |
81 |         Event::End(Tag::Link(lt, dest_url, title)) if !matches!(lt, LinkType::Email) => (
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0533]: expected value, found struct variant `Tag::Link`
  --> crates/mdman/src/lib.rs:78:26
   |
78 |             Event::Start(Tag::Link(lt, join_url(url.as_ref(), dest_url), title)),
   |                          ^^^^^^^^^ not a value

error[E0533]: expected value, found struct variant `Tag::Link`
  --> crates/mdman/src/lib.rs:82:24
   |
82 |             Event::End(Tag::Link(lt, join_url(url.as_ref(), dest_url), title)),
   |                        ^^^^^^^^^ not a value

Some errors have detailed explanations: E0164, E0308, E0433, E0533.
For more information about an error, try `rustc --explain E0164`.

Steps

  1. Clone rust-lang/cargo
  2. Run cargo build-man
  3. Fix the build failure.

Possible Solution(s)

Look into what have been changed in pulldown-cmark and update accordingly.

Version

ecb8193f8dfedb7586c16729f6793ed47ae3c51e

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cli-helpArea: built-in command-line helpC-cleanupCategory: cleanup within the codebaseE-easyExperience: EasyP-lowPriority: LowS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions