Skip to content

Internal compiler error when show par discards collected tag #7257

Open

Description

@sijow

Description

The following code

#show par: none

#show heading: it => {
  // No problem when the following two lines are exchanged
  block()
  it.body
}

= Section
#lorem(30)

gives

thread 'main' panicked at crates/typst-pdf/src/tags/tree/build.rs:181:5:
tags weren't properly closed
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/panicking.rs:75:14
   2: typst_pdf::tags::tree::build::build
             at /home/j/repos/typst/crates/typst-pdf/src/tags/tree/build.rs:181:5
   3: typst_pdf::tags::init
             at /home/j/repos/typst/crates/typst-pdf/src/tags/mod.rs:28:9
   4: typst_pdf::convert::setup
             at /home/j/repos/typst/crates/typst-pdf/src/convert.rs:102:16
   5: typst_pdf::convert::convert
             at /home/j/repos/typst/crates/typst-pdf/src/convert.rs:44:34
   6: typst_pdf::pdf
             at /home/j/repos/typst/crates/typst-pdf/src/lib.rs:32:5
   7: typst::compile::export_pdf
             at /home/j/repos/typst/crates/typst-cli/src/compile.rs:377:18
   8: typst::compile::export_paged
             at /home/j/repos/typst/crates/typst-cli/src/compile.rs:341:13
   9: typst::compile::compile_and_export::{{closure}}
             at /home/j/repos/typst/crates/typst-cli/src/compile.rs:313:53
  10: core::result::Result<T,E>::and_then
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/result.rs:1381:22
  11: typst::compile::compile_and_export
             at /home/j/repos/typst/crates/typst-cli/src/compile.rs:313:26
  12: typst::compile::compile_once
             at /home/j/repos/typst/crates/typst-cli/src/compile.rs:248:43
  13: typst::compile::compile::{{closure}}
             at /home/j/repos/typst/crates/typst-cli/src/compile.rs:43:38
  14: typst::timings::Timer::record
             at /home/j/repos/typst/crates/typst-cli/src/timings.rs:48:23
  15: typst::compile::compile
             at /home/j/repos/typst/crates/typst-cli/src/compile.rs:43:5
  16: typst::dispatch
             at /home/j/repos/typst/crates/typst-cli/src/main.rs:76:38
  17: typst::main
             at /home/j/repos/typst/crates/typst-cli/src/main.rs:58:15
  18: core::ops::function::FnOnce::call_once
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/ops/function.rs:250:5

Reproduction URL

No response

Operating system

Linux

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Oct 29, 2025
  2. added
    pdf
    crash
    urgent
    on Oct 29, 2025
  3. self-assigned this
    on Oct 31, 2025
  4. laurmaedje commented on Nov 3, 2025

    @laurmaedje
    Member

    Minimized a bit more:

    #show par: none
    #show heading: v(0pt) + [A]
    #[= A]B

    The problem is that the heading's end tag is collected into the paragraph and then show par throws the end tag away...

  5. removed
    crash
    urgent
    on Nov 27, 2025
  6. changed the title [-]Crash with heading and par rules[/-] [+]Internal compiler error with heading and par rules[/+] on Jan 26, 2026
  7. changed the title [-]Internal compiler error with heading and par rules[/-] [+]Internal compiler error when `show par` discards collected tag[/+] on Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugpdf

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions